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