re PR fortran/53685 (surprising warns about transfer with explicit character range)
[platform/upstream/gcc.git] / gcc / fortran / ChangeLog
1 2013-04-22  Janus Weil  <janus@gcc.gnu.org>
2
3         PR fortran/53685
4         PR fortran/57022
5         * check.c (gfc_calculate_transfer_sizes): Fix for array-valued SOURCE
6         expressions.
7         * simplify.c (gfc_simplify_sizeof,gfc_simplify_storage_size): Get rid
8         of special treatment for EXPR_ARRAY.
9         * target-memory.h (gfc_element_size): New prototype.
10         * target-memory.c (size_array): Remove.
11         (gfc_element_size): New function.
12         (gfc_target_expr_size): Modified to always return the full size of the
13         expression.
14
15 2013-04-20  Tobias Burnus  <burnus@net-b.de>
16
17         PR fortran/56907
18         * trans-intrinsic.c (conv_isocbinding_function): Don't pack array
19         passed to C_LOC
20
21 2013-04-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
22             Mikael Morin  <mikael@gcc.gnu.org>
23
24         PR fortran/56872
25         * frontend-passes.c (copy_walk_reduction_arg): Change argument type
26         to gfc_constructor.  If it has an iterator, wrap the copy of its
27         expression in an array constructor with that iterator.  Don't special
28         case function expressions.
29         (callback_reduction): Update caller.  Don't return early if there is
30         an iterator.
31
32 2013-04-18  Tobias Burnus  <burnus@net-b.de>
33
34         * expr.c (find_array_element): Don't copy expr.
35         * data.c (create_character_initializer): Free expr.
36         * frontend-passes.c (combine_array_constructor): Ditto.
37         * match.c (match_typebound_call, gfc_match_select_type): Ditto.
38         * resolve.c (resolve_typebound_function): Free gfc_ref.
39
40 2013-04-18  Tobias Burnus  <burnus@net-b.de>
41
42         PR fortran/56994
43         * invoke.texi (NEAREST): S argument is not optional.
44
45 2013-04-17  Janus Weil  <janus@gcc.gnu.org>
46
47         PR fortran/56814
48         * interface.c (check_result_characteristics): Get result from interface
49         if present.
50
51 2013-04-17  Janne Blomqvist  <jb@gcc.gnu.org>
52
53         PR fortran/40958
54         * scanner.h: New file.
55         * Make-lang.in: Dependencies on scanner.h.
56         * scanner.c (gfc_directorylist): Move to scanner.h.
57         * module.c: Don't include md5.h, include scanner.h and zlib.h.
58         (MOD_VERSION): Add comment about backwards compatibility.
59         (module_fp): Change type to gzFile.
60         (ctx): Remove.
61         (gzopen_included_file_1): New function.
62         (gzopen_included_file): New function.
63         (gzopen_intrinsic_module): New function.
64         (write_char): Use gzputc.
65         (read_crc32_from_module_file): New function.
66         (read_md5_from_module_file): Remove.
67         (gfc_dump_module): Use gz* functions instead of stdio, check gzip
68         crc32 instead of md5.
69         (read_module_to_tmpbuf): Use gz* functions instead of stdio.
70         (gfc_use_module): Use gz* functions.
71
72 2013-04-16  Tobias Burnus  <burnus@net-b.de>
73
74         PR fortran/39505
75         * decl.c (ext_attr_list): Add EXT_ATTR_NO_ARG_CHECK.
76         * gfortran.h (ext_attr_id_t): Ditto.
77         * gfortran.texi (GNU Fortran Compiler Directives):
78         Document it.
79         * interface.c (compare_type_rank): Ignore rank for NO_ARG_CHECK.
80         (compare_parameter): Ditto - and regard as unlimited polymorphic.
81         * resolve.c (resolve_symbol, resolve_variable): Add same constraint
82         checks as for TYPE(*); turn dummy to TYPE(*),dimension(*).
83         (gfc_explicit_interface_required): Require explicit interface
84         for NO_ARG_CHECK.
85
86 2013-04-16  Janus Weil  <janus@gcc.gnu.org>
87
88         PR fortran/56968
89         * expr.c (gfc_check_pointer_assign): Handle generic functions returning
90         procedure pointers.
91
92 2013-04-16  Tobias Burnus  <burnus@net-b.de>
93
94         PR fortran/56969
95         * intrinsic.c (gfc_intrinsic_func_interface): Don't set
96         module name to "(intrinsic)" for intrinsics from intrinsic
97         modules.
98
99 2013-04-15  Tobias Burnus  <burnus@net-b.de>
100
101         * intrinsic.texi (SYSTEM_CLOCK): Recommend kind=8.
102
103 2013-04-15  Janne Blomqvist  <jb@gcc.gnu.org>
104
105         PR fortran/56919
106         * intrinsics.texi (SYSTEM_CLOCK): Update documentation.
107
108 2013-04-15  Tobias Burnus  <burnus@net-b.de>
109
110         * class.c (gfc_find_intrinsic_vtab): Removed unused var.
111         * dependency.c (check_data_pointer_types): Fix check.
112         * frontend-passes.c (check_data_pointer_types): Remove
113         superfluous statement.
114         * parse.c (decode_omp_directive): Add missing break.
115         * resolve.c (resolve_typebound_subroutine: Free variable.
116         * trans-decl.c (create_function_arglist): Correct condition.
117
118 2013-04-14  Mikael Morin  <mikael@gcc.gnu.org>
119
120         PR fortran/56816
121         * match.c (gfc_match_select_type): Add syntax error. Move namespace
122         allocation and cleanup...
123         * parse.c (decode_statement): ... here.
124
125 2013-04-13  Janus Weil  <janus@gcc.gnu.org>
126
127         PR fortran/55959
128         * expr.c (gfc_simplify_expr): Branch is not unreachable.
129
130 2013-04-12  Janus Weil  <janus@gcc.gnu.org>
131
132         PR fortran/56266
133         * primary.c (gfc_match_varspec): Turn gcc_assert into MATCH_ERROR.
134
135 2013-04-12  Tobias Burnus  <burnus@net-b.de>
136
137         PR fortran/56929
138         * trans-array.c (duplicate_allocatable): Fix handling
139         of scalar coarrays.
140
141 2013-04-12  Janus Weil  <janus@gcc.gnu.org>
142
143         PR fortran/56261
144         * gfortran.h (gfc_explicit_interface_required): New prototype.
145         * expr.c (gfc_check_pointer_assign): Check if an explicit interface is
146         required in a proc-ptr assignment.
147         * interface.c (check_result_characteristics): Extra check.
148         * resolve.c (gfc_explicit_interface_required): New function.
149         (resolve_global_procedure): Use new function
150         'gfc_explicit_interface_required'. Do a full interface check.
151
152 2013-04-12  Tobias Burnus  <burnus@net-b.de>
153
154         PR fortran/56845
155         * trans-decl.c (gfc_trans_deferred_vars): Restrict
156         static CLASS init to SAVE and -fno-automatic.
157
158 2013-04-12  Tobias Burnus  <burnus@net-b.de>
159
160         PR fortran/56845
161         * trans-decl.c (gfc_trans_deferred_vars): Set _vptr for
162         allocatable static BT_CLASS.
163         * trans-expr.c (gfc_class_set_static_fields): New function.
164         * trans.h (gfc_class_set_static_fields): New prototype.
165
166 2013-04-11  Janne Blomqvist  <jb@gcc.gnu.org>
167
168         * gfortran.h: Remove enum gfc_try, replace gfc_try with bool type.
169         * arith.c: Replace gfc_try with bool type.
170         * array.c: Likewise.
171         * check.c: Likewise.
172         * class.c: Likewise.
173         * cpp.c: Likewise.
174         * cpp.h: Likewise.
175         * data.c: Likewise.
176         * data.h: Likewise.
177         * decl.c: Likewise.
178         * error.c: Likewise.
179         * expr.c: Likewise.
180         * f95-lang.c: Likewise.
181         * interface.c: Likewise.
182         * intrinsic.c: Likewise.
183         * intrinsic.h: Likewise.
184         * io.c: Likewise.
185         * match.c: Likewise.
186         * match.h: Likewise.
187         * module.c: Likewise.
188         * openmp.c: Likewise.
189         * parse.c: Likewise.
190         * parse.h: Likewise.
191         * primary.c: Likewise.
192         * resolve.c: Likewise.
193         * scanner.c: Likewise.
194         * simplify.c: Likewise.
195         * symbol.c: Likewise.
196         * trans-intrinsic.c: Likewise.
197         * trans-openmp.c: Likewise.
198         * trans-stmt.c: Likewise.
199         * trans-types.c: Likewise.
200
201 2013-04-09  Tobias Burnus  <burnus@net-b.de>
202
203         * gfortran.texi (KIND Type Parameters,
204         Internal representation of LOGICAL variables): Add crossrefs.
205         (Intrinsic Types): Mention issues with _Bool interop.
206         (Naming and argument-passing conventions): New section.
207
208 2013-04-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
209
210         PR fortran/56782
211         * frontend-passes.c (callback_reduction):  Dont't do
212         any simplification if there is only a single element
213         which has an iterator.
214
215 2013-04-07  Tobias Burnus  <burnus@net-b.de>
216
217         PR fortran/56849
218         * iresolve.c (gfc_resolve_reshape): Set shape also
219         with order=.
220
221 2013-04-04  Janus Weil  <janus@gcc.gnu.org>
222
223         PR fortran/40881
224         * match.c (gfc_match_return): Remove standard notification.
225         * primary.c (gfc_match_actual_arglist): Add standard notification.
226
227 2013-04-04  Tobias Burnus  <burnus@net-b.de>
228
229         PR fortran/50269
230         * gcc/fortran/check.c (is_c_interoperable,
231         gfc_check_c_loc): Correct c_loc array checking
232         for Fortran 2003 and Fortran 2008.
233
234 2013-04-03  Janus Weil  <janus@gcc.gnu.org>
235
236         PR fortran/56284
237         PR fortran/40881
238         * decl.c (gfc_match_formal_arglist): Warn about alternate-return
239         arguments.
240         * interface.c (check_dummy_characteristics): Return if symbols are NULL.
241
242 2013-04-01  Janus Weil  <janus@gcc.gnu.org>
243
244         PR fortran/56500
245         * symbol.c (gfc_set_default_type): Build class container for
246         IMPLICIT CLASS.
247
248 2013-03-31  Tobias Burnus  <burnus@net-b.de>
249
250         * class.c (finalization_scalarizer, finalizer_insert_packed_call,
251         generate_finalization_wrapper): Avoid segfault with absent SIZE=
252         argment to TRANSFER and use correct result kind for SIZE.
253         * intrinsic.c (gfc_isym_id_by_intmod): Also handle ids of
254         nonmodules.
255         * trans.c (gfc_build_final_call): Handle coarrays.
256
257 2013-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
258
259         * trans-expr.c (build_memcmp_call):  New function.
260         (gfc_build_compare_string):  If the strings
261         compared have constant and equal lengths and
262         the strings are kind=1, or, for kind=4 strings,
263         the test is for (in)equality, use memcmp().
264
265 2013-03-29  Tobias Burnus  <burnus@net-b.de>
266
267         PR fortran/35203
268         * trans-decl.c (create_function_arglist): Pass hidden argument
269         for passed-by-value optional+value dummies.
270         * trans-expr.c (gfc_conv_expr_present,
271         gfc_conv_procedure_call): Handle those.
272
273 2013-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
274
275         PR fortran/45159
276         * gfortran.h (gfc_dep_difference):  Add prototype.
277         * dependency.c (discard_nops):  New function.
278         (gfc_dep_difference):  New function.
279         (check_section_vs_section):  Use gfc_dep_difference
280         to calculate the difference of starting indices.
281         * trans-expr.c (gfc_conv_substring):  Use
282         gfc_dep_difference to calculate the length of
283         substrings where possible.
284
285 2013-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
286
287         PR fortran/55806
288         * frontend-passes.c (optimize_code):  Keep track of
289         current code to make code insertion possible.
290         (combine_array_constructor):  New function.
291         (optimize_op):  Call it.
292
293 2013-03-27  Tobias Burnus  <burnus@net-b.de>
294
295         PR fortran/56650
296         PR fortran/36437
297         * check.c (gfc_check_sizeof, gfc_check_c_sizeof,
298         gfc_check_storage_size): Update checks.
299         * intrinsic.texi (SIZEOF): Correct class.
300         * intrinsic.h (gfc_simplify_sizeof,
301         gfc_simplify_storage_size): New prototypes.
302         * intrinsic.c (add_functions): Use them.
303         * simplify.c (gfc_simplify_sizeof,
304         gfc_simplify_storage_size): New functions.
305
306 2013-03-27  Janne Blomqvist  <jb@gcc.gnu.org>
307
308         PR fortran/25708
309         * module.c (module_locus): Use long for position.
310         (module_content): New variable.
311         (module_pos): Likewise.
312         (prev_character): Remove.
313         (bad_module): Free data instead of closing mod file.
314         (set_module_locus): Use module_pos.
315         (get_module_locus): Likewise.
316         (module_char): use buffer rather than stdio file.
317         (module_unget_char): Likewise.
318         (read_module_to_tmpbuf): New function.
319         (gfc_use_module): Call read_module_to_tmpbuf.
320
321 2013-03-26  Tobias Burnus  <burnus@net-b.de>
322
323         PR fortran/56649
324         * simplify.c (gfc_simplify_merge): Simplify more.
325
326 2013-03-25  Tobias Burnus  <burnus@net-b.de>
327
328         PR fortran/38536
329         PR fortran/38813
330         PR fortran/38894
331         PR fortran/39288
332         PR fortran/40963
333         PR fortran/45824
334         PR fortran/47023
335         PR fortran/47034
336         PR fortran/49023
337         PR fortran/50269
338         PR fortran/50612
339         PR fortran/52426
340         PR fortran/54263
341         PR fortran/55343
342         PR fortran/55444
343         PR fortran/55574
344         PR fortran/56079
345         PR fortran/56378
346         * check.c (gfc_var_strlen): Properly handle 0-sized string.
347         (gfc_check_c_sizeof): Use is_c_interoperable, add checks.
348         (is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
349         gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
350         functions.
351         * expr.c (check_inquiry): Add c_sizeof, compiler_version and
352         compiler_options.
353         (gfc_check_pointer_assign): Refine function result check.
354         gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
355         GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
356         GFC_ISYM_C_LOC.
357         (iso_fortran_env_symbol, iso_c_binding_symbol): Handle
358         NAMED_SUBROUTINE.
359         (generate_isocbinding_symbol): Update prototype.
360         (get_iso_c_sym): Remove.
361         (gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
362         * intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
363         (gfc_intrinsic_sub_interface): Use it.
364         (add_functions, add_subroutines): Add missing C-binding intrinsics.
365         (gfc_intrinsic_func_interface): Add special case for c_loc.
366         gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
367         (gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
368         * intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
369         gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
370         gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
371         * iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
372         functions.
373         * iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
374         NAMED_FUNCTION.
375         * iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
376         * module.c (create_intrinsic_function): Support subroutines and
377         derived-type results.
378         (use_iso_fortran_env_module): Update calls.
379         (import_iso_c_binding_module): Ditto; update calls to
380         generate_isocbinding_symbol.
381         * resolve.c (find_arglists): Skip for intrinsic symbols.
382         (gfc_resolve_intrinsic): Find intrinsic subs via id.
383         (is_scalar_expr_ptr, gfc_iso_c_func_interface,
384         set_name_and_label, gfc_iso_c_sub_interface): Remove.
385         (resolve_function, resolve_specific_s0): Remove calls to those.
386         (resolve_structure_cons): Fix handling.
387         * symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
388         generation.
389         (gen_cptr_param, gen_fptr_param, gen_shape_param,
390         build_formal_args, get_iso_c_sym): Remove.
391         (std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
392         (generate_isocbinding_symbol): Support hidden symbols and
393         using c_ptr/c_funptr symtrees for nullptr defs.
394         * target-memory.c (gfc_target_encode_expr): Fix handling
395         of c_ptr/c_funptr.
396         * trans-expr.c (conv_isocbinding_procedure): Remove.
397         (gfc_conv_procedure_call): Remove call to it.
398         (gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
399         of c_ptr/c_funptr.
400         * trans-intrinsic.c (conv_isocbinding_function,
401         conv_isocbinding_subroutine): New.
402         (gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
403         Call them.
404         * trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
405         * trans-types.c (gfc_typenode_for_spec,
406         gfc_get_derived_type): Ditto.
407         (gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
408
409 2013-03-18  Tobias Burnus  <burnus@net-b.de>
410
411         * gfortran.h (gfc_option_t): Remove flag_whole_file.
412         * invoke.texi (-fno-whole-file): Remove.
413         * lang.opt (fwhole-file): Change to Ignore.
414         * options.c (gfc_init_options, gfc_post_options,
415         gfc_handle_option): Remove !flag_whole_file handling
416         * parse.c (resolve_all_program_units, translate_all_program_units,
417         gfc_parse_file): Ditto.
418         * resolve.c (resolve_global_procedure): Ditto.
419         * trans-decl.c (gfc_get_symbol_decl, gfc_get_extern_function_decl,
420         gfc_create_module_variable): Ditto.
421         * trans-types.c (gfc_get_derived_type): Ditto.
422
423 2013-03-15  Tobias Burnus  <burnus@net-b.de>
424
425         PR fortran/56615
426         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Pack arrays
427         if they are not simply contiguous.
428
429 2013-03-11  Tobias Burnus  <burnus@net-b.de>
430
431         * gfortran.texi (STRUCTURE and RECORD): State more clearly how
432         to convert them into derived types.
433
434 2013-03-10  Paul Thomas  <pault@gcc.gnu.org>
435
436         PR fortran/56575
437         * expr.c (gfc_default_initializer): Check that a class declared
438         type has any components.
439         * resolve.c (resolve_fl_derived0): On failing the test for C437
440         set the type to BT_UNKNOWN to prevent repeat error messages.
441
442 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
443
444         PR fortran/56477
445         * expr.c (gfc_check_pointer_assign): Avoid NULL pointer dereference.
446
447 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
448
449         PR fortran/54730
450         * array.c (gfc_match_array_constructor): Set a checkpoint before
451         matching a typespec.  Drop it on success, restore it otherwise.
452
453 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
454
455         PR fortran/54730
456         * gfortran.h (struct gfc_undo_change_set): New field 'previous'.
457         (gfc_new_undo_checkpoint, gfc_drop_last_undo_checkpoint,
458         gfc_restore_last_undo_checkpoint): New prototypes.
459         * symbol.c (default_undo_chgset_var): Update initialization.
460         (single_undo_checkpoint_p, gfc_new_undo_checkpoint,
461         free_undo_change_set_data, pop_undo_change_set,
462         gfc_drop_last_undo_checkpoint, enforce_single_undo_checkpoint):
463         New functions.
464         (save_symbol_data): Handle multiple change sets.  Make sure old_symbol
465         field's previous value is not overwritten.  Clear gfc_new field.
466         (restore_old_symbol): Restore previous old_symbol field.
467         (gfc_restore_last_undo_checkpoint): New function, using body renamed
468         from gfc_undo_symbols.  Restore the previous change set as current one.
469         (gfc_undo_symbols): New body.
470         (gfc_commit_symbols, gfc_commit_symbol, gfc_enforce_clean_symbol_state):
471         Call enforce_single_undo_checkpoint.
472         (gfc_symbol_done_2): Ditto.  Free change set data.
473
474 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
475
476         * symbol.c (restore_old_symbol): Fix thinko.
477
478 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
479
480         * symbol.c (gfc_undo_symbols): Move code...
481         (restore_old_symbol): ... here as a new function.
482
483 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
484
485         * Make-lang.in (F95_PARSER_OBJS): Add dependency to vec.h.
486         * gfortran.h: Include vec.h.
487         (gfc_undo_change_set): New struct.
488         * symbol.c (tentative_tbp): Remove struct.
489         (changed_syms, tentative_tbp_list): Remove variables.
490         (default_undo_chgset_var, latest_undo_chgset): New variables.
491         (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols,
492         gfc_commit_symbols, gfc_commit_symbol,
493         gfc_enforce_clean_symbol_state, gfc_get_typebound_proc):
494         Use latest_undo_chgset instead of changed_syms and tentative_tbp_list.
495
496 2013-03-01  Tobias Burnus  <burnus@net-b.de>
497
498         PR fortran/56491
499         * iresolve.c (resolve_bound): Use gfc_get_string instead of xstrdup.
500         * symbol.c (free_components): Free proc-pointer components.
501
502 2013-03-01  Tobias Burnus  <burnus@net-b.de>
503
504         * trans-decl.c (gfc_trans_deferred_vars): Free expr after use.
505         * trans-io.c (build_dt): Ditto.
506
507 2013-02-24  Joseph Myers  <joseph@codesourcery.com>
508
509         * resolve.c (generate_component_assignments): Don't use UTF-8
510         ligature in diagnostic.
511
512 2013-02-21  Janus Weil  <janus@gcc.gnu.org>
513
514         PR fortran/56385
515         * trans-array.c (structure_alloc_comps): Handle procedure-pointer
516         components with allocatable result.
517
518 2013-02-21  Tobias Burnus  <burnus@net-b.de>
519
520         PR fortran/56416
521         * gfortran.texi (Part II: Language Reference, Extensions,
522         Non-Fortran Main Program): Sort @menu to match actual section order.
523         * intrinsic.texi (Intrinsic Procedures): Ditto.
524         (C_F_POINTER, PRECISION): Move to the alphabetically correct place.
525
526 2013-02-15  Tobias Burnus  <burnus@net-b.de>
527             Mikael Morin  <mikael@gcc.gnu.org>
528
529         PR fortran/56318
530         * simplify.c (gfc_simplify_matmul): Fix result shape
531         and matmul result.
532
533 2013-02-15  Tobias Burnus  <burnus@net-b.de>
534
535         PR fortran/53818
536         * resolve.c (apply_default_init_local): Don't create an
537         initializer for a result variable.
538
539 2013-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
540
541         PR fortran/56224
542         * gfortran.h (gfc_add_include_path):  Add boolean argument
543         for warn.
544         * scanner.c (gfc_add_include_path):  Pass along warn argument
545         to add_path_to_list.
546         * options.c (gfc_post_options):  Add true warn argument to
547         gfc_add_include_path.
548         (gfc_handle_module_path_options):  Likewise.
549         (gfc_handle_option): Also gfc_add_include_path for intrinsic
550         modules, without warning.
551
552 2013-02-14  Paul Thomas  <pault@gcc.gnu.org>
553             Tobias Burnus  <burnus@net-b.de>
554
555         PR testsuite/56138
556         * trans-decl.c (gfc_get_symbol_decl): Fix deferred-length
557         results for functions without extra result variable.
558
559         Revert:
560         2013-01-30  Tobias Burnus  <burnus@net-b.de>
561
562         PR fortran/56138
563         * trans-decl.c (gfc_trans_deferred_vars): Fix deferred-length
564         results for functions without extra result variable.
565
566 2013-02-12  Janus Weil  <janus@gcc.gnu.org>
567
568         PR fortran/46952
569         * resolve.c (resolve_call): Do not check deferred procedures for
570         recursiveness.
571
572 2013-02-09  Paul Thomas  <pault@gcc.gnu.org>
573
574         PR fortran/55362
575         * check.c (array_check): It is an error if a procedure is
576         passed.
577
578 2013-02-08  Mikael Morin  <mikael@gcc.gnu.org>
579
580         PR fortran/54107
581         * trans-types.c (gfc_get_function_type): Change a NULL backend_decl
582         to error_mark_node on entry.  Detect recursive types.  Build a variadic
583         procedure type if the type is recursive.  Restore the initial
584         backend_decl.
585
586 2013-02-07  Tobias Burnus  <burnus@net-b.de>
587
588         PR fortran/54339
589         * gfortran.texi (Standards): Mention TS29113.
590         (Varying Length Character): Mention deferred-length
591         strings.
592         (Fortran 2003 Status): Add unlimited polymorphic.
593         (TS 29113 Status): Add TYPE(*) and DIMENSION(..).
594         (C Interop): Update the section about TS29113.
595
596 2013-02-06 Paul Thomas  <pault@gcc.gnu.org>
597
598         PR fortran/55789
599         * trans-array.c (trans_array_constructor): Remove condition
600         'dynamic' = true if the loop ubound is a VAR_DECL.
601
602 2013-02-04  Paul Thomas  <pault@gcc.gnu.org>
603
604         PR fortran/56008
605         PR fortran/47517
606         * trans-array.c (gfc_alloc_allocatable_for_assignment): Save
607         the lhs descriptor before it is modified for reallocation. Use
608         it to deallocate allocatable components in the reallocation
609         block.  Nullify allocatable components for newly (re)allocated
610         arrays.
611
612 2013-02-04  Mikael Morin  <mikael@gcc.gnu.org>
613
614         PR fortran/54195
615         * resolve.c (resolve_typebound_procedures): Recurse through
616         resolve_symbol.
617
618 2013-02-04  Mikael Morin  <mikael@gcc.gnu.org>
619
620         PR fortran/54107
621         PR fortran/54195
622         * gfortran.h (struct gfc_symbol): New field 'resolved'.
623         * resolve.c (resolve_fl_var_and_proc): Don't skip result symbols.
624         (resolve_symbol): Skip duplicate calls.  Don't check the current
625         namespace.
626
627 2013-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
628
629         PR fortran/50627
630         PR fortran/56054
631         * decl.c (gfc_match_end):  Remove half-ready namespace
632         from parent if the end of a block is missing.
633         * parse.c (parse_module):  Do not put namespace into
634         gsymbol on error.
635
636 2013-01-30  Tobias Burnus  <burnus@net-b.de>
637
638         PR fortran/56138
639         * trans-decl.c (gfc_trans_deferred_vars): Fix deferred-length
640         results for functions without extra result variable.
641
642 2013-01-29  Janus Weil  <janus@gcc.gnu.org>
643             Mikael Morin  <mikael@gcc.gnu.org>
644
645         PR fortran/54107
646         * gfortran.h (gfc_component): Delete members 'formal' and 'formal_ns'.
647         (gfc_copy_formal_args,gfc_copy_formal_args_ppc,gfc_expr_replace_symbols,
648         gfc_expr_replace_comp): Delete.
649         (gfc_sym_get_dummy_args): New prototype.
650         * dependency.c (gfc_check_fncall_dependency): Use
651         'gfc_sym_get_dummy_args'.
652         * expr.c (gfc_is_constant_expr): Ditto.
653         (replace_symbol,gfc_expr_replace_symbols,replace_comp,
654         gfc_expr_replace_comp): Deleted.
655         * frontend-passes.c (doloop_code,do_function): Use
656         'gfc_sym_get_dummy_args'.
657         * interface.c (gfc_check_operator_interface,gfc_compare_interfaces,
658         gfc_procedure_use,gfc_ppc_use,gfc_arglist_matches_symbol,
659         gfc_check_typebound_override): Ditto.
660         * module.c (MOD_VERSION): Bump module version.
661         (mio_component): Do not read/write 'formal' and 'formal_ns'.
662         * resolve.c (resolve_procedure_interface,resolve_fl_derived0): Do not
663         copy formal args, but just keep a pointer to the interface.
664         (resolve_function,resolve_call,resolve_typebound_generic_call,
665         resolve_ppc_call,resolve_expr_ppc,generate_component_assignments,
666         resolve_fl_procedure,gfc_resolve_finalizers,check_generic_tbp_ambiguity,
667         resolve_typebound_procedure,check_uop_procedure): Use
668         'gfc_sym_get_dummy_args'.
669         * symbol.c (free_components): Do not free 'formal' and 'formal_ns'.
670         (gfc_copy_formal_args,gfc_copy_formal_args_ppc): Deleted.
671         (gfc_sym_get_dummy_args): New function.
672         * trans-array.c (get_array_charlen,gfc_walk_elemental_function_args):
673         Use 'gfc_sym_get_dummy_args'.
674         * trans-decl.c (build_function_decl,create_function_arglist,
675         build_entry_thunks,init_intent_out_dt,gfc_trans_deferred_vars,
676         add_argument_checking): Ditto.
677         * trans-expr.c (gfc_map_fcn_formal_to_actual,gfc_conv_procedure_call,
678         gfc_conv_statement_function): Ditto.
679         * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
680         * trans-types.c (create_fn_spec,gfc_get_function_type): Ditto.
681
682 2013-01-28  Tobias Burnus  <burnus@net-b.de>
683             Mikael Morin  <mikael@gcc.gnu.org>
684
685         PR fortran/53537
686         * symbol.c (gfc_find_sym_tree): Don't look for the symbol outside an
687         interface block.
688         (gfc_get_ha_symtree): Let gfc_find_sym_tree lookup the parent namespace.
689         * decl.c (gfc_match_data_decl): Ditto.
690         (variable_decl): Remove undeclared type error.
691         (gfc_match_import): Use renamed instead of original name.
692
693 2013-01-27 Paul Thomas  <pault@gcc.gnu.org>
694
695         PR fortran/55984
696         PR fortran/56047
697         * gfortran.h : Add associate_var to symbol_attr.
698         * resolve.c (resolve_assoc_var): Set associate_var attribute.
699         If the target class_ok is set, set it for the associate
700         variable.
701         * check.c (allocatable_check): Associate variables should not
702         have the allocatable attribute even if their symbols do.
703         * class.c (gfc_build_class_symbol): Symbols with associate_var
704         set will always have a good class container.
705
706 2013-01-23  Janus Weil  <janus@gcc.gnu.org>
707
708         PR fortran/56081
709         * resolve.c (resolve_select): Add argument 'select_type', reject
710         non-scalar expressions.
711         (resolve_select_type,resolve_code): Pass new argument to
712         'resolve_select'.
713
714 2013-01-23  Jakub Jelinek  <jakub@redhat.com>
715
716         PR fortran/56052
717         * trans-decl.c (gfc_get_symbol_decl): Set DECL_ARTIFICIAL
718         and DECL_IGNORED_P on select_type_temporary and don't set
719         DECL_BY_REFERENCE.
720
721 2013-01-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
722
723         PR fortran/55919
724         * scanner.c (add_path_to_list): Copy path to temporary and strip
725         trailing directory separators before calling stat().
726
727 2013-01-17  Richard Biener  <rguenther@suse.de>
728
729         * trans-stmt.c (gfc_trans_do): Conditionally compute countm1
730         dependent on sign of step, avoids repeated evaluation of
731         step sign test.  Avoid undefined overflow issues by using unsigned
732         arithmetic.
733
734 2013-01-16  Janus Weil  <janus@gcc.gnu.org>
735
736         PR fortran/55983
737         * class.c (find_typebound_proc_uop): Check for f2k_derived instead of
738         asserting it.
739
740 2013-01-16  Jakub Jelinek  <jakub@redhat.com>
741             Tobias Burnus  <burnus@net-b.de>
742
743         PR driver/55884
744         * lang.opt (fintrinsic-modules-path): Don't accept Joined.
745         (fintrinsic-modules-path=): New.
746         * options.c (gfc_handle_option, gfc_get_option_string,
747         gfc_get_option_string): Handle the latter.
748
749 2013-01-16  Jakub Jelinek  <jakub@redhat.com>
750
751         PR fortran/52865
752         * trans-stmt.c (gfc_trans_do): Put countm1-- before conditional
753         and use value of countm1 before the decrement in the condition.
754
755 2013-01-15  Paul Thomas  <pault@gcc.gnu.org>
756
757         PR fortran/54286
758         * expr.c (gfc_check_pointer_assign): Check for presence of
759         's2' before using it.
760
761 2013-01-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
762
763         PR fortran/55806
764         * frontend-passes.c (optimize_reduction):  New function,
765         including prototype.
766         (callback_reduction):  Likewise.
767         (gfc_run_passes):  Also run optimize_reduction.
768         (copy_walk_reduction_arg):  New function.
769         (dummy_code_callback):  New function.
770
771 2013-01-13  Jakub Jelinek  <jakub@redhat.com>
772
773         PR fortran/55935
774         * trans-expr.c (gfc_conv_structure): Call
775         unshare_expr_without_location on the ctor elements.
776
777 2013-01-13  Paul Thomas  <pault@gcc.gnu.org>
778
779         PR fortran/54286
780         * expr.c (gfc_check_pointer_assign): Ensure that both lvalue
781         and rvalue interfaces are presented to gfc_compare_interfaces.
782         Simplify references to interface names by using the symbols
783         themselves. Call gfc_compare_interfaces with s1 and s2 inter-
784         changed to overcome the asymmetry of this function. Do not
785         repeat the check for the presence of s1 and s2.
786
787 2013-01-12  Janus Weil  <janus@gcc.gnu.org>
788
789         PR fortran/55072
790         * trans-array.c (gfc_conv_array_parameter): No packing was done for
791         full arrays of derived type.
792
793 2013-01-08  Paul Thomas  <pault@gcc.gnu.org>
794
795         PR fortran/55868
796         * class.c (get_unique_type_string): Change $tar to STAR and
797         replace sprintf by strcpy where there is no formatting.
798         * decl.c (gfc_match_decl_type_spec): Change $tar to STAR.
799
800 2013-01-09  Mikael Morin  <mikael@gcc.gnu.org>
801
802         PR fortran/47203
803         * module.c (check_for_ambiguous): Get the current program unit using
804         gfc_current_ns.
805
806 2013-01-09  Tobias Burnus  <burnus@net-b.de>
807
808         PR fortran/55758
809         * resolve.c (resolve_symbol): Reject non-C_Bool logicals
810         in BIND(C) procedures with -std=f*.
811
812 2013-01-08  Paul Thomas  <pault@gcc.gnu.org>
813
814         PR fortran/55618
815         * trans-expr.c (gfc_conv_procedure_call): Dereference scalar
816         character function arguments to elemental procedures in
817         scalarization loops.
818
819 2013-01-07  Tobias Burnus  <burnus@net-b.de>
820
821         PR fortran/55763
822         * gfortran.h (gfc_check_assign_symbol): Update prototype.
823         * decl.c (add_init_expr_to_sym, do_parm): Update call.
824         * expr.c (gfc_check_assign_symbol): Handle BT_CLASS and
825         improve error location; support components.
826         (gfc_check_pointer_assign): Handle component assignments.
827         * resolve.c (resolve_fl_derived0): Call gfc_check_assign_symbol.
828         (resolve_values): Update call.
829         (resolve_structure_cons): Avoid double diagnostic.
830
831 2013-01-07  Tobias Burnus  <burnus@net-b.de>
832             Thomas Koenig  <tkoenig@gcc.gnu.org>
833
834         PR fortran/55852
835         * expr.c (gfc_build_intrinsic_call): Avoid clashes
836         with user's procedures.
837         * gfortran.h (gfc_build_intrinsic_call): Update prototype.
838         * simplify.c (gfc_simplify_size): Update call.
839         * class.c (finalization_scalarizer, finalization_get_offset,
840         finalizer_insert_packed_call, generate_finalization_wrapper):
841         Clean up by using gfc_build_intrinsic_call.
842
843 2013-01-07  Tobias Burnus  <burnus@net-b.de>
844
845         PR fortran/55763
846         * resolve.c (resolve_select_type): Reject intrinsic types for
847         a non-unlimited-polymorphic selector.
848
849 2013-01-06  Paul Thomas  <pault@gcc.gnu.org>
850
851         PR fortran/53876
852         PR fortran/54990
853         PR fortran/54992
854         * trans-array.c (build_array_ref): Check the TYPE_CANONICAL
855         to see if it is GFC_CLASS_TYPE_P.
856         * trans-expr.c (gfc_get_vptr_from_expr): The same.
857         (gfc_conv_class_to_class): If the types are not the same,
858         cast parmese->expr to the type of ctree.
859         * trans-types.c (gfc_get_derived_type): GFC_CLASS_TYPE_P of
860         CLASS components must be set.
861
862 2013-01-06  Mikael Morin  <mikael@gcc.gnu.org>
863
864         PR fortran/42769
865         PR fortran/45836
866         PR fortran/45900
867         * module.c (read_module): Don't reuse local symtree if the associated
868         symbol isn't exactly the one wanted.  Don't reuse local symtree if it is
869         ambiguous.
870         * resolve.c (resolve_call): Use symtree's name instead of symbol's to
871         lookup the symtree.
872
873 2013-01-05  Steven G. Kargl  <kargl@gcc.gnu.org>
874             Mikael Morin  <mikael@gcc.gnu.org>
875
876         PR fortran/55827
877         * class.c (gfc_fix_class_refs): Adapt ts initialization for the case
878         e->symtree == NULL.
879         * trans-expr.c (gfc_conv_function_expr): Init sym earlier. Use it.
880
881 2013-01-05  Tobias Burnus  <burnus@net-b.de>
882
883         * class.c (finalize_component): Used passed offset expr.
884         (finalization_get_offset): New static function.
885         (finalizer_insert_packed_call, generate_finalization_wrapper): Use it
886         to handle noncontiguous arrays.
887
888 2013-01-04  Tobias Burnus  <burnus@net-b.de>
889
890         * trans.c (gfc_build_final_call): New function.
891         * trans.h (gfc_build_final_call, gfc_conv_scalar_to_descriptor):
892         New function prototypes.
893         * trans-expr.c (gfc_conv_scalar_to_descriptor): Renamed from
894         conv_scalar_to_descriptor, removed static attribute.
895         (gfc_conv_procedure_call): Honor renaming.
896
897 2013-01-04  Tobias Burnus  <burnus@net-b.de>
898
899         * intrinsic.c (add_functions): New internal intrinsic
900         function GFC_PREFIX ("stride").
901         * gfortran.h (gfc_isym_id): Add GFC_ISYM_STRIDE.
902         * intrinsic.h (gfc_resolve_stride): New prototypes.
903         * iresolve.c (gfc_resolve_stride): New function.
904         * trans-intrinsic.c (conv_intrinsic_stride): New static
905         function.
906         (gfc_conv_intrinsic_function): Use it.
907
908 2013-01-04  Tobias Burnus  <burnus@net-b.de>
909
910         * class.c (gfc_find_intrinsic_vtab): Add _final
911         component.
912         * decl.c (gfc_match_null): Remove superfluous
913         variadic argument to gfc_match.
914
915 2013-01-04  Paul Thomas  <pault@gcc.gnu.org>
916
917         PR fortran/55172
918         * match.c (copy_ts_from_selector_to_associate): Remove call to
919         gfc_resolve_expr and replace it with explicit setting of the
920         array reference type.
921         * resolve.c (resolve_select_type): It is an error if the
922         selector is coindexed.
923
924 2013-01-04  Tobias Burnus  <burnus@net-b.de>
925
926         PR fortran/55763
927         * decl.c (gfc_match_null): Parse and reject MOLD.
928
929 2013-01-04  Tobias Burnus  <burnus@net-b.de>
930
931         PR fortran/55854
932         PR fortran/55763
933         * class.c (gfc_class_null_initializer): Fix finding the vtab.
934         (gfc_find_intrinsic_vtab): Use BT_VOID for some components.
935
936 2013-01-03  Janus Weil  <janus@gcc.gnu.org>
937
938         PR fortran/55855
939         * expr.c (gfc_check_assign): Use 'gfc_expr_attr' to evaluate attributes
940         of rvalue. Correct hyphenation in error message.
941
942 2013-01-03  Jakub Jelinek  <jakub@redhat.com>
943
944         * gfortranspec.c (lang_specific_driver): Update copyright notice
945         dates.
946 \f
947 Copyright (C) 2013 Free Software Foundation, Inc.
948
949 Copying and distribution of this file, with or without modification,
950 are permitted in any medium without royalty provided the copyright
951 notice and this notice are preserved.