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