00bbcd1a20165bcf8cb5c872d8d176a35da55306
[platform/upstream/gcc.git] / gcc / fortran / ChangeLog
1 2013-03-18  Tobias Burnus  <burnus@net-b.de>
2
3         * gfortran.h (gfc_option_t): Remove flag_whole_file.
4         * invoke.texi (-fno-whole-file): Remove.
5         * lang.opt (fwhole-file): Change to Ignore.
6         * options.c (gfc_init_options, gfc_post_options,
7         gfc_handle_option): Remove !flag_whole_file handling
8         * parse.c (resolve_all_program_units, translate_all_program_units,
9         gfc_parse_file): Ditto.
10         * resolve.c (resolve_global_procedure): Ditto.
11         * trans-decl.c (gfc_get_symbol_decl, gfc_get_extern_function_decl,
12         gfc_create_module_variable): Ditto.
13         * trans-types.c (gfc_get_derived_type): Ditto.
14
15 2013-03-15  Tobias Burnus  <burnus@net-b.de>
16
17         PR fortran/56615
18         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Pack arrays
19         if they are not simply contiguous.
20
21 2013-03-11  Tobias Burnus  <burnus@net-b.de>
22
23         * gfortran.texi (STRUCTURE and RECORD): State more clearly how
24         to convert them into derived types.
25
26 2013-03-10  Paul Thomas  <pault@gcc.gnu.org>
27
28         PR fortran/56575
29         * expr.c (gfc_default_initializer): Check that a class declared
30         type has any components.
31         * resolve.c (resolve_fl_derived0): On failing the test for C437
32         set the type to BT_UNKNOWN to prevent repeat error messages.
33
34 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
35
36         PR fortran/56477
37         * expr.c (gfc_check_pointer_assign): Avoid NULL pointer dereference.
38
39 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
40
41         PR fortran/54730
42         * array.c (gfc_match_array_constructor): Set a checkpoint before
43         matching a typespec.  Drop it on success, restore it otherwise.
44
45 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
46
47         PR fortran/54730
48         * gfortran.h (struct gfc_undo_change_set): New field 'previous'.
49         (gfc_new_undo_checkpoint, gfc_drop_last_undo_checkpoint,
50         gfc_restore_last_undo_checkpoint): New prototypes.
51         * symbol.c (default_undo_chgset_var): Update initialization.
52         (single_undo_checkpoint_p, gfc_new_undo_checkpoint,
53         free_undo_change_set_data, pop_undo_change_set,
54         gfc_drop_last_undo_checkpoint, enforce_single_undo_checkpoint):
55         New functions.
56         (save_symbol_data): Handle multiple change sets.  Make sure old_symbol
57         field's previous value is not overwritten.  Clear gfc_new field.
58         (restore_old_symbol): Restore previous old_symbol field.
59         (gfc_restore_last_undo_checkpoint): New function, using body renamed
60         from gfc_undo_symbols.  Restore the previous change set as current one.
61         (gfc_undo_symbols): New body.
62         (gfc_commit_symbols, gfc_commit_symbol, gfc_enforce_clean_symbol_state):
63         Call enforce_single_undo_checkpoint.
64         (gfc_symbol_done_2): Ditto.  Free change set data.
65
66 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
67
68         * symbol.c (restore_old_symbol): Fix thinko.
69
70 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
71
72         * symbol.c (gfc_undo_symbols): Move code...
73         (restore_old_symbol): ... here as a new function.
74
75 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
76
77         * Make-lang.in (F95_PARSER_OBJS): Add dependency to vec.h.
78         * gfortran.h: Include vec.h.
79         (gfc_undo_change_set): New struct.
80         * symbol.c (tentative_tbp): Remove struct.
81         (changed_syms, tentative_tbp_list): Remove variables.
82         (default_undo_chgset_var, latest_undo_chgset): New variables.
83         (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols,
84         gfc_commit_symbols, gfc_commit_symbol,
85         gfc_enforce_clean_symbol_state, gfc_get_typebound_proc):
86         Use latest_undo_chgset instead of changed_syms and tentative_tbp_list.
87
88 2013-03-01  Tobias Burnus  <burnus@net-b.de>
89
90         PR fortran/56491
91         * iresolve.c (resolve_bound): Use gfc_get_string instead of xstrdup.
92         * symbol.c (free_components): Free proc-pointer components.
93
94 2013-03-01  Tobias Burnus  <burnus@net-b.de>
95
96         * trans-decl.c (gfc_trans_deferred_vars): Free expr after use.
97         * trans-io.c (build_dt): Ditto.
98
99 2013-02-24  Joseph Myers  <joseph@codesourcery.com>
100
101         * resolve.c (generate_component_assignments): Don't use UTF-8
102         ligature in diagnostic.
103
104 2013-02-21  Janus Weil  <janus@gcc.gnu.org>
105
106         PR fortran/56385
107         * trans-array.c (structure_alloc_comps): Handle procedure-pointer
108         components with allocatable result.
109
110 2012-02-21  Tobias Burnus  <burnus@net-b.de>
111
112         PR fortran/56416
113         * gfortran.texi (Part II: Language Reference, Extensions,
114         Non-Fortran Main Program): Sort @menu to match actual section order.
115         * intrinsic.texi (Intrinsic Procedures): Ditto.
116         (C_F_POINTER, PRECISION): Move to the alphabetically correct place.
117
118 2013-02-15  Tobias Burnus  <burnus@net-b.de>
119             Mikael Morin  <mikael@gcc.gnu.org>
120
121         PR fortran/56318
122         * simplify.c (gfc_simplify_matmul): Fix result shape
123         and matmul result.
124
125 2013-02-15  Tobias Burnus  <burnus@net-b.de>
126
127         PR fortran/53818
128         * resolve.c (apply_default_init_local): Don't create an
129         initializer for a result variable.
130
131 2013-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
132
133         PR fortran/56224
134         * gfortran.h (gfc_add_include_path):  Add boolean argument
135         for warn.
136         * scanner.c (gfc_add_include_path):  Pass along warn argument
137         to add_path_to_list.
138         * options.c (gfc_post_options):  Add true warn argument to
139         gfc_add_include_path.
140         (gfc_handle_module_path_options):  Likewise.
141         (gfc_handle_option): Also gfc_add_include_path for intrinsic
142         modules, without warning.
143
144 2013-02-14  Paul Thomas  <pault@gcc.gnu.org>
145             Tobias Burnus  <burnus@net-b.de>
146
147         PR testsuite/56138
148         * trans-decl.c (gfc_get_symbol_decl): Fix deferred-length
149         results for functions without extra result variable.
150
151         Revert:
152         2013-01-30  Tobias Burnus  <burnus@net-b.de>
153
154         PR fortran/56138
155         * trans-decl.c (gfc_trans_deferred_vars): Fix deferred-length
156         results for functions without extra result variable.
157
158 2013-02-12  Janus Weil  <janus@gcc.gnu.org>
159
160         PR fortran/46952
161         * resolve.c (resolve_call): Do not check deferred procedures for
162         recursiveness.
163
164 2013-02-09  Paul Thomas  <pault@gcc.gnu.org>
165
166         PR fortran/55362
167         * check.c (array_check): It is an error if a procedure is
168         passed.
169
170 2013-02-08  Mikael Morin  <mikael@gcc.gnu.org>
171
172         PR fortran/54107
173         * trans-types.c (gfc_get_function_type): Change a NULL backend_decl
174         to error_mark_node on entry.  Detect recursive types.  Build a variadic
175         procedure type if the type is recursive.  Restore the initial
176         backend_decl.
177
178 2013-02-07  Tobias Burnus  <burnus@net-b.de>
179
180         PR fortran/54339
181         * gfortran.texi (Standards): Mention TS29113.
182         (Varying Length Character): Mention deferred-length
183         strings.
184         (Fortran 2003 Status): Add unlimited polymorphic.
185         (TS 29113 Status): Add TYPE(*) and DIMENSION(..).
186         (C Interop): Update the section about TS29113.
187
188 2013-02-06 Paul Thomas  <pault@gcc.gnu.org>
189
190         PR fortran/55789
191         * trans-array.c (trans_array_constructor): Remove condition
192         'dynamic' = true if the loop ubound is a VAR_DECL.
193
194 2013-02-04  Paul Thomas  <pault@gcc.gnu.org>
195
196         PR fortran/56008
197         PR fortran/47517
198         * trans-array.c (gfc_alloc_allocatable_for_assignment): Save
199         the lhs descriptor before it is modified for reallocation. Use
200         it to deallocate allocatable components in the reallocation
201         block.  Nullify allocatable components for newly (re)allocated
202         arrays.
203
204 2013-02-04  Mikael Morin  <mikael@gcc.gnu.org>
205
206         PR fortran/54195
207         * resolve.c (resolve_typebound_procedures): Recurse through
208         resolve_symbol.
209
210 2013-02-04  Mikael Morin  <mikael@gcc.gnu.org>
211
212         PR fortran/54107
213         PR fortran/54195
214         * gfortran.h (struct gfc_symbol): New field 'resolved'.
215         * resolve.c (resolve_fl_var_and_proc): Don't skip result symbols.
216         (resolve_symbol): Skip duplicate calls.  Don't check the current
217         namespace.
218
219 2013-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
220
221         PR fortran/50627
222         PR fortran/56054
223         * decl.c (gfc_match_end):  Remove half-ready namespace
224         from parent if the end of a block is missing.
225         * parse.c (parse_module):  Do not put namespace into
226         gsymbol on error.
227
228 2013-01-30  Tobias Burnus  <burnus@net-b.de>
229
230         PR fortran/56138
231         * trans-decl.c (gfc_trans_deferred_vars): Fix deferred-length
232         results for functions without extra result variable.
233
234 2013-01-29  Janus Weil  <janus@gcc.gnu.org>
235             Mikael Morin  <mikael@gcc.gnu.org>
236
237         PR fortran/54107
238         * gfortran.h (gfc_component): Delete members 'formal' and 'formal_ns'.
239         (gfc_copy_formal_args,gfc_copy_formal_args_ppc,gfc_expr_replace_symbols,
240         gfc_expr_replace_comp): Delete.
241         (gfc_sym_get_dummy_args): New prototype.
242         * dependency.c (gfc_check_fncall_dependency): Use
243         'gfc_sym_get_dummy_args'.
244         * expr.c (gfc_is_constant_expr): Ditto.
245         (replace_symbol,gfc_expr_replace_symbols,replace_comp,
246         gfc_expr_replace_comp): Deleted.
247         * frontend-passes.c (doloop_code,do_function): Use
248         'gfc_sym_get_dummy_args'.
249         * interface.c (gfc_check_operator_interface,gfc_compare_interfaces,
250         gfc_procedure_use,gfc_ppc_use,gfc_arglist_matches_symbol,
251         gfc_check_typebound_override): Ditto.
252         * module.c (MOD_VERSION): Bump module version.
253         (mio_component): Do not read/write 'formal' and 'formal_ns'.
254         * resolve.c (resolve_procedure_interface,resolve_fl_derived0): Do not
255         copy formal args, but just keep a pointer to the interface.
256         (resolve_function,resolve_call,resolve_typebound_generic_call,
257         resolve_ppc_call,resolve_expr_ppc,generate_component_assignments,
258         resolve_fl_procedure,gfc_resolve_finalizers,check_generic_tbp_ambiguity,
259         resolve_typebound_procedure,check_uop_procedure): Use
260         'gfc_sym_get_dummy_args'.
261         * symbol.c (free_components): Do not free 'formal' and 'formal_ns'.
262         (gfc_copy_formal_args,gfc_copy_formal_args_ppc): Deleted.
263         (gfc_sym_get_dummy_args): New function.
264         * trans-array.c (get_array_charlen,gfc_walk_elemental_function_args):
265         Use 'gfc_sym_get_dummy_args'.
266         * trans-decl.c (build_function_decl,create_function_arglist,
267         build_entry_thunks,init_intent_out_dt,gfc_trans_deferred_vars,
268         add_argument_checking): Ditto.
269         * trans-expr.c (gfc_map_fcn_formal_to_actual,gfc_conv_procedure_call,
270         gfc_conv_statement_function): Ditto.
271         * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
272         * trans-types.c (create_fn_spec,gfc_get_function_type): Ditto.
273
274 2013-01-28  Tobias Burnus  <burnus@net-b.de>
275             Mikael Morin  <mikael@gcc.gnu.org>
276
277         PR fortran/53537
278         * symbol.c (gfc_find_sym_tree): Don't look for the symbol outside an
279         interface block.
280         (gfc_get_ha_symtree): Let gfc_find_sym_tree lookup the parent namespace.
281         * decl.c (gfc_match_data_decl): Ditto.
282         (variable_decl): Remove undeclared type error.
283         (gfc_match_import): Use renamed instead of original name.
284
285 2013-01-27 Paul Thomas  <pault@gcc.gnu.org>
286
287         PR fortran/55984
288         PR fortran/56047
289         * gfortran.h : Add associate_var to symbol_attr.
290         * resolve.c (resolve_assoc_var): Set associate_var attribute.
291         If the target class_ok is set, set it for the associate
292         variable.
293         * check.c (allocatable_check): Associate variables should not
294         have the allocatable attribute even if their symbols do.
295         * class.c (gfc_build_class_symbol): Symbols with associate_var
296         set will always have a good class container.
297
298 2013-01-23  Janus Weil  <janus@gcc.gnu.org>
299
300         PR fortran/56081
301         * resolve.c (resolve_select): Add argument 'select_type', reject
302         non-scalar expressions.
303         (resolve_select_type,resolve_code): Pass new argument to
304         'resolve_select'.
305
306 2013-01-23  Jakub Jelinek  <jakub@redhat.com>
307
308         PR fortran/56052
309         * trans-decl.c (gfc_get_symbol_decl): Set DECL_ARTIFICIAL
310         and DECL_IGNORED_P on select_type_temporary and don't set
311         DECL_BY_REFERENCE.
312
313 2013-01-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
314
315         PR fortran/55919
316         * scanner.c (add_path_to_list): Copy path to temporary and strip
317         trailing directory separators before calling stat().
318
319 2013-01-17  Richard Biener  <rguenther@suse.de>
320
321         * trans-stmt.c (gfc_trans_do): Conditionally compute countm1
322         dependent on sign of step, avoids repeated evaluation of
323         step sign test.  Avoid undefined overflow issues by using unsigned
324         arithmetic.
325
326 2013-01-16  Janus Weil  <janus@gcc.gnu.org>
327
328         PR fortran/55983
329         * class.c (find_typebound_proc_uop): Check for f2k_derived instead of
330         asserting it.
331
332 2013-01-16  Jakub Jelinek  <jakub@redhat.com>
333             Tobias Burnus  <burnus@net-b.de>
334
335         PR driver/55884
336         * lang.opt (fintrinsic-modules-path): Don't accept Joined.
337         (fintrinsic-modules-path=): New.
338         * options.c (gfc_handle_option, gfc_get_option_string,
339         gfc_get_option_string): Handle the latter.
340
341 2013-01-16  Jakub Jelinek  <jakub@redhat.com>
342
343         PR fortran/52865
344         * trans-stmt.c (gfc_trans_do): Put countm1-- before conditional
345         and use value of countm1 before the decrement in the condition.
346
347 2013-01-15  Paul Thomas  <pault@gcc.gnu.org>
348
349         PR fortran/54286
350         * expr.c (gfc_check_pointer_assign): Check for presence of
351         's2' before using it.
352
353 2013-01-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
354
355         PR fortran/55806
356         * frontend-passes.c (optimize_reduction):  New function,
357         including prototype.
358         (callback_reduction):  Likewise.
359         (gfc_run_passes):  Also run optimize_reduction.
360         (copy_walk_reduction_arg):  New function.
361         (dummy_code_callback):  New function.
362
363 2013-01-13  Jakub Jelinek  <jakub@redhat.com>
364
365         PR fortran/55935
366         * trans-expr.c (gfc_conv_structure): Call
367         unshare_expr_without_location on the ctor elements.
368
369 2013-01-13  Paul Thomas  <pault@gcc.gnu.org>
370
371         PR fortran/54286
372         * expr.c (gfc_check_pointer_assign): Ensure that both lvalue
373         and rvalue interfaces are presented to gfc_compare_interfaces.
374         Simplify references to interface names by using the symbols
375         themselves. Call gfc_compare_interfaces with s1 and s2 inter-
376         changed to overcome the asymmetry of this function. Do not
377         repeat the check for the presence of s1 and s2.
378
379 2013-01-12  Janus Weil  <janus@gcc.gnu.org>
380
381         PR fortran/55072
382         * trans-array.c (gfc_conv_array_parameter): No packing was done for
383         full arrays of derived type.
384
385 2013-01-08  Paul Thomas  <pault@gcc.gnu.org>
386
387         PR fortran/55868
388         * class.c (get_unique_type_string): Change $tar to STAR and
389         replace sprintf by strcpy where there is no formatting.
390         * decl.c (gfc_match_decl_type_spec): Change $tar to STAR.
391
392 2013-01-09  Mikael Morin  <mikael@gcc.gnu.org>
393
394         PR fortran/47203
395         * module.c (check_for_ambiguous): Get the current program unit using
396         gfc_current_ns.
397
398 2013-01-09  Tobias Burnus  <burnus@net-b.de>
399
400         PR fortran/55758
401         * resolve.c (resolve_symbol): Reject non-C_Bool logicals
402         in BIND(C) procedures with -std=f*.
403
404 2013-01-08  Paul Thomas  <pault@gcc.gnu.org>
405
406         PR fortran/55618
407         * trans-expr.c (gfc_conv_procedure_call): Dereference scalar
408         character function arguments to elemental procedures in
409         scalarization loops.
410
411 2013-01-07  Tobias Burnus  <burnus@net-b.de>
412
413         PR fortran/55763
414         * gfortran.h (gfc_check_assign_symbol): Update prototype.
415         * decl.c (add_init_expr_to_sym, do_parm): Update call.
416         * expr.c (gfc_check_assign_symbol): Handle BT_CLASS and
417         improve error location; support components.
418         (gfc_check_pointer_assign): Handle component assignments.
419         * resolve.c (resolve_fl_derived0): Call gfc_check_assign_symbol.
420         (resolve_values): Update call.
421         (resolve_structure_cons): Avoid double diagnostic.
422
423 2013-01-07  Tobias Burnus  <burnus@net-b.de>
424             Thomas Koenig  <tkoenig@gcc.gnu.org>
425
426         PR fortran/55852
427         * expr.c (gfc_build_intrinsic_call): Avoid clashes
428         with user's procedures.
429         * gfortran.h (gfc_build_intrinsic_call): Update prototype.
430         * simplify.c (gfc_simplify_size): Update call.
431         * class.c (finalization_scalarizer, finalization_get_offset,
432         finalizer_insert_packed_call, generate_finalization_wrapper):
433         Clean up by using gfc_build_intrinsic_call.
434
435 2013-01-07  Tobias Burnus  <burnus@net-b.de>
436
437         PR fortran/55763
438         * resolve.c (resolve_select_type): Reject intrinsic types for
439         a non-unlimited-polymorphic selector.
440
441 2013-01-06  Paul Thomas  <pault@gcc.gnu.org>
442
443         PR fortran/53876
444         PR fortran/54990
445         PR fortran/54992
446         * trans-array.c (build_array_ref): Check the TYPE_CANONICAL
447         to see if it is GFC_CLASS_TYPE_P.
448         * trans-expr.c (gfc_get_vptr_from_expr): The same.
449         (gfc_conv_class_to_class): If the types are not the same,
450         cast parmese->expr to the type of ctree.
451         * trans-types.c (gfc_get_derived_type): GFC_CLASS_TYPE_P of
452         CLASS components must be set.
453
454 2013-01-06  Mikael Morin  <mikael@gcc.gnu.org>
455
456         PR fortran/42769
457         PR fortran/45836
458         PR fortran/45900
459         * module.c (read_module): Don't reuse local symtree if the associated
460         symbol isn't exactly the one wanted.  Don't reuse local symtree if it is
461         ambiguous.
462         * resolve.c (resolve_call): Use symtree's name instead of symbol's to
463         lookup the symtree.
464
465 2013-01-05  Steven G. Kargl  <kargl@gcc.gnu.org>
466             Mikael Morin  <mikael@gcc.gnu.org>
467
468         PR fortran/55827
469         * class.c (gfc_fix_class_refs): Adapt ts initialization for the case
470         e->symtree == NULL.
471         * trans-expr.c (gfc_conv_function_expr): Init sym earlier. Use it.
472
473 2013-01-05  Tobias Burnus  <burnus@net-b.de>
474
475         * class.c (finalize_component): Used passed offset expr.
476         (finalization_get_offset): New static function.
477         (finalizer_insert_packed_call, generate_finalization_wrapper): Use it
478         to handle noncontiguous arrays.
479
480 2013-01-04  Tobias Burnus  <burnus@net-b.de>
481
482         * trans.c (gfc_build_final_call): New function.
483         * trans.h (gfc_build_final_call, gfc_conv_scalar_to_descriptor):
484         New function prototypes.
485         * trans-expr.c (gfc_conv_scalar_to_descriptor): Renamed from
486         conv_scalar_to_descriptor, removed static attribute.
487         (gfc_conv_procedure_call): Honor renaming.
488
489 2013-01-04  Tobias Burnus  <burnus@net-b.de>
490
491         * intrinsic.c (add_functions): New internal intrinsic
492         function GFC_PREFIX ("stride").
493         * gfortran.h (gfc_isym_id): Add GFC_ISYM_STRIDE.
494         * intrinsic.h (gfc_resolve_stride): New prototypes.
495         * iresolve.c (gfc_resolve_stride): New function.
496         * trans-intrinsic.c (conv_intrinsic_stride): New static
497         function.
498         (gfc_conv_intrinsic_function): Use it.
499
500 2013-01-04  Tobias Burnus  <burnus@net-b.de>
501
502         * class.c (gfc_find_intrinsic_vtab): Add _final
503         component.
504         * decl.c (gfc_match_null): Remove superfluous
505         variadic argument to gfc_match.
506
507 2013-01-04  Paul Thomas  <pault@gcc.gnu.org>
508
509         PR fortran/55172
510         * match.c (copy_ts_from_selector_to_associate): Remove call to
511         gfc_resolve_expr and replace it with explicit setting of the
512         array reference type.
513         * resolve.c (resolve_select_type): It is an error if the
514         selector is coindexed.
515
516 2013-01-04  Tobias Burnus  <burnus@net-b.de>
517
518         PR fortran/55763
519         * decl.c (gfc_match_null): Parse and reject MOLD.
520
521 2013-01-04  Tobias Burnus  <burnus@net-b.de>
522
523         PR fortran/55854
524         PR fortran/55763
525         * class.c (gfc_class_null_initializer): Fix finding the vtab.
526         (gfc_find_intrinsic_vtab): Use BT_VOID for some components.
527
528 2013-01-03  Janus Weil  <janus@gcc.gnu.org>
529
530         PR fortran/55855
531         * expr.c (gfc_check_assign): Use 'gfc_expr_attr' to evaluate attributes
532         of rvalue. Correct hyphenation in error message.
533
534 2013-01-03  Jakub Jelinek  <jakub@redhat.com>
535
536         * gfortranspec.c (lang_specific_driver): Update copyright notice
537         dates.
538 \f
539 Copyright (C) 2013 Free Software Foundation, Inc.
540
541 Copying and distribution of this file, with or without modification,
542 are permitted in any medium without royalty provided the copyright
543 notice and this notice are preserved.