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