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