OSDN Git Service

2011-02-12 Janus Weil <janus@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2011-02-12  Janus Weil  <janus@gcc.gnu.org>
2
3         * class.c (gfc_build_class_symbol): Reject polymorphic arrays.
4         * decl.c (build_sym,build_struct,attr_decl1): Use return value of
5         'gfc_build_class_symbol'.
6
7 2011-02-12  Michael Matz  <matz@suse.de>
8             Janus Weil  <janus@gcc.gnu.org>
9             Tobias Burnus  <burnus@net-b.de>
10
11         PR fortran/45586
12         * trans-expr.c (conv_parent_component_references): Avoid unintendent
13         skipping of parent compounds.
14
15 2011-02-11  Tobias Burnus  <burnus@net-b.de>
16
17         PR fortran/47550
18         * resolve.c (resolve_formal_arglist): PURE with VALUE
19         and no INTENT: Add -std= diagnostics.
20
21 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
22
23         PR fortran/47352
24         * resolve.c (resolve_procedure_interface): If interface has a result
25         variable, copy the typespec and set result pointer to self.
26
27 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
28
29         PR fortran/47463
30         * resolve.c (resolve_typebound_subroutine): Remove erroneous line.
31
32 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
33
34         PR fortran/47637
35         * trans-decl.c (init_intent_out_dt): Handle CLASS arguments.
36
37 2011-02-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
38
39         * io.c (match_io_element): Do not set dt if not inquire.
40
41 2011-02-08  Janus Weil  <janus@gcc.gnu.org>
42
43         PR fortran/45290
44         * expr.c (gfc_check_assign_symbol): Reject pointers as pointer
45         initialization target.
46
47 2011-02-07  Janne Blomqvist  <jb@gcc.gnu.org>
48             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
49
50         * gfortran.texi (Thread-safety): texinfo styling fixes.
51         * intrinsic.texi: Likewise.
52
53 2011-02-06  Janne Blomqvist  <jb@gcc.gnu.org>
54
55         * gfortran.texi (Compiler Characteristics): Add reference to
56         thread-safety section.
57
58 2011-02-06  Janne Blomqvist  <jb@gcc.gnu.org>
59
60         * gfortran.texi (Thread-safety): New section.
61         * intrinsic.texi (EXECUTE_COMMAND_LINE): Mention thread-safety.
62         (GETENV): Likewise.
63         (GET_ENVIRONMENT_VARIABLE): Likewise.
64         (SYSTEM): Likewise.
65
66 2011-02-06  Paul Thomas  <pault@gcc.gnu.org>
67
68         PR fortran/47592
69         * trans-stmt.c (gfc_trans_allocate): For deferred character
70         length allocations with SOURCE, store to the values and string
71         length to avoid calculating twice.  Replace gfc_start_block
72         with gfc_init_block to avoid unnecessary contexts and to keep
73         declarations of temporaries where they should be. Tidy up the
74         code a bit.
75
76 2011-02-05  Janne Blomqvist  <jb@gcc.gnu.org>
77
78         PR fortran/42434
79         * intrinsic.texi (SYSTEM_CLOCK): Update documentation.
80
81 2011-02-02  Janus Weil  <janus@gcc.gnu.org>
82             Paul Thomas  <pault@gcc.gnu.org>
83
84         PR fortran/47082
85         * trans-expr.c (gfc_trans_class_init_assign): Add call to
86         gfc_get_derived_type.
87         * module.c (read_cleanup): Do not use unique_symtrees for vtabs
88         or vtypes.
89
90 2011-02-02  Janus Weil  <janus@gcc.gnu.org>
91
92         PR fortran/47572
93         * resolve.c (resolve_fl_variable): Handle polymorphic allocatables.
94
95 2011-02-01  Janus Weil  <janus@gcc.gnu.org>
96
97         PR fortran/47565
98         * trans-expr.c (gfc_conv_structure): Handle constructors for procedure
99         pointer components with allocatable result.
100
101 2011-01-31  Janus Weil  <janus@gcc.gnu.org>
102
103         PR fortran/47455
104         * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointers
105         with pointer or allocatable result.
106
107 2011-01-31  Paul Thomas  <pault@gcc.gnu.org>
108
109         PR fortran/47519
110         * trans-stmt.c (gfc_trans_allocate): Improve handling of
111         deferred character lengths with SOURCE.
112         * iresolve.c (gfc_resolve_repeat): Calculate character
113         length from source length and ncopies.
114         * dump-parse-tree.c (show_code_node): Show MOLD and SOURCE
115         expressions for ALLOCATE.
116
117 2011-01-31  Janus Weil  <janus@gcc.gnu.org>
118
119         PR fortran/47463
120         * resolve.c (resolve_typebound_subroutine): Bug fix for the case of
121         an argument of a typebound assignment being a component.
122
123 2011-01-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
124
125         * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use
126         LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
127
128 2011-01-31  Tobias Burnus  <burnus@net-b.de>
129
130         PR fortran/47042
131         * resolve.c (resolve_fl_procedure): Reject stmt functions
132         with pointer/allocatable attribute.
133
134 2011-01-31  Tobias Burnus  <burnus@net-b.de>
135
136         PR fortran/47042
137         * interface.c (gfc_procedure_use): Add explicit interface check for
138         pointer/allocatable functions.
139
140 2011-01-30  Paul Thomas  <pault@gcc.gnu.org>
141
142         PR fortran/47523
143         * trans-expr.c (gfc_trans_assignment_1): If the rhs is an op
144         expr and is assigned to a deferred character length scalar,
145         make sure that the function is called before reallocation,
146         so that the length is available. Include procedure pointer
147         and procedure pointer component rhs as well.
148
149         PR fortran/45170
150         PR fortran/35810
151         PR fortran/47350
152         * gfortran.dg/allocatable_function_5.f90: New test not added by
153         mistake on 2011-01-28.
154
155 2011-01-29  Tobias Burnus  <burnus@net-b.de>
156
157         PR fortran/47531
158         * check.c (gfc_check_shape): Support kind argument in SHAPE.
159         * intrinsic.c (add_functions): Ditto.
160         * resolve.c (gfc_resolve_shape): Ditto.
161         * simplify.c (gfc_simplify_shape): Ditto.
162         * intrinsic.h (gfc_check_shape, gfc_resolve_shape,
163         gfc_simplify_shape): Update prototypes.
164         * intrinisc.text (SHAPE): Document kind argument.
165
166 2011-01-28  Tobias Burnus  <burnus@net-b.de>
167
168         PR fortran/47507
169         * resolve.c (resolve_formal_arglist): Allow arguments with VALUE
170         attribute also without INTENT.
171
172 2011-01-28  Tobias Burnus  <burnus@net-b.de>
173
174         * gfortran.texi (Fortran 2003 status): Mention support for
175         nonconstant namelist variables.
176
177 2011-01-28  Paul Thomas  <pault@gcc.gnu.org>
178             Tobias Burnus  <burnus@gcc.gnu.org>
179
180         PR fortran/45170
181         PR fortran/35810
182         PR fortran/47350
183         * interface.c (compare_actual_formal): An allocatable or pointer
184         deferred length actual is only allowed if the formal argument
185         is also deferred length. Clean up whitespace.
186         * trans-expr.c (gfc_conv_procedure_call): Pass string length for
187         deferred character length formal arguments by reference. Do the
188         same for function results.
189         (gfc_trans_pointer_assignment): Do not do runtime check of lhs
190         and rhs character lengths, if deferred length lhs.  In this case
191         set the lhs character length to that of the rhs.
192         (gfc_conv_string_parameter): Remove assert that string length is
193         an integer type.
194         (is_scalar_reallocatable_lhs): New function.
195         (alloc_scalar_allocatable_for_assignment): New function.
196         (gfc_trans_assignment_1): Call above new function. If the rhs is
197         a deferred character length itself, makes ure that the function
198         is called before reallocation, so that the length is available.
199         (gfc_trans_asssignment): Remove error about assignment to
200         deferred length character variables.
201         * gfortran.texi : Update entry about (re)allocation on
202         assignment.
203         * trans-stmt.c (gfc_trans_allocate): Add code to handle deferred
204         length character variables.
205         * module.c (mio_typespec): Transfer deferred characteristic.
206         * trans-types.c (gfc_get_function_type): New code to generate
207         hidden typelist, so that those character lengths that are
208         passed by reference get the right type.
209         * resolve.c (resolve_contained_fntype): Supress error for
210         deferred character length functions.
211         (resolve_function, resolve_fl_procedure) The same.
212         (check_symbols): Remove the error that support for
213         entity with deferred type parameter is not yet implemented.
214         (resolve_fl_derived): The same.
215         match.c (alloc_opt_list): Allow MOLD for deferred length object.
216         * trans-decl.c (gfc_get_symbol_decl): For deferred character
217         length dummies, generate a local variable for string length.
218         (create_function_arglist): Hidden length can be a pointer.
219         (gfc_trans_deferred_vars): For deferred character length
220         results and dummies, assign the string length to the local
221         variable from the hidden argument on entry and the other way
222         round on exit, as appropriate.
223
224 2011-01-27  Tobias Burnus  <burnus@net-b.de>
225
226         PR fortran/47474
227         * trans-decl.c (gfc_generate_function_code): Fix init
228         of allocatable result variable with allocatable components.
229
230 2011-01-27  Tobias Burnus  <burnus@net-b.de>
231
232         PR fortran/47472
233         * options.c (gfc_handle_module_path_options): Save
234         module path without trailing slash as include path.
235
236 2011-01-25  Tobias Burnus  <burnus@net-b.de>
237
238         PR fortran/47448
239         * interface.c (gfc_check_operator_interface): Fix
240         defined-assignment check.
241
242 2011-01-23  Tobias Burnus  <burnus@net-b.de>
243
244         PR fortran/47421
245         * trans-decl.c (gfc_trans_deferred_vars): Do not nullify
246         scalar allocatable dummy arguments.
247
248 2011-01-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
249
250         PR fortran/38536
251         * resolve.c (gfc_iso_c_func_interface):  For C_LOC,
252         check for array sections followed by component references
253         which are illegal.  Also check for coindexed arguments.
254
255 2011-01-22  Tobias Burnus  <burnus@net-b.de>
256
257         PR fortran/47399
258         * primary.c (gfc_match_varspec): Relax gcc_assert to allow for
259         PARAMETER TBP.
260
261 2011-01-21  Tobias Burnus  <burnus@net-b.de>
262
263         PR fortran/47394
264         * error.c (gfc_error_now, gfc_fatal_error, gfc_error_check):
265         Use defined instead of magic number exit status codes.
266         * scanner.c (include_line, gfc_new_file): Ditto.
267
268 2011-01-21  Tobias Burnus  <burnus@net-b.de>
269
270         PR fortran/47377
271         * expr.c (gfc_check_pointer_assign): Reject expr data-targets
272         without pointer attribute.
273
274 2011-01-18  Janus Weil  <janus@gcc.gnu.org>
275
276         PR fortran/47240
277         * resolve.c (expression_rank): Fix rank of procedure poiner components.
278         * trans-expr.c (gfc_conv_procedure_call): Take care of procedure
279         pointer components as actual arguments.
280
281 2011-01-17  Jakub Jelinek  <jakub@redhat.com>
282
283         PR fortran/47331
284         * gfortran.h (struct gfc_omp_saved_state): New type.
285         (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New prototypes.
286         * resolve.c (resolve_global_procedure): Call it around gfc_resolve
287         call.
288         * openmp.c (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New
289         functions.
290
291 2011-01-17  Tobias Burnus  <burnus@net-b.de>
292
293         PR fortran/47327
294         * invoke.texi (Options to request or suppress errors
295         and warnings): Fix cross link.
296
297 2011-01-15  Tobias Burnus  <burnus@net-b.de>
298
299         * gfortran.texi: Update Fortran 2003 Status section.
300
301         PR fortran/47177
302         * invoke.texi: Add missing "-E" to the -dM example.
303
304 2011-01-13  Tobias Burnus  <burnus@net-b.de>
305
306         PR fortran/47268
307         * intrinsic.texi (get_command_argument, get_environment_variable):
308         Mark arguments as optional in the Arguments section.
309
310 2011-01-13  Kai Tietz  <kai.tietz@onevision.com>
311             Tobias Burnus  <burnus@net-b.de>
312
313         PR fortran/47260
314         * trans-decl.c (gfc_get_extern_function_decl,
315         build_function_decl): Set TREE_PUBLIC/TREE_EXTERNAL before
316         calling decl_attributes.
317
318 2011-01-13  Tobias Burnus  <burnus@net-b.de>
319             Mikael Morin  <mikael@gcc.gnu.org>
320
321         PR fortran/45848
322         PR fortran/47204
323         * gfortran.h (gfc_code): Move union ext's case_list into
324         the struct block.
325         * dump-parse-tree.c (show_code_node): Adapt by prefixing case_list
326         by "block.".
327         * frontend-passes.c (gfc_code_walker): Ditto.
328         * match.c (gfc_match_goto, gfc_match_call, gfc_match_case,
329         gfc_match_type_is, gfc_match_class_is): Ditto.
330         * resolve.c (resolve_select, resolve_select_type): Ditto.
331         * st.c (gfc_free_statement): Ditto.
332         * trans-stmt.c (gfc_trans_integer_select, gfc_trans_logical_select,
333         gfc_trans_character_select): Ditto.
334         * parse.c (resolve_all_program_units): For error recovery, avoid
335         segfault is proc_name is NULL.
336
337 2011-01-11  Paul Thomas  <pault@gcc.gnu.org>
338
339         PR fortran/47051
340         * trans-array.c (gfc_alloc_allocatable_for_assignment): Change
341         to be standard compliant by testing for shape rather than size
342         before skipping reallocation. Improve comments.
343
344 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
345
346         PR fortran/47224
347         * resolve.c (resolve_actual_arglist): Remove unneeded and buggy piece
348         of code.
349
350 2011-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
351
352         PR fortran/38536
353         * resolve.c (is_scalar_expr_ptr):  For a substring reference,
354         use gfc_dep_compare_expr to compare start and end expession.
355         Add FIXME for using gfc_deb_compare_expr elsewhere.
356
357 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
358
359         PR fortran/46313
360         * class.c (get_unique_type_string): Make type name start with upper
361         case letter.
362
363 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
364
365         PR fortran/46405
366         * invoke.texi:  Mention -ffree-line-length-none and
367         -ffixed-line-length-none for preprocessing.
368
369 2011-01-08  Paul Thomas  <pault@gcc.gnu.org>
370
371         PR fortran/46896
372         * trans-expr.c (gfc_conv_procedure_call): With a non-copying
373         procedure argument (eg TRANSPOSE) use a temporary if there is
374         any chance of aliasing due to host or use association.
375         (arrayfunc_assign_needs_temporary): Correct logic for function
376         results and do not use a temporary for implicitly PURE
377         variables.  Use a temporary for Cray pointees.
378         * symbol.c (gfc_add_save): Explicit SAVE not compatible with
379         implicit pureness of containing procedure.
380         * decl.c (match_old_style_init, gfc_match_data): Where decl
381         would fail in PURE procedure, set implicit_pure to zero.
382         * gfortran.h : Add implicit_pure to structure symbol_attr and
383         add prototype for function gfc_implicit_pure.
384         * expr.c (gfc_check_pointer_assign, gfc_check_vardef_context):
385         Where decl would fail in PURE procedure, reset implicit_pure.
386         * io.c (match_vtag, gfc_match_open, gfc_match_close,
387         gfc_match_print, gfc_match_inquire, gfc_match_wait): The same.
388         * match.c (gfc_match_critical, gfc_match_stopcode,
389         sync_statement, gfc_match_allocate, gfc_match_deallocate): The
390         same.
391         * parse.c (decode_omp_directive): The same.
392         (parse_contained): If not PURE, set implicit pure attribute.
393         * resolve.c (resolve_formal_arglist, resolve_structure_cons,
394         resolve_function, resolve_ordinary_assign) : The same.
395         (gfc_implicit_pure): New function.
396         * module.c (mio_symbol_attribute): Introduce AB_IMPLICIT_PURE
397         to ab_attribute enum and use it in this function.
398
399 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
400
401         PR fortran/45777
402         * symbol.c (gfc_symbols_could_alias):  Strip gfc_ prefix,
403         make static and move in front of its only caller, to ...
404         * trans-array.c (symbols_could_alias): ... here.
405         Pass information about pointer and target status as
406         arguments.  Allocatable arrays don't alias anything
407         unless they have the POINTER attribute.
408         (gfc_could_be_alias):  Keep track of pointer and target
409         status when following references.  Also check if typespecs
410         of components match those of other components or symbols.
411
412 2011-01-07  Tobias Burnus  <burnus@net-b.de>
413
414         PR fortran/41580
415         * class.c (gfc_build_class_symbol): Mark __vtab as attr.vtab.
416         * intrinsic.c (add_functions): Use simplify functions for
417         EXTENDS_TYPE_OF and SAME_TYPE_AS.
418         * intrinsic.h (gfc_simplify_extends_type_of,
419         gfc_simplify_same_type_as): New prototypes.
420         * simplify.c (is_last_ref_vtab, gfc_simplify_extends_type_of,
421         gfc_simplify_same_type_as): New functions.
422
423 2011-01-07  Janus Weil  <janus@gcc.gnu.org>
424
425         PR fortran/47189
426         PR fortran/47194
427         * gfortran.h (gfc_lval_expr_from_sym): Moved prototype.
428         * class.c (gfc_class_null_initializer): Initialize _vptr to declared
429         type.
430         * expr.c (gfc_lval_expr_from_sym): Moved here from symbol.c.
431         * resolve.c (resolve_deallocate_expr): _data component will be added
432         at translation stage.
433         * symbol.c (gfc_lval_expr_from_sym): Moved to expr.c.
434         * trans-stmt.c (gfc_trans_deallocate): Reset _vptr to declared type.
435
436 2011-01-06  Daniel Franke  <franke.daniel@gmail.com>
437
438         PR fortran/33117
439         PR fortran/46478
440         * parse.c (parse_interface): Remove check for procedure types.
441         * interface.c (check_interface0): Verify that procedures are
442         either all SUBROUTINEs or all FUNCTIONs.
443
444 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
445
446         PR fortran/47180
447         * trans-expr.c (gfc_trans_class_assign): Bugfix for r168524 (make sure
448         'vtab' is initialized).
449
450 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
451
452         PR fortran/47180
453         * trans-expr.c (gfc_trans_class_assign): For a polymorphic NULL pointer
454         assignment, set the _vptr component to the declared type.
455
456 2011-01-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
457
458         PR fortran/46017
459         * resolve.c (resolve_allocate_deallocate): Follow references to
460         check for duplicate occurence of allocation/deallocation objects.
461
462 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
463
464         PR fortran/47024
465         * trans-decl.c (gfc_trans_deferred_vars): Initialize the _vpr component
466         of polymorphic allocatables according to their declared type.
467
468 2011-01-04  Janus Weil  <janus@gcc.gnu.org>
469
470         PR fortran/46448
471         * class.c (gfc_find_derived_vtab): Set the module field for the copying
472         routine to make sure it receives module name mangling.
473
474 2011-01-03  Jakub Jelinek  <jakub@redhat.com>
475
476         * gfortranspec.c (lang_specific_driver): Update copyright notice
477         dates.
478
479 2011-01-03  Janus Weil  <janus@gcc.gnu.org>
480
481         * intrinsic.texi (LEADZ): Fix example.
482
483 2011-01-02  Janus Weil  <janus@gcc.gnu.org>
484
485         PR fortran/46408
486         * class.c (gfc_find_derived_vtab): Use EXEC_INIT_ASSIGN for __copy_
487         routine.
488
489 \f
490 Copyright (C) 2011 Free Software Foundation, Inc.
491
492 Copying and distribution of this file, with or without modification,
493 are permitted in any medium without royalty provided the copyright
494 notice and this notice are preserved.