2013-08-06 Janus Weil <janus@gcc.gnu.org>
[official-gcc.git] / gcc / fortran / ChangeLog
blob7a9fe6ef8bd3cc7cf16bd401dc4e4a21f3e7b437
1 2013-08-06  Janus Weil  <janus@gcc.gnu.org>
3         PR fortran/57306
4         * class.c (gfc_class_null_initializer): Rename to
5         'gfc_class_initializer'. Treat non-NULL init-exprs.
6         * gfortran.h (gfc_class_null_initializer): Update prototype.
7         * trans-decl.c (gfc_get_symbol_decl): Treat class variables.
8         * trans-expr.c (gfc_conv_initializer): Ditto.
9         (gfc_trans_subcomponent_assign): Renamed gfc_class_null_initializer.
11 2013-07-30  Tobias Burnus  <burnus@net-b.de>
13         PR fortran/57530
14         * symbol.c (gfc_type_compatible): A type is type compatible with
15         a class if both have the same declared type.
16         * interface.c (compare_type): Reject CLASS/TYPE even if they
17         are type compatible.
19 2013-07-30  Tobias Burnus  <burnus@net-b.de>
21         PR fortran/57530
22         * trans-expr.c (gfc_trans_class_assign): Handle CLASS array
23         functions.
24         (gfc_trans_pointer_assign): Ditto and support pointer assignment of
25         a polymorphic var to a nonpolymorphic var.
27 2013-07-22  Po Chang  <pchang9@cs.wisc.edu>
29         * match.c (gfc_match_call): Exit loop after setting i.
31         * resolve.c (resolve_variable): Exit loop after setting seen.
33         * expr.c (gfc_check_pointer_assign): Exit loop after setting warn.
35         * trans-array.c (set_loop_bounds): Exit loop after setting
36         nonoptional_arr.
38         * trans-io.c (gfc_trans_transfer): Exit loop after setting seen_vector.
40 2013-07-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
42         PR fortran/58009
43         * expr.c (gfc_check_vardef_context):  Check for same values in
44         vector expression subscripts.
46 2013-07-27  Tobias Burnus  <burnus@net-b.de>
48         PR fortran/57991
49         * interface.c (check_some_aliasing): Also warn for intent OUT/OUT.
51 2013-07-27  Janus Weil  <janus@gcc.gnu.org>
53         PR fortran/57285
54         * check.c (dim_rank_check): Re-enable this check for CLASS arrays.
56 2013-07-25  Janus Weil  <janus@gcc.gnu.org>
58         PR fortran/57966
59         * resolve.c (resolve_typebound_function): Make sure the declared type,
60         including its type-bound procedures, is resolved before resolving the
61         actual type-bound call.
63 2013-07-25  Janus Weil  <janus@gcc.gnu.org>
65         PR fortran/57639
66         * interface.c (compare_parameter): Check for class_ok.
67         * simplify.c (gfc_simplify_same_type_as): Ditto.
69 2013-07-23   Ondřej Bílka  <neleai@seznam.cz>
71         * decl.c: Fix comment typos.
72         * interface.c: Likewise.
73         * trans-array.c: Likewise.
74         * trans.c: Likewise.
76 2013-07-22  Tobias Burnus  <burnus@net-b.de>
78         PR fortran/57906
79         PR fortran/52052
80         * class.c (gfc_build_class_symbol): Set coarray_comp.
81         * trans-array.c (structure_alloc_comps): For coarrays,
82         directly use the data pointer address.
84 2013-07-22  Chang  <pchang9@cs.wisc.edu>
86         * trans-decl.c (gfc_build_dummy_array_decl): Exit loop after
87         setting PACKED_PARTIAL.
89 2013-07-22  Tobias Burnus  <burnus@net-b.de>
91         * trans-array.c (gfc_array_allocate): Correct memory-leak patch.
93 2013-07-22  Tobias Burnus  <burnus@net-b.de>
95         * trans-array.c (gfc_array_allocate,
96         gfc_trans_deferred_array): Plug memory leak.
98 2013-07-21  Ondřej Bílka  <neleai@seznam.cz>
100         * trans-decl.c: Fix comment typos.
101         * trans-expr.c: Ditto.
103 2013-07-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
105         PR fortran/56937
106         * dependency.c (gfc_dep_resolver):  Treat identical
107         array subscripts as identical; don't unconditionally
108         return a dependency if an array subscript is found.
110 2013-07-21  Tobias Burnus  <burnus@net-b.de>
112         PR fortran/35862
113         * libgfortran.h (GFC_FPE_DOWNWARD, GFC_FPE_TONEAREST,
114         GFC_FPE_TOWARDZERO, GFC_FPE_UPWARD): New defines.
116 2013-07-21  Tobias Burnus  <burnus@net-b.de>
118         PR fortran/57894
119         * check.c (min_max_args): Add keyword= check.
121 2013-07-17  Mikael Morin  <mikael@gcc.gnu.org>
122             Tobias Burnus  <burnus@net-b.de>
124         PR fortran/57895
125         * match.c (gfc_match_name): Ensure that the error
126         message regarding -fdollar-ok gets printed.
127         (gfc_match_common): Avoid multiple freeing.
129 2013-07-16  Tobias Burnus  <burnus@net-b.de>
131         PR fortran/57912
132         * trans-expr.c (gfc_trans_scalar_assign): Correct if
133         condition for caf realloc.
135 2013-07-15  Tobias Burnus  <burnus@net-b.de>
137         * trans-array.h (gfc_deallocate_alloc_comp_no_caf,
138         gfc_reassign_alloc_comp_caf): New prototype.
139         * trans-array.c (enum): Add DEALLOCATE_ALLOC_COMP_NO_CAF
140         and COPY_ALLOC_COMP_CAF.
141         (structure_alloc_comps): Handle it.
142         (gfc_reassign_alloc_comp_caf,
143         gfc_deallocate_alloc_comp_no_caf): New function.
144         (gfc_alloc_allocatable_for_assignment): Call it.
145         * trans-expr.c (gfc_trans_scalar_assign,
146         gfc_trans_arrayfunc_assign, gfc_trans_assignment_1): Ditto.
147         * parse.c (parse_derived): Correctly set coarray_comp.
148         * resolve.c (resolve_symbol): Improve error wording.
150 2013-07-15  Tobias Burnus  <burnus@net-b.de>
152         PR fortran/37336
153         * trans.c (gfc_add_comp_finalizer_call): New function.
154         * trans.h (gfc_add_comp_finalizer_call): New prototype.
155         * trans-array.c (structure_alloc_comps): Call it.
157 2013-07-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
158             Tobias Burnus  <burnus@gcc.gnu.org>
160         PR fortran/52669
161         * trans-decl.c (gfc_finish_var_decl):  Move setting of
162         PRIVATE for a module variable if the module has a private
163         default or -fmodule-private is given to...
164         (gfc_create_module_variable): here. Optionally
165         warn about private module variable which is not used.
167 2013-07-08  Tobias Burnus  <burnus@net-b.de>
169         PR fortran/57834
170         * check.c (is_c_interoperable): Add special case for c_f_pointer.
171         (explicit-size, gfc_check_c_f_pointer, gfc_check_c_loc): Update
172         call.
174 2013-07-08  Tobias Burnus  <burnus@net-b.de>
176         PR fortran/50554
177         * io.c (match_inquire_element): Add missing do-var check.
179 2013-07-08  Tobias Burnus  <burnus@net-b.de>
181         PR fortran/57785
182         * simplify.c (compute_dot_product): Complex conjugate for
183         dot_product.
184         (gfc_simplify_dot_product, gfc_simplify_matmul): Update call.
186 2013-07-08  Tobias Burnus  <burnus@net-b.de>
188         PR fortran/57469
189         * trans-decl.c (generate_local_decl): Don't warn that
190         a dummy is unused, when it is in a namelist.
192 2013-07-01  Dominique d'Humieres  <dominiq@lps.ens.fr>
194         PR fortran/54788
195         * array.c (spec_size): handle the case as==NULL.
197 2013-06-26  Tobias Burnus  <burnus@net-b.de>
199         PR fortran/29800
200         * trans-array.c (gfc_conv_array_ref): Improve out-of-bounds
201         diagnostic message.
202         * trans-array.c (gfc_conv_array_ref): Update prototype.
203         * trans-expr.c (gfc_conv_variable): Update call.
205 2013-06-24  Steven G. Kargl  <sgk@troutmask.apl.washington.edu>
206             Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
207             Dominique d'Humieres  <dominiq@lps.ens.fr>
209         PR fortran/52413
210         * simplify.c (gfc_simplify_fraction): Fix the sign of negative values.
212 2013-06-21  Tobias Burnus  <burnus@net-b.de>
214         PR fortran/37336
215         * trans-array.c (gfc_trans_deferred_array): Call the
216         finalizer for nonallocatable local variables.
217         * trans-decl.c (gfc_get_symbol_decl): Add local
218         finalizable vars to the deferred list.
219         (gfc_trans_deferred_vars): Call gfc_trans_deferred_array
220         for those.
222 2013-06-21  Tobias Burnus  <burnus@net-b.de>
224         * trans-array.c (gfc_alloc_allocatable_for_assignment): Allocate
225         at least one byte.
226         * trans-expr.c (alloc_scalar_allocatable_for_assignment): Ditto.
228 2013-06-20  Tobias Burnus  <burnus@net-b.de>
230         * resolve.c (get_temp_from_expr): Don't set FL_VARIABLE twice.
232 2013-06-17  Tobias Burnus  <burnus@net-b.de>
234         * gfortran.h (gfc_option_t): Add fpe_summary.
235         * gfortran.texi (_gfortran_set_options): Update.
236         * invoke.texi (-ffpe-summary): Add doc.
237         * lang.opt (ffpe-summary): Add flag.
238         * options.c (gfc_init_options, gfc_handle_option): Handle it.
239         (gfc_handle_fpe_option): Renamed from gfc_handle_fpe_trap_option,
240         also handle fpe_summary.
241         * trans-decl.c (create_main_function): Update
242         _gfortran_set_options call.
244 2013-06-15  Mikael Morin  <mikael@gcc.gnu.org>
246         PR fortran/49074
247         PR fortran/56136
248         * dependency.c (gfc_check_argument_var_dependency): Return 0 in the
249         array constructor case.
251 2013-06-14  Tobias Burnus  <burnus@net-b.de>
253         PR fortran/57508
254         * resolve.c (get_temp_from_expr): Don't copy function
255         result attributes to temporary.
257 2013-06-14  Tobias Burnus  <burnus@net-b.de>
259         PR fortran/57596
260         * trans-decl.c (gfc_trans_deferred_vars): Honor OPTIONAL
261         for nullify and deferred-strings' length variable.
263 2013-06-13  Mikael Morin  <mikael@gcc.gnu.org>
265         PR fortran/49074
266         * trans-expr.c (gfc_conv_variable): Don't walk the reference chain.
267         Handle NULL array references.
268         (gfc_conv_procedure_call): Remove code handling NULL array references.
270 2013-06-11  Tobias Burnus  <burnus@net-b.de>
272         PR fortran/57535
273         * trans-array.c (build_class_array_ref): Fix ICE for
274         function result variables.
276 2013-06-08  Tobias Burnus  <burnus@net-b.de>
278         PR fortran/37336
279         * trans-decl.c (init_intent_out_dt): Call finalizer
280         when appropriate.
282 2013-06-08  Tobias Burnus  <burnus@net-b.de>
284         PR fortran/57553
285         * simplify.c (gfc_simplify_storage_size): Handle literal
286         strings.
287         * trans-intrinsic.c (gfc_conv_intrinsic_storage_size):
288         Add missing fold_convert.
290 2013-06-07  Tobias Burnus  <burnus@net-b.de>
292         PR fortran/57549
293         * array.c (gfc_match_array_constructor): Call
294         gfc_match_type_spec instead of gfc_match_decl_type_spec.
295         * match.c (gfc_match_type_spec): Renamed from match_type_spec.
296         (gfc_match_type_is, gfc_match_allocate): Update call.
297         * match.h (gfc_match_type_spec): Add prototype.
299 2013-06-07  Tobias Burnus  <burnus@net-b.de>
301         PR fortran/57556
302         * trans.c (gfc_build_final_call): Init block before use.
304 2013-06-06  Tobias Burnus  <burnus@net-b.de>
306         PR fortran/57542
307         * trans.c (gfc_build_final_call): Add se.pre to the block
308         and modify the assert.
310 2013-06-04  Tobias Burnus  <burnus@net-b.de>
312         PR fortran/37336
313         * trans.h (gfc_build_final_call): Remove prototype.
314         (gfc_add_finalizer_call): Add prototype.
315         * trans-array.c (gfc_trans_dealloc_allocated): Support finalization.
316         (structure_alloc_comps): Update caller.
317         (gfc_trans_deferred_array): Call finalizer.
318         * trans-array.h (gfc_trans_dealloc_allocated): Update prototype.
319         * trans-decl.c (gfc_trans_deferred_vars): Don't deallocate/finalize
320         variables of the main program.
321         * trans-expr.c (gfc_conv_procedure_call): Support finalization.
322         * trans-openmp.c (gfc_omp_clause_dtor,
323         gfc_trans_omp_array_reduction): Update calls.
324         * trans-stmt.c (gfc_trans_deallocate): Avoid double deallocation
325         of alloc components.
326         * trans.c (gfc_add_finalizer_call): New function.
327         (gfc_deallocate_with_status,
328         gfc_deallocate_scalar_with_status): Call it
329         (gfc_build_final_call): Fix handling of scalar coarrays,
330         move up in the file and make static.
332 2013-06-01  Janus Weil  <janus@gcc.gnu.org>
333             Mikael Morin  <mikael@gcc.gnu.org>
335         * error.c (get_terminal_width): Only limit the width if we're
336         outputting to a terminal. Try to determine width via ioctl.
338 2013-06-01  Tobias Burnus  <burnus@net-b.de>
340         * decl.c (add_global_entry): Take locus.
341         (gfc_match_entry): Update call.
342         (gfc_match_end): Better error location.
343         * parse.c (parse_block_data, parse_module, add_global_procedure,
344         add_global_program): Use better locus data.
346 2013-05-31  Tobias Burnus  <burnus@net-b.de>
348         PR fortran/57456
349         * trans-array.c (gfc_array_init_size): Use passed type spec,
350         when available.
351         (gfc_array_allocate): Pass typespec on.
352         * trans-array.h (gfc_array_allocate): Update prototype.
353         * trans-stmt.c (gfc_trans_allocate): Pass typespec on.
355 2013-05-31  Janus Weil  <janus@gcc.gnu.org>
357         PR fortran/54190
358         PR fortran/57217
359         * gfortran.h (gfc_terminal_width): Remove prototype.
360         * error.c (get_terminal_width): Moved here from misc.c. Renamed.
361         Try to determine terminal width from environment variable.
362         * interface.c (compare_type, compare_rank): New functions. Fix assumed
363         type/rank handling.
364         (compare_type_rank, check_dummy_characteristics,
365         check_result_characteristics, gfc_compare_interfaces): Use them.
366         (symbol_rank): Slightly modified and moved.
367         * misc.c (gfc_terminal_width): Moved to error.c.
369 2013-05-30  Janus Weil  <janus@gcc.gnu.org>
371         PR fortran/54189
372         * resolve.c (check_assumed_size_reference): Check for e->ref.
374 2013-05-30  Tobias Burnus  <burnus@net-b.de>
376         PR fortran/57458
377         * interface.c (compare_parameter): Update C1239/C1240 constraint
378         check for assumed-rank/TS29113.
380 2013-05-29  Tobias Burnus  <burnus@net-b.de>
382         PR fortran/37336
383         * class.c (finalize_component): Fix coarray array refs.
384         (generate_finalization_wrapper): Only gfc_convert_type_warn
385         when the kind value is different.
386         (gfc_find_intrinsic_vtab): _copy's dst is now intent(inout).
387         (gfc_find_derived_vtab): Ditto. Enable finalization-wrapper
388         generation.
389         * module.c (MOD_VERSION): Bump.
390         (gfc_dump_module, gfc_use_module): Remove empty line in .mod.
391         * trans-array.c (gfc_conv_descriptor_token): Accept nonrestricted
392         void pointer.
393         (gfc_array_allocate, structure_alloc_comps): Don't nullify for
394         BT_CLASS allocations.
395         * trans-stmt.c (gfc_trans_allocate): Ditto.
397 2013-05-29  Tobias Burnus  <burnus@net-b.de>
399         PR fortran/37336
400         * resolve.c (gfc_resolve_finalizers): Remove not implemented error.
402 2013-05-28  Tobias Burnus  <burnus@net-b.de>
404         * trans-expr.c (gfc_conv_procedure_call): Deallocate
405         polymorphic arrays for allocatable intent(out) dummies.
406         (gfc_reset_vptr): New function, moved from trans-stmt.c
407         and extended.
408         * trans-stmt.c (reset_vptr): Remove.
409         (gfc_trans_deallocate): Update calls.
410         * trans.h (gfc_reset_vptr): New prototype.
412 2013-05-28  Dominique d'Humieres  <dominiq@lps.ens.fr>
414         PR fortran/57435
415         * module.c (check_for_ambiguous): Avoid null pointer deref.
417 2013-05-28  Janus Weil  <janus@gcc.gnu.org>
418             Tobias Burnus  <burnus@net-b.de>
420         PR fortran/57217
421         * interface.c (check_dummy_characteristics): Symmetrize type check.
423 2013-05-27  Bud Davis  <jmdavis@link.com>
425         PR fortran/50405
426         * resolve.c (resolve_formal_arglist): Detect error when an argument
427         has the same name as the function.
429 2013-05-27  Tobias Burnus  <burnus@net-b.de>
431         * expr.c (gfc_build_intrinsic_call): Make symbol as attr.artificial.
432         * intrinsic.c (gfc_is_intrinsic): Disable std check for those.
434 2013-05-22  Tobias Burnus  <burnus@net-b.de>
436         * resolve.c (get_temp_from_expr): Change mangling to
437         start always with a _.
439 2013-05-22  Tobias Burnus  <burnus@net-b.de>
441         * resolve.c (get_temp_from_expr): Fix temp var mangling.
443 2013-05-22  Tobias Burnus  <burnus@net-b.de>
445         PR fortran/57364
446         * resolve.c (get_temp_from_expr): Commit created sym.
448 2013-05-22  Tobias Burnus  <burnus@net-b.de>
450         PR fortran/57338
451         * intrinsic.c (do_check): Move some checks to ...
452         (do_ts29113_check): ... this new function.
453         (check_specific, gfc_intrinsic_sub_interface): Call it.
455 2013-05-22  Janne Blomqvist  <jb@gcc.gnu.org>
457         * intrinsic.texi (RANDOM_SEED): Improve example.
459 2013-05-21  Tobias Burnus  <burnus@net-b.de>
461         PR fortran/57035
462         * intrinsic.c (do_check): Add constraint check for
463         NO_ARG_CHECK, assumed rank and assumed type.
464         * gfortran.texi (NO_ARG_CHECK): Minor wording change,
465         allow PRESENT intrinsic.
467 2013-05-20  Tobias Burnus  <burnus@net-b.de>
469         PR fortran/48858
470         PR fortran/55465
471         * decl.c (add_global_entry): Add sym_name.
472         * parse.c (add_global_procedure): Ditto.
473         * resolve.c (resolve_bind_c_derived_types): Handle multiple decl for
474         a procedure.
475         (resolve_global_procedure): Handle gsym->ns pointing to a module.
476         * trans-decl.c (gfc_get_extern_function_decl): Ditto.
478 2013-05-20  Tobias Burnus  <burnus@net-b.de>
480         PR fortran/48858
481         * decl.c (add_global_entry): Use nonbinding name
482         only for F2003 or if no binding label exists.
483         (gfc_match_entry): Update calls.
484         * parse.c (gfc_global_used): Improve error message.
485         (add_global_procedure): Use nonbinding name
486         only for F2003 or if no binding label exists.
487         (gfc_parse_file): Update call.
488         * resolve.c (resolve_global_procedure): Use binding
489         name when available.
490         * trans-decl.c (gfc_get_extern_function_decl): Ditto.
492 2013-05-20  Tobias Burnus  <burnus@net-b.de>
494         PR fortran/48858
495         * decl.c (gfc_match_bind_c_stmt): Add gfc_notify_std.
496         * match.c (gfc_match_common): Don't add commons to gsym.
497         * resolve.c (resolve_common_blocks): Add to gsym and
498         add checks.
499         (resolve_bind_c_comms): Remove.
500         (resolve_types): Remove call to the latter.
501         * trans-common.c (gfc_common_ns): Remove static var.
502         (gfc_map_of_all_commons): Add static var.
503         (build_common_decl): Correctly handle binding label.
505 2013-05-16  Jason Merrill  <jason@redhat.com>
507         * Make-lang.in (f951$(exeext)): Use link mutex.
509 2013-05-05  Tobias Burnus  <burnus@net-b.de>
511         * resolve.c (conformable_arrays): Avoid segfault
512         when ar.start[i] == NULL.
514 2013-05-05  Tobias Burnus  <burnus@net-b.de>
516         PR fortran/57141
517         * decl.c (gfc_match_null): Permit use-associated
518         NULL intrinsic.
520 2013-05-04  Tobias Burnus  <burnus@net-b.de>
522         * decl.c (gfc_verify_c_interop_param): Permit allocatable
523         and pointer with -std=f2008ts.
525 2013-05-02  Tobias Burnus  <burnus@net-b.de>
527         PR fortran/57142
528         * simplify.c (gfc_simplify_size): Renamed from
529         simplify_size; fix kind=8 handling.
530         (gfc_simplify_size): New function.
531         (gfc_simplify_shape): Add range check.
532         * resolve.c (resolve_function): Fix handling
533         for ISYM_SIZE.
535 2013-05-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
537         * frontend-passes.c (optimize_power):  Fix typo
538         in comment.
540 2013-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
542         PR fortran/57071
543         * frontend-passes.c (optimize_power):  Simplify
544         1**k to 1.
546 2013-04-28  Tobias Burnus  <burnus@net-b.de>
548         PR fortran/57114
549         * intrinsic.texi (RANK): Correct syntax description and
550         expected result.
552 2013-04-28  Tobias Burnus  <burnus@net-b.de>
554         PR fortran/57093
555         * trans-types.c (gfc_get_element_type): Fix handling
556         of scalar coarrays of type character.
557         * intrinsic.texi (PACK): Add missing ")".
559 2013-04-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
561         PR fortran/57071
562         * frontend-passes (optimize_power):  New function.
563         (optimize_op):  Use it.
565 2013-04-25  Janne Blomqvist  <jb@gcc.gnu.org>
567         PR bootstrap/57028
568         * Make-lang.in (f951): Link in ZLIB.
569         (CFLAGS-fortran/module.o): Add zlib include directory.
571 2013-04-22  Janus Weil  <janus@gcc.gnu.org>
573         PR fortran/53685
574         PR fortran/57022
575         * check.c (gfc_calculate_transfer_sizes): Fix for array-valued SOURCE
576         expressions.
577         * simplify.c (gfc_simplify_sizeof,gfc_simplify_storage_size): Get rid
578         of special treatment for EXPR_ARRAY.
579         * target-memory.h (gfc_element_size): New prototype.
580         * target-memory.c (size_array): Remove.
581         (gfc_element_size): New function.
582         (gfc_target_expr_size): Modified to always return the full size of the
583         expression.
585 2013-04-20  Tobias Burnus  <burnus@net-b.de>
587         PR fortran/56907
588         * trans-intrinsic.c (conv_isocbinding_function): Don't pack array
589         passed to C_LOC
591 2013-04-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
592             Mikael Morin  <mikael@gcc.gnu.org>
594         PR fortran/56872
595         * frontend-passes.c (copy_walk_reduction_arg): Change argument type
596         to gfc_constructor.  If it has an iterator, wrap the copy of its
597         expression in an array constructor with that iterator.  Don't special
598         case function expressions.
599         (callback_reduction): Update caller.  Don't return early if there is
600         an iterator.
602 2013-04-18  Tobias Burnus  <burnus@net-b.de>
604         * expr.c (find_array_element): Don't copy expr.
605         * data.c (create_character_initializer): Free expr.
606         * frontend-passes.c (combine_array_constructor): Ditto.
607         * match.c (match_typebound_call, gfc_match_select_type): Ditto.
608         * resolve.c (resolve_typebound_function): Free gfc_ref.
610 2013-04-18  Tobias Burnus  <burnus@net-b.de>
612         PR fortran/56994
613         * invoke.texi (NEAREST): S argument is not optional.
615 2013-04-17  Janus Weil  <janus@gcc.gnu.org>
617         PR fortran/56814
618         * interface.c (check_result_characteristics): Get result from interface
619         if present.
621 2013-04-17  Janne Blomqvist  <jb@gcc.gnu.org>
623         PR fortran/40958
624         * scanner.h: New file.
625         * Make-lang.in: Dependencies on scanner.h.
626         * scanner.c (gfc_directorylist): Move to scanner.h.
627         * module.c: Don't include md5.h, include scanner.h and zlib.h.
628         (MOD_VERSION): Add comment about backwards compatibility.
629         (module_fp): Change type to gzFile.
630         (ctx): Remove.
631         (gzopen_included_file_1): New function.
632         (gzopen_included_file): New function.
633         (gzopen_intrinsic_module): New function.
634         (write_char): Use gzputc.
635         (read_crc32_from_module_file): New function.
636         (read_md5_from_module_file): Remove.
637         (gfc_dump_module): Use gz* functions instead of stdio, check gzip
638         crc32 instead of md5.
639         (read_module_to_tmpbuf): Use gz* functions instead of stdio.
640         (gfc_use_module): Use gz* functions.
642 2013-04-16  Tobias Burnus  <burnus@net-b.de>
644         PR fortran/39505
645         * decl.c (ext_attr_list): Add EXT_ATTR_NO_ARG_CHECK.
646         * gfortran.h (ext_attr_id_t): Ditto.
647         * gfortran.texi (GNU Fortran Compiler Directives):
648         Document it.
649         * interface.c (compare_type_rank): Ignore rank for NO_ARG_CHECK.
650         (compare_parameter): Ditto - and regard as unlimited polymorphic.
651         * resolve.c (resolve_symbol, resolve_variable): Add same constraint
652         checks as for TYPE(*); turn dummy to TYPE(*),dimension(*).
653         (gfc_explicit_interface_required): Require explicit interface
654         for NO_ARG_CHECK.
656 2013-04-16  Janus Weil  <janus@gcc.gnu.org>
658         PR fortran/56968
659         * expr.c (gfc_check_pointer_assign): Handle generic functions returning
660         procedure pointers.
662 2013-04-16  Tobias Burnus  <burnus@net-b.de>
664         PR fortran/56969
665         * intrinsic.c (gfc_intrinsic_func_interface): Don't set
666         module name to "(intrinsic)" for intrinsics from intrinsic
667         modules.
669 2013-04-15  Tobias Burnus  <burnus@net-b.de>
671         * intrinsic.texi (SYSTEM_CLOCK): Recommend kind=8.
673 2013-04-15  Janne Blomqvist  <jb@gcc.gnu.org>
675         PR fortran/56919
676         * intrinsics.texi (SYSTEM_CLOCK): Update documentation.
678 2013-04-15  Tobias Burnus  <burnus@net-b.de>
680         * class.c (gfc_find_intrinsic_vtab): Removed unused var.
681         * dependency.c (check_data_pointer_types): Fix check.
682         * frontend-passes.c (check_data_pointer_types): Remove
683         superfluous statement.
684         * parse.c (decode_omp_directive): Add missing break.
685         * resolve.c (resolve_typebound_subroutine: Free variable.
686         * trans-decl.c (create_function_arglist): Correct condition.
688 2013-04-14  Mikael Morin  <mikael@gcc.gnu.org>
690         PR fortran/56816
691         * match.c (gfc_match_select_type): Add syntax error. Move namespace
692         allocation and cleanup...
693         * parse.c (decode_statement): ... here.
695 2013-04-13  Janus Weil  <janus@gcc.gnu.org>
697         PR fortran/55959
698         * expr.c (gfc_simplify_expr): Branch is not unreachable.
700 2013-04-12  Janus Weil  <janus@gcc.gnu.org>
702         PR fortran/56266
703         * primary.c (gfc_match_varspec): Turn gcc_assert into MATCH_ERROR.
705 2013-04-12  Tobias Burnus  <burnus@net-b.de>
707         PR fortran/56929
708         * trans-array.c (duplicate_allocatable): Fix handling
709         of scalar coarrays.
711 2013-04-12  Janus Weil  <janus@gcc.gnu.org>
713         PR fortran/56261
714         * gfortran.h (gfc_explicit_interface_required): New prototype.
715         * expr.c (gfc_check_pointer_assign): Check if an explicit interface is
716         required in a proc-ptr assignment.
717         * interface.c (check_result_characteristics): Extra check.
718         * resolve.c (gfc_explicit_interface_required): New function.
719         (resolve_global_procedure): Use new function
720         'gfc_explicit_interface_required'. Do a full interface check.
722 2013-04-12  Tobias Burnus  <burnus@net-b.de>
724         PR fortran/56845
725         * trans-decl.c (gfc_trans_deferred_vars): Restrict
726         static CLASS init to SAVE and -fno-automatic.
728 2013-04-12  Tobias Burnus  <burnus@net-b.de>
730         PR fortran/56845
731         * trans-decl.c (gfc_trans_deferred_vars): Set _vptr for
732         allocatable static BT_CLASS.
733         * trans-expr.c (gfc_class_set_static_fields): New function.
734         * trans.h (gfc_class_set_static_fields): New prototype.
736 2013-04-11  Janne Blomqvist  <jb@gcc.gnu.org>
738         * gfortran.h: Remove enum gfc_try, replace gfc_try with bool type.
739         * arith.c: Replace gfc_try with bool type.
740         * array.c: Likewise.
741         * check.c: Likewise.
742         * class.c: Likewise.
743         * cpp.c: Likewise.
744         * cpp.h: Likewise.
745         * data.c: Likewise.
746         * data.h: Likewise.
747         * decl.c: Likewise.
748         * error.c: Likewise.
749         * expr.c: Likewise.
750         * f95-lang.c: Likewise.
751         * interface.c: Likewise.
752         * intrinsic.c: Likewise.
753         * intrinsic.h: Likewise.
754         * io.c: Likewise.
755         * match.c: Likewise.
756         * match.h: Likewise.
757         * module.c: Likewise.
758         * openmp.c: Likewise.
759         * parse.c: Likewise.
760         * parse.h: Likewise.
761         * primary.c: Likewise.
762         * resolve.c: Likewise.
763         * scanner.c: Likewise.
764         * simplify.c: Likewise.
765         * symbol.c: Likewise.
766         * trans-intrinsic.c: Likewise.
767         * trans-openmp.c: Likewise.
768         * trans-stmt.c: Likewise.
769         * trans-types.c: Likewise.
771 2013-04-09  Tobias Burnus  <burnus@net-b.de>
773         * gfortran.texi (KIND Type Parameters,
774         Internal representation of LOGICAL variables): Add crossrefs.
775         (Intrinsic Types): Mention issues with _Bool interop.
776         (Naming and argument-passing conventions): New section.
778 2013-04-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
780         PR fortran/56782
781         * frontend-passes.c (callback_reduction):  Don't do
782         any simplification if there is only a single element
783         which has an iterator.
785 2013-04-07  Tobias Burnus  <burnus@net-b.de>
787         PR fortran/56849
788         * iresolve.c (gfc_resolve_reshape): Set shape also
789         with order=.
791 2013-04-04  Janus Weil  <janus@gcc.gnu.org>
793         PR fortran/40881
794         * match.c (gfc_match_return): Remove standard notification.
795         * primary.c (gfc_match_actual_arglist): Add standard notification.
797 2013-04-04  Tobias Burnus  <burnus@net-b.de>
799         PR fortran/50269
800         * gcc/fortran/check.c (is_c_interoperable,
801         gfc_check_c_loc): Correct c_loc array checking
802         for Fortran 2003 and Fortran 2008.
804 2013-04-03  Janus Weil  <janus@gcc.gnu.org>
806         PR fortran/56284
807         PR fortran/40881
808         * decl.c (gfc_match_formal_arglist): Warn about alternate-return
809         arguments.
810         * interface.c (check_dummy_characteristics): Return if symbols are NULL.
812 2013-04-01  Janus Weil  <janus@gcc.gnu.org>
814         PR fortran/56500
815         * symbol.c (gfc_set_default_type): Build class container for
816         IMPLICIT CLASS.
818 2013-03-31  Tobias Burnus  <burnus@net-b.de>
820         * class.c (finalization_scalarizer, finalizer_insert_packed_call,
821         generate_finalization_wrapper): Avoid segfault with absent SIZE=
822         argument to TRANSFER and use correct result kind for SIZE.
823         * intrinsic.c (gfc_isym_id_by_intmod): Also handle ids of
824         nonmodules.
825         * trans.c (gfc_build_final_call): Handle coarrays.
827 2013-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
829         * trans-expr.c (build_memcmp_call):  New function.
830         (gfc_build_compare_string):  If the strings
831         compared have constant and equal lengths and
832         the strings are kind=1, or, for kind=4 strings,
833         the test is for (in)equality, use memcmp().
835 2013-03-29  Tobias Burnus  <burnus@net-b.de>
837         PR fortran/35203
838         * trans-decl.c (create_function_arglist): Pass hidden argument
839         for passed-by-value optional+value dummies.
840         * trans-expr.c (gfc_conv_expr_present,
841         gfc_conv_procedure_call): Handle those.
843 2013-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
845         PR fortran/45159
846         * gfortran.h (gfc_dep_difference):  Add prototype.
847         * dependency.c (discard_nops):  New function.
848         (gfc_dep_difference):  New function.
849         (check_section_vs_section):  Use gfc_dep_difference
850         to calculate the difference of starting indices.
851         * trans-expr.c (gfc_conv_substring):  Use
852         gfc_dep_difference to calculate the length of
853         substrings where possible.
855 2013-03-28  Thomas Koenig  <tkoenig@gcc.gnu.org>
857         PR fortran/55806
858         * frontend-passes.c (optimize_code):  Keep track of
859         current code to make code insertion possible.
860         (combine_array_constructor):  New function.
861         (optimize_op):  Call it.
863 2013-03-27  Tobias Burnus  <burnus@net-b.de>
865         PR fortran/56650
866         PR fortran/36437
867         * check.c (gfc_check_sizeof, gfc_check_c_sizeof,
868         gfc_check_storage_size): Update checks.
869         * intrinsic.texi (SIZEOF): Correct class.
870         * intrinsic.h (gfc_simplify_sizeof,
871         gfc_simplify_storage_size): New prototypes.
872         * intrinsic.c (add_functions): Use them.
873         * simplify.c (gfc_simplify_sizeof,
874         gfc_simplify_storage_size): New functions.
876 2013-03-27  Janne Blomqvist  <jb@gcc.gnu.org>
878         PR fortran/25708
879         * module.c (module_locus): Use long for position.
880         (module_content): New variable.
881         (module_pos): Likewise.
882         (prev_character): Remove.
883         (bad_module): Free data instead of closing mod file.
884         (set_module_locus): Use module_pos.
885         (get_module_locus): Likewise.
886         (module_char): use buffer rather than stdio file.
887         (module_unget_char): Likewise.
888         (read_module_to_tmpbuf): New function.
889         (gfc_use_module): Call read_module_to_tmpbuf.
891 2013-03-26  Tobias Burnus  <burnus@net-b.de>
893         PR fortran/56649
894         * simplify.c (gfc_simplify_merge): Simplify more.
896 2013-03-25  Tobias Burnus  <burnus@net-b.de>
898         PR fortran/38536
899         PR fortran/38813
900         PR fortran/38894
901         PR fortran/39288
902         PR fortran/40963
903         PR fortran/45824
904         PR fortran/47023
905         PR fortran/47034
906         PR fortran/49023
907         PR fortran/50269
908         PR fortran/50612
909         PR fortran/52426
910         PR fortran/54263
911         PR fortran/55343
912         PR fortran/55444
913         PR fortran/55574
914         PR fortran/56079
915         PR fortran/56378
916         * check.c (gfc_var_strlen): Properly handle 0-sized string.
917         (gfc_check_c_sizeof): Use is_c_interoperable, add checks.
918         (is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
919         gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
920         functions.
921         * expr.c (check_inquiry): Add c_sizeof, compiler_version and
922         compiler_options.
923         (gfc_check_pointer_assign): Refine function result check.
924         gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
925         GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
926         GFC_ISYM_C_LOC.
927         (iso_fortran_env_symbol, iso_c_binding_symbol): Handle
928         NAMED_SUBROUTINE.
929         (generate_isocbinding_symbol): Update prototype.
930         (get_iso_c_sym): Remove.
931         (gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
932         * intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
933         (gfc_intrinsic_sub_interface): Use it.
934         (add_functions, add_subroutines): Add missing C-binding intrinsics.
935         (gfc_intrinsic_func_interface): Add special case for c_loc.
936         gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
937         (gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
938         * intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
939         gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
940         gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
941         * iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
942         functions.
943         * iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
944         NAMED_FUNCTION.
945         * iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
946         * module.c (create_intrinsic_function): Support subroutines and
947         derived-type results.
948         (use_iso_fortran_env_module): Update calls.
949         (import_iso_c_binding_module): Ditto; update calls to
950         generate_isocbinding_symbol.
951         * resolve.c (find_arglists): Skip for intrinsic symbols.
952         (gfc_resolve_intrinsic): Find intrinsic subs via id.
953         (is_scalar_expr_ptr, gfc_iso_c_func_interface,
954         set_name_and_label, gfc_iso_c_sub_interface): Remove.
955         (resolve_function, resolve_specific_s0): Remove calls to those.
956         (resolve_structure_cons): Fix handling.
957         * symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
958         generation.
959         (gen_cptr_param, gen_fptr_param, gen_shape_param,
960         build_formal_args, get_iso_c_sym): Remove.
961         (std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
962         (generate_isocbinding_symbol): Support hidden symbols and
963         using c_ptr/c_funptr symtrees for nullptr defs.
964         * target-memory.c (gfc_target_encode_expr): Fix handling
965         of c_ptr/c_funptr.
966         * trans-expr.c (conv_isocbinding_procedure): Remove.
967         (gfc_conv_procedure_call): Remove call to it.
968         (gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
969         of c_ptr/c_funptr.
970         * trans-intrinsic.c (conv_isocbinding_function,
971         conv_isocbinding_subroutine): New.
972         (gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
973         Call them.
974         * trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
975         * trans-types.c (gfc_typenode_for_spec,
976         gfc_get_derived_type): Ditto.
977         (gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
979 2013-03-18  Tobias Burnus  <burnus@net-b.de>
981         * gfortran.h (gfc_option_t): Remove flag_whole_file.
982         * invoke.texi (-fno-whole-file): Remove.
983         * lang.opt (fwhole-file): Change to Ignore.
984         * options.c (gfc_init_options, gfc_post_options,
985         gfc_handle_option): Remove !flag_whole_file handling
986         * parse.c (resolve_all_program_units, translate_all_program_units,
987         gfc_parse_file): Ditto.
988         * resolve.c (resolve_global_procedure): Ditto.
989         * trans-decl.c (gfc_get_symbol_decl, gfc_get_extern_function_decl,
990         gfc_create_module_variable): Ditto.
991         * trans-types.c (gfc_get_derived_type): Ditto.
993 2013-03-15  Tobias Burnus  <burnus@net-b.de>
995         PR fortran/56615
996         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Pack arrays
997         if they are not simply contiguous.
999 2013-03-11  Tobias Burnus  <burnus@net-b.de>
1001         * gfortran.texi (STRUCTURE and RECORD): State more clearly how
1002         to convert them into derived types.
1004 2013-03-10  Paul Thomas  <pault@gcc.gnu.org>
1006         PR fortran/56575
1007         * expr.c (gfc_default_initializer): Check that a class declared
1008         type has any components.
1009         * resolve.c (resolve_fl_derived0): On failing the test for C437
1010         set the type to BT_UNKNOWN to prevent repeat error messages.
1012 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
1014         PR fortran/56477
1015         * expr.c (gfc_check_pointer_assign): Avoid NULL pointer dereference.
1017 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
1019         PR fortran/54730
1020         * array.c (gfc_match_array_constructor): Set a checkpoint before
1021         matching a typespec.  Drop it on success, restore it otherwise.
1023 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
1025         PR fortran/54730
1026         * gfortran.h (struct gfc_undo_change_set): New field 'previous'.
1027         (gfc_new_undo_checkpoint, gfc_drop_last_undo_checkpoint,
1028         gfc_restore_last_undo_checkpoint): New prototypes.
1029         * symbol.c (default_undo_chgset_var): Update initialization.
1030         (single_undo_checkpoint_p, gfc_new_undo_checkpoint,
1031         free_undo_change_set_data, pop_undo_change_set,
1032         gfc_drop_last_undo_checkpoint, enforce_single_undo_checkpoint):
1033         New functions.
1034         (save_symbol_data): Handle multiple change sets.  Make sure old_symbol
1035         field's previous value is not overwritten.  Clear gfc_new field.
1036         (restore_old_symbol): Restore previous old_symbol field.
1037         (gfc_restore_last_undo_checkpoint): New function, using body renamed
1038         from gfc_undo_symbols.  Restore the previous change set as current one.
1039         (gfc_undo_symbols): New body.
1040         (gfc_commit_symbols, gfc_commit_symbol, gfc_enforce_clean_symbol_state):
1041         Call enforce_single_undo_checkpoint.
1042         (gfc_symbol_done_2): Ditto.  Free change set data.
1044 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
1046         * symbol.c (restore_old_symbol): Fix thinko.
1048 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
1050         * symbol.c (gfc_undo_symbols): Move code...
1051         (restore_old_symbol): ... here as a new function.
1053 2013-03-03  Mikael Morin  <mikael@gcc.gnu.org>
1055         * Make-lang.in (F95_PARSER_OBJS): Add dependency to vec.h.
1056         * gfortran.h: Include vec.h.
1057         (gfc_undo_change_set): New struct.
1058         * symbol.c (tentative_tbp): Remove struct.
1059         (changed_syms, tentative_tbp_list): Remove variables.
1060         (default_undo_chgset_var, latest_undo_chgset): New variables.
1061         (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols,
1062         gfc_commit_symbols, gfc_commit_symbol,
1063         gfc_enforce_clean_symbol_state, gfc_get_typebound_proc):
1064         Use latest_undo_chgset instead of changed_syms and tentative_tbp_list.
1066 2013-03-01  Tobias Burnus  <burnus@net-b.de>
1068         PR fortran/56491
1069         * iresolve.c (resolve_bound): Use gfc_get_string instead of xstrdup.
1070         * symbol.c (free_components): Free proc-pointer components.
1072 2013-03-01  Tobias Burnus  <burnus@net-b.de>
1074         * trans-decl.c (gfc_trans_deferred_vars): Free expr after use.
1075         * trans-io.c (build_dt): Ditto.
1077 2013-02-24  Joseph Myers  <joseph@codesourcery.com>
1079         * resolve.c (generate_component_assignments): Don't use UTF-8
1080         ligature in diagnostic.
1082 2013-02-21  Janus Weil  <janus@gcc.gnu.org>
1084         PR fortran/56385
1085         * trans-array.c (structure_alloc_comps): Handle procedure-pointer
1086         components with allocatable result.
1088 2013-02-21  Tobias Burnus  <burnus@net-b.de>
1090         PR fortran/56416
1091         * gfortran.texi (Part II: Language Reference, Extensions,
1092         Non-Fortran Main Program): Sort @menu to match actual section order.
1093         * intrinsic.texi (Intrinsic Procedures): Ditto.
1094         (C_F_POINTER, PRECISION): Move to the alphabetically correct place.
1096 2013-02-15  Tobias Burnus  <burnus@net-b.de>
1097             Mikael Morin  <mikael@gcc.gnu.org>
1099         PR fortran/56318
1100         * simplify.c (gfc_simplify_matmul): Fix result shape
1101         and matmul result.
1103 2013-02-15  Tobias Burnus  <burnus@net-b.de>
1105         PR fortran/53818
1106         * resolve.c (apply_default_init_local): Don't create an
1107         initializer for a result variable.
1109 2013-02-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
1111         PR fortran/56224
1112         * gfortran.h (gfc_add_include_path):  Add boolean argument
1113         for warn.
1114         * scanner.c (gfc_add_include_path):  Pass along warn argument
1115         to add_path_to_list.
1116         * options.c (gfc_post_options):  Add true warn argument to
1117         gfc_add_include_path.
1118         (gfc_handle_module_path_options):  Likewise.
1119         (gfc_handle_option): Also gfc_add_include_path for intrinsic
1120         modules, without warning.
1122 2013-02-14  Paul Thomas  <pault@gcc.gnu.org>
1123             Tobias Burnus  <burnus@net-b.de>
1125         PR testsuite/56138
1126         * trans-decl.c (gfc_get_symbol_decl): Fix deferred-length
1127         results for functions without extra result variable.
1129         Revert:
1130         2013-01-30  Tobias Burnus  <burnus@net-b.de>
1132         PR fortran/56138
1133         * trans-decl.c (gfc_trans_deferred_vars): Fix deferred-length
1134         results for functions without extra result variable.
1136 2013-02-12  Janus Weil  <janus@gcc.gnu.org>
1138         PR fortran/46952
1139         * resolve.c (resolve_call): Do not check deferred procedures for
1140         recursiveness.
1142 2013-02-09  Paul Thomas  <pault@gcc.gnu.org>
1144         PR fortran/55362
1145         * check.c (array_check): It is an error if a procedure is
1146         passed.
1148 2013-02-08  Mikael Morin  <mikael@gcc.gnu.org>
1150         PR fortran/54107
1151         * trans-types.c (gfc_get_function_type): Change a NULL backend_decl
1152         to error_mark_node on entry.  Detect recursive types.  Build a variadic
1153         procedure type if the type is recursive.  Restore the initial
1154         backend_decl.
1156 2013-02-07  Tobias Burnus  <burnus@net-b.de>
1158         PR fortran/54339
1159         * gfortran.texi (Standards): Mention TS29113.
1160         (Varying Length Character): Mention deferred-length
1161         strings.
1162         (Fortran 2003 Status): Add unlimited polymorphic.
1163         (TS 29113 Status): Add TYPE(*) and DIMENSION(..).
1164         (C Interop): Update the section about TS29113.
1166 2013-02-06 Paul Thomas  <pault@gcc.gnu.org>
1168         PR fortran/55789
1169         * trans-array.c (trans_array_constructor): Remove condition
1170         'dynamic' = true if the loop ubound is a VAR_DECL.
1172 2013-02-04  Paul Thomas  <pault@gcc.gnu.org>
1174         PR fortran/56008
1175         PR fortran/47517
1176         * trans-array.c (gfc_alloc_allocatable_for_assignment): Save
1177         the lhs descriptor before it is modified for reallocation. Use
1178         it to deallocate allocatable components in the reallocation
1179         block.  Nullify allocatable components for newly (re)allocated
1180         arrays.
1182 2013-02-04  Mikael Morin  <mikael@gcc.gnu.org>
1184         PR fortran/54195
1185         * resolve.c (resolve_typebound_procedures): Recurse through
1186         resolve_symbol.
1188 2013-02-04  Mikael Morin  <mikael@gcc.gnu.org>
1190         PR fortran/54107
1191         PR fortran/54195
1192         * gfortran.h (struct gfc_symbol): New field 'resolved'.
1193         * resolve.c (resolve_fl_var_and_proc): Don't skip result symbols.
1194         (resolve_symbol): Skip duplicate calls.  Don't check the current
1195         namespace.
1197 2013-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
1199         PR fortran/50627
1200         PR fortran/56054
1201         * decl.c (gfc_match_end):  Remove half-ready namespace
1202         from parent if the end of a block is missing.
1203         * parse.c (parse_module):  Do not put namespace into
1204         gsymbol on error.
1206 2013-01-30  Tobias Burnus  <burnus@net-b.de>
1208         PR fortran/56138
1209         * trans-decl.c (gfc_trans_deferred_vars): Fix deferred-length
1210         results for functions without extra result variable.
1212 2013-01-29  Janus Weil  <janus@gcc.gnu.org>
1213             Mikael Morin  <mikael@gcc.gnu.org>
1215         PR fortran/54107
1216         * gfortran.h (gfc_component): Delete members 'formal' and 'formal_ns'.
1217         (gfc_copy_formal_args,gfc_copy_formal_args_ppc,gfc_expr_replace_symbols,
1218         gfc_expr_replace_comp): Delete.
1219         (gfc_sym_get_dummy_args): New prototype.
1220         * dependency.c (gfc_check_fncall_dependency): Use
1221         'gfc_sym_get_dummy_args'.
1222         * expr.c (gfc_is_constant_expr): Ditto.
1223         (replace_symbol,gfc_expr_replace_symbols,replace_comp,
1224         gfc_expr_replace_comp): Deleted.
1225         * frontend-passes.c (doloop_code,do_function): Use
1226         'gfc_sym_get_dummy_args'.
1227         * interface.c (gfc_check_operator_interface,gfc_compare_interfaces,
1228         gfc_procedure_use,gfc_ppc_use,gfc_arglist_matches_symbol,
1229         gfc_check_typebound_override): Ditto.
1230         * module.c (MOD_VERSION): Bump module version.
1231         (mio_component): Do not read/write 'formal' and 'formal_ns'.
1232         * resolve.c (resolve_procedure_interface,resolve_fl_derived0): Do not
1233         copy formal args, but just keep a pointer to the interface.
1234         (resolve_function,resolve_call,resolve_typebound_generic_call,
1235         resolve_ppc_call,resolve_expr_ppc,generate_component_assignments,
1236         resolve_fl_procedure,gfc_resolve_finalizers,check_generic_tbp_ambiguity,
1237         resolve_typebound_procedure,check_uop_procedure): Use
1238         'gfc_sym_get_dummy_args'.
1239         * symbol.c (free_components): Do not free 'formal' and 'formal_ns'.
1240         (gfc_copy_formal_args,gfc_copy_formal_args_ppc): Deleted.
1241         (gfc_sym_get_dummy_args): New function.
1242         * trans-array.c (get_array_charlen,gfc_walk_elemental_function_args):
1243         Use 'gfc_sym_get_dummy_args'.
1244         * trans-decl.c (build_function_decl,create_function_arglist,
1245         build_entry_thunks,init_intent_out_dt,gfc_trans_deferred_vars,
1246         add_argument_checking): Ditto.
1247         * trans-expr.c (gfc_map_fcn_formal_to_actual,gfc_conv_procedure_call,
1248         gfc_conv_statement_function): Ditto.
1249         * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
1250         * trans-types.c (create_fn_spec,gfc_get_function_type): Ditto.
1252 2013-01-28  Tobias Burnus  <burnus@net-b.de>
1253             Mikael Morin  <mikael@gcc.gnu.org>
1255         PR fortran/53537
1256         * symbol.c (gfc_find_sym_tree): Don't look for the symbol outside an
1257         interface block.
1258         (gfc_get_ha_symtree): Let gfc_find_sym_tree lookup the parent namespace.
1259         * decl.c (gfc_match_data_decl): Ditto.
1260         (variable_decl): Remove undeclared type error.
1261         (gfc_match_import): Use renamed instead of original name.
1263 2013-01-27 Paul Thomas  <pault@gcc.gnu.org>
1265         PR fortran/55984
1266         PR fortran/56047
1267         * gfortran.h : Add associate_var to symbol_attr.
1268         * resolve.c (resolve_assoc_var): Set associate_var attribute.
1269         If the target class_ok is set, set it for the associate
1270         variable.
1271         * check.c (allocatable_check): Associate variables should not
1272         have the allocatable attribute even if their symbols do.
1273         * class.c (gfc_build_class_symbol): Symbols with associate_var
1274         set will always have a good class container.
1276 2013-01-23  Janus Weil  <janus@gcc.gnu.org>
1278         PR fortran/56081
1279         * resolve.c (resolve_select): Add argument 'select_type', reject
1280         non-scalar expressions.
1281         (resolve_select_type,resolve_code): Pass new argument to
1282         'resolve_select'.
1284 2013-01-23  Jakub Jelinek  <jakub@redhat.com>
1286         PR fortran/56052
1287         * trans-decl.c (gfc_get_symbol_decl): Set DECL_ARTIFICIAL
1288         and DECL_IGNORED_P on select_type_temporary and don't set
1289         DECL_BY_REFERENCE.
1291 2013-01-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
1293         PR fortran/55919
1294         * scanner.c (add_path_to_list): Copy path to temporary and strip
1295         trailing directory separators before calling stat().
1297 2013-01-17  Richard Biener  <rguenther@suse.de>
1299         * trans-stmt.c (gfc_trans_do): Conditionally compute countm1
1300         dependent on sign of step, avoids repeated evaluation of
1301         step sign test.  Avoid undefined overflow issues by using unsigned
1302         arithmetic.
1304 2013-01-16  Janus Weil  <janus@gcc.gnu.org>
1306         PR fortran/55983
1307         * class.c (find_typebound_proc_uop): Check for f2k_derived instead of
1308         asserting it.
1310 2013-01-16  Jakub Jelinek  <jakub@redhat.com>
1311             Tobias Burnus  <burnus@net-b.de>
1313         PR driver/55884
1314         * lang.opt (fintrinsic-modules-path): Don't accept Joined.
1315         (fintrinsic-modules-path=): New.
1316         * options.c (gfc_handle_option, gfc_get_option_string,
1317         gfc_get_option_string): Handle the latter.
1319 2013-01-16  Jakub Jelinek  <jakub@redhat.com>
1321         PR fortran/52865
1322         * trans-stmt.c (gfc_trans_do): Put countm1-- before conditional
1323         and use value of countm1 before the decrement in the condition.
1325 2013-01-15  Paul Thomas  <pault@gcc.gnu.org>
1327         PR fortran/54286
1328         * expr.c (gfc_check_pointer_assign): Check for presence of
1329         's2' before using it.
1331 2013-01-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
1333         PR fortran/55806
1334         * frontend-passes.c (optimize_reduction):  New function,
1335         including prototype.
1336         (callback_reduction):  Likewise.
1337         (gfc_run_passes):  Also run optimize_reduction.
1338         (copy_walk_reduction_arg):  New function.
1339         (dummy_code_callback):  New function.
1341 2013-01-13  Jakub Jelinek  <jakub@redhat.com>
1343         PR fortran/55935
1344         * trans-expr.c (gfc_conv_structure): Call
1345         unshare_expr_without_location on the ctor elements.
1347 2013-01-13  Paul Thomas  <pault@gcc.gnu.org>
1349         PR fortran/54286
1350         * expr.c (gfc_check_pointer_assign): Ensure that both lvalue
1351         and rvalue interfaces are presented to gfc_compare_interfaces.
1352         Simplify references to interface names by using the symbols
1353         themselves. Call gfc_compare_interfaces with s1 and s2 inter-
1354         changed to overcome the asymmetry of this function. Do not
1355         repeat the check for the presence of s1 and s2.
1357 2013-01-12  Janus Weil  <janus@gcc.gnu.org>
1359         PR fortran/55072
1360         * trans-array.c (gfc_conv_array_parameter): No packing was done for
1361         full arrays of derived type.
1363 2013-01-08  Paul Thomas  <pault@gcc.gnu.org>
1365         PR fortran/55868
1366         * class.c (get_unique_type_string): Change $tar to STAR and
1367         replace sprintf by strcpy where there is no formatting.
1368         * decl.c (gfc_match_decl_type_spec): Change $tar to STAR.
1370 2013-01-09  Mikael Morin  <mikael@gcc.gnu.org>
1372         PR fortran/47203
1373         * module.c (check_for_ambiguous): Get the current program unit using
1374         gfc_current_ns.
1376 2013-01-09  Tobias Burnus  <burnus@net-b.de>
1378         PR fortran/55758
1379         * resolve.c (resolve_symbol): Reject non-C_Bool logicals
1380         in BIND(C) procedures with -std=f*.
1382 2013-01-08  Paul Thomas  <pault@gcc.gnu.org>
1384         PR fortran/55618
1385         * trans-expr.c (gfc_conv_procedure_call): Dereference scalar
1386         character function arguments to elemental procedures in
1387         scalarization loops.
1389 2013-01-07  Tobias Burnus  <burnus@net-b.de>
1391         PR fortran/55763
1392         * gfortran.h (gfc_check_assign_symbol): Update prototype.
1393         * decl.c (add_init_expr_to_sym, do_parm): Update call.
1394         * expr.c (gfc_check_assign_symbol): Handle BT_CLASS and
1395         improve error location; support components.
1396         (gfc_check_pointer_assign): Handle component assignments.
1397         * resolve.c (resolve_fl_derived0): Call gfc_check_assign_symbol.
1398         (resolve_values): Update call.
1399         (resolve_structure_cons): Avoid double diagnostic.
1401 2013-01-07  Tobias Burnus  <burnus@net-b.de>
1402             Thomas Koenig  <tkoenig@gcc.gnu.org>
1404         PR fortran/55852
1405         * expr.c (gfc_build_intrinsic_call): Avoid clashes
1406         with user's procedures.
1407         * gfortran.h (gfc_build_intrinsic_call): Update prototype.
1408         * simplify.c (gfc_simplify_size): Update call.
1409         * class.c (finalization_scalarizer, finalization_get_offset,
1410         finalizer_insert_packed_call, generate_finalization_wrapper):
1411         Clean up by using gfc_build_intrinsic_call.
1413 2013-01-07  Tobias Burnus  <burnus@net-b.de>
1415         PR fortran/55763
1416         * resolve.c (resolve_select_type): Reject intrinsic types for
1417         a non-unlimited-polymorphic selector.
1419 2013-01-06  Paul Thomas  <pault@gcc.gnu.org>
1421         PR fortran/53876
1422         PR fortran/54990
1423         PR fortran/54992
1424         * trans-array.c (build_array_ref): Check the TYPE_CANONICAL
1425         to see if it is GFC_CLASS_TYPE_P.
1426         * trans-expr.c (gfc_get_vptr_from_expr): The same.
1427         (gfc_conv_class_to_class): If the types are not the same,
1428         cast parmese->expr to the type of ctree.
1429         * trans-types.c (gfc_get_derived_type): GFC_CLASS_TYPE_P of
1430         CLASS components must be set.
1432 2013-01-06  Mikael Morin  <mikael@gcc.gnu.org>
1434         PR fortran/42769
1435         PR fortran/45836
1436         PR fortran/45900
1437         * module.c (read_module): Don't reuse local symtree if the associated
1438         symbol isn't exactly the one wanted.  Don't reuse local symtree if it is
1439         ambiguous.
1440         * resolve.c (resolve_call): Use symtree's name instead of symbol's to
1441         lookup the symtree.
1443 2013-01-05  Steven G. Kargl  <kargl@gcc.gnu.org>
1444             Mikael Morin  <mikael@gcc.gnu.org>
1446         PR fortran/55827
1447         * class.c (gfc_fix_class_refs): Adapt ts initialization for the case
1448         e->symtree == NULL.
1449         * trans-expr.c (gfc_conv_function_expr): Init sym earlier. Use it.
1451 2013-01-05  Tobias Burnus  <burnus@net-b.de>
1453         * class.c (finalize_component): Used passed offset expr.
1454         (finalization_get_offset): New static function.
1455         (finalizer_insert_packed_call, generate_finalization_wrapper): Use it
1456         to handle noncontiguous arrays.
1458 2013-01-04  Tobias Burnus  <burnus@net-b.de>
1460         * trans.c (gfc_build_final_call): New function.
1461         * trans.h (gfc_build_final_call, gfc_conv_scalar_to_descriptor):
1462         New function prototypes.
1463         * trans-expr.c (gfc_conv_scalar_to_descriptor): Renamed from
1464         conv_scalar_to_descriptor, removed static attribute.
1465         (gfc_conv_procedure_call): Honor renaming.
1467 2013-01-04  Tobias Burnus  <burnus@net-b.de>
1469         * intrinsic.c (add_functions): New internal intrinsic
1470         function GFC_PREFIX ("stride").
1471         * gfortran.h (gfc_isym_id): Add GFC_ISYM_STRIDE.
1472         * intrinsic.h (gfc_resolve_stride): New prototypes.
1473         * iresolve.c (gfc_resolve_stride): New function.
1474         * trans-intrinsic.c (conv_intrinsic_stride): New static
1475         function.
1476         (gfc_conv_intrinsic_function): Use it.
1478 2013-01-04  Tobias Burnus  <burnus@net-b.de>
1480         * class.c (gfc_find_intrinsic_vtab): Add _final
1481         component.
1482         * decl.c (gfc_match_null): Remove superfluous
1483         variadic argument to gfc_match.
1485 2013-01-04  Paul Thomas  <pault@gcc.gnu.org>
1487         PR fortran/55172
1488         * match.c (copy_ts_from_selector_to_associate): Remove call to
1489         gfc_resolve_expr and replace it with explicit setting of the
1490         array reference type.
1491         * resolve.c (resolve_select_type): It is an error if the
1492         selector is coindexed.
1494 2013-01-04  Tobias Burnus  <burnus@net-b.de>
1496         PR fortran/55763
1497         * decl.c (gfc_match_null): Parse and reject MOLD.
1499 2013-01-04  Tobias Burnus  <burnus@net-b.de>
1501         PR fortran/55854
1502         PR fortran/55763
1503         * class.c (gfc_class_null_initializer): Fix finding the vtab.
1504         (gfc_find_intrinsic_vtab): Use BT_VOID for some components.
1506 2013-01-03  Janus Weil  <janus@gcc.gnu.org>
1508         PR fortran/55855
1509         * expr.c (gfc_check_assign): Use 'gfc_expr_attr' to evaluate attributes
1510         of rvalue. Correct hyphenation in error message.
1512 2013-01-03  Jakub Jelinek  <jakub@redhat.com>
1514         * gfortranspec.c (lang_specific_driver): Update copyright notice
1515         dates.
1517 Copyright (C) 2013 Free Software Foundation, Inc.
1519 Copying and distribution of this file, with or without modification,
1520 are permitted in any medium without royalty provided the copyright
1521 notice and this notice are preserved.