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