OSDN Git Service

Steven G. Kargl <kargl@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2011-07-21  Steven G. Kargl  <kargl@gcc.gnu.org>
2
3         * gfortran.texi: Remove a duplicate word.
4
5 2011-07-21  Tobias Burnus  <burnus@net-b.de>
6
7         * check.c (gfc_check_present): Allow coarrays.
8         * trans-array.c (gfc_conv_array_ref): Avoid casting
9         when a pointer is wanted.
10         * trans-decl.c (create_function_arglist): For -fcoarray=lib,
11         handle hidden token and offset arguments for nondescriptor
12         coarrays.
13         * trans-expr.c (get_tree_for_caf_expr): New function.
14         (gfc_conv_procedure_call): For -fcoarray=lib pass the
15         token and offset for nondescriptor coarray dummies.
16         * trans.h (lang_type): Add caf_offset tree.
17         (GFC_TYPE_ARRAY_CAF_OFFSET): New macro.
18
19 2011-07-19  Tobias Burnus  <burnus@net-b.de>
20
21         * expr.c (gfc_is_coarray): New function.
22         * gfortran.h (gfc_is_coarray): New prototype.
23         * interface.c (compare_parameter): Use it.
24
25 2011-07-19  Richard Guenther  <rguenther@suse.de>
26
27         * trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus.
28         (gfc_trans_string_copy): Likewise.
29         * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise.
30         * trans-types.c (gfc_get_array_descr_info): Likewise.
31         * trans.c (gfc_build_array_ref): Likewise.
32
33 2011-07-19  Janus Weil  <janus@gcc.gnu.org>
34
35         PR fortran/49708
36         * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers.
37
38 2011-07-18  Tobias Burnus  <burnus@net-b.de>
39
40         * trans-decl.c (gfc_build_qualified_array): Make coarray's
41         token TYPE_QUAL_RESTRICT.
42
43 2011-07-18  Tobias Burnus  <burnus@net-b.de>
44
45         * resolve.c (resolve_transfer): Mention defined I/O
46         in the diagnostic for alloc_comp/pointer_comp.
47
48 2011-07-17  Tobias Burnus  <burnus@net-b.de>
49
50         PR fortran/34657
51         * module.c (check_for_ambiguous): Check whether the name is matches
52         the current program unit.
53
54 2011-07-17  Tobias Burnus  <burnus@net-b.de>
55
56         PR fortran/49624
57         * expr.c (gfc_check_pointer_assign): Fix checking for invalid
58         pointer bounds.
59
60 2011-07-16  Tobias Burnus  <burnus@net-b.de>
61         
62         * expr.c (gfc_ref_this_image): New function.
63         (gfc_is_coindexed): Use it.
64         * gfortran.h (gfc_ref_this_image): New prototype.
65         * resolve.c (resolve_deallocate_expr,
66         resolve_allocate_expr): Support alloc scalar coarrays.
67         * trans-array.c (gfc_conv_array_ref, gfc_array_init_size,
68         gfc_conv_descriptor_cosize, gfc_array_allocate,
69         gfc_trans_deferred_array): Ditto.
70         * trans-expr.c (gfc_conv_variable) Ditto.:
71         * trans-stmt.c (gfc_trans_deallocate): Ditto.
72         * trans-types.c (gfc_get_element_type, gfc_get_array_type_bounds
73         gfc_get_array_descr_info): Ditto.
74         * trans-decl.c (gfc_get_symbol_decl): Ditto.
75
76 2011-07-11  Jakub Jelinek  <jakub@redhat.com>
77
78         PR fortran/49698
79         * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Initialize
80         inner_size to gfc_index_one_node instead of integer_one_node.
81
82 2011-07-10  Tobias Burnus  <burnus@net-b.de>
83
84         PR fortran/49690
85         * intrinsic.c (add_functions): Use BT_VOID for 2nd argument of SIGNAL.
86
87 2011-07-09  Uros Bizjak  <ubizjak@gmail.com>
88
89         PR fortran/48926
90         * expr.c (gfc_get_corank): Change return value to int.
91         * gfortran.h (gfc_get_corank): Update function prototype.
92
93 2011-07-07  Mikael Morin  <mikael.morin@sfr.fr>
94
95         PR fortran/49648
96         * resolve.c (resolve_symbol): Force resolution of function result's
97         array specification.
98
99 2011-07-07  Tobias Burnus  <burnus@net-b.de>
100
101         * trans.c (gfc_allocate_with_status): Call _gfortran_caf_register
102         with NULL arguments for (new) stat=/errmsg= arguments.
103
104 2011-07-06  Daniel Carrera  <dcarrera@gmail.com>
105
106         * trans-array.c (gfc_array_allocate): Rename allocatable_array to
107         allocatable. Rename function gfc_allocate_array_with_status to
108         gfc_allocate_allocatable_with_status. Update function call for
109         gfc_allocate_with_status.
110         * trans-opemp.c (gfc_omp_clause_default_ctor): Rename function
111         gfc_allocate_array_with_status to gfc_allocate_allocatable_with_status.
112         * trans-stmt.c (gfc_trans_allocate): Update function call for
113         gfc_allocate_with_status. Rename function gfc_allocate_array_with_status
114         to gfc_allocate_allocatable_with_status.
115         * trans.c (gfc_call_malloc): Add new parameter gfc_allocate_with_status
116         so it uses the library for memory allocation when -fcoarray=lib.
117         (gfc_allocate_allocatable_with_status): Renamed from
118         gfc_allocate_array_with_status.
119         (gfc_allocate_allocatable_with_status): Update function call for
120         gfc_allocate_with_status.
121         * trans.h (gfc_coarray_type): New enum.
122         (gfc_allocate_with_status): Update prototype.
123         (gfc_allocate_allocatable_with_status): Renamed from
124         gfc_allocate_array_with_status.
125         * trans-decl.c (generate_coarray_sym_init): Use the new constant
126         GFC_CAF_COARRAY_ALLOC in the call to gfor_fndecl_caf_register.
127
128 2011-07-06  Richard Guenther  <rguenther@suse.de>
129
130         * f95-lang.c (gfc_init_decl_processing):
131         Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.
132
133 2011-07-04  Jakub Jelinek  <jakub@redhat.com>
134
135         PR fortran/49623
136         * gfortranspec.c (lang_specific_driver): Ignore options with
137         CL_ERR_MISSING_ARG errors.
138
139 2011-07-02  Janus Weil  <janus@gcc.gnu.org>
140
141         PR fortran/49562
142         * expr.c (gfc_check_vardef_context): Handle type-bound procedures.
143
144 2011-06-30  Jakub Jelinek  <jakub@redhat.com>
145
146         PR fortran/49540
147         * gfortran.h (gfc_constructor): Add repeat field.
148         * trans-array.c (gfc_conv_array_initializer): Handle repeat > 1.
149         * array.c (current_expand): Add repeat field.
150         (expand_constructor): Copy repeat.
151         * constructor.c (node_free, node_copy, gfc_constructor_get,
152         gfc_constructor_lookup): Handle repeat field.
153         (gfc_constructor_lookup_next, gfc_constructor_remove): New functions.
154         * data.h (gfc_assign_data_value): Add mpz_t * argument.
155         (gfc_assign_data_value_range): Removed.
156         * constructor.h (gfc_constructor_advance): Removed.
157         (gfc_constructor_lookup_next, gfc_constructor_remove): New prototypes.
158         * data.c (gfc_assign_data_value): Add REPEAT argument, handle it and
159         also handle overwriting a range with a single entry.
160         (gfc_assign_data_value_range): Removed.
161         * resolve.c (check_data_variable): Adjust gfc_assign_data_value
162         call.  Use gfc_assign_data_value instead of
163         gfc_assign_data_value_expr.
164
165 2011-06-27  Janus Weil  <janus@gcc.gnu.org>
166
167         PR fortran/49466
168         * trans-array.c (structure_alloc_comps): Make sure sub-components
169         and extended types are correctly deallocated.
170
171 2011-06-21  Andrew MacLeod  <amacleod@redhat.com>
172
173         * trans-openmp.c: Add sync_ or SYNC__ to builtin names.
174         * trans-stmt.c: Add sync_ or SYNC__ to builtin names.
175         * trans-decl.c: Add sync_ or SYNC__ to builtin names.
176
177 2011-06-21  Janus Weil  <janus@gcc.gnu.org>
178
179         PR fortran/49112
180         * class.c (gfc_find_derived_vtab): Make vtab and default initialization
181         symbols SAVE_IMPLICIT.
182
183 2011-06-20  Tobias Burnus  <burnus@net-b.de>
184
185         PR fortran/18918
186         * gfortran.h (gfc_check_vardef_context): Update prototype.
187         (iso_fortran_env_symbol): Handle derived types.
188         (symbol_attribute): Add lock_comp.
189         * expr.c (gfc_check_vardef_context): Add LOCK_TYPE check.
190         * interface.c (compare_parameter, gfc_procedure_use): Handle
191         LOCK_TYPE.
192         (compare_actual_formal): Update
193         gfc_check_vardef_context call.
194         * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto.
195         * intrinsic.c (check_arglist): Ditto.
196         * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): Ditto.
197         * iso-fortran-env.def (ISOFORTRAN_LOCK_TYPE): Add.
198         * intrinsic.texi (ISO_FORTRAN_ENV): Document LOCK_TYPE.
199         * module.c (mio_symbol_attribute): Handle lock_comp.
200         (create_derived_type): New function.
201         (use_iso_fortran_env_module): Call it to handle LOCK_TYPE.
202         * parse.c (parse_derived): Add constraint check for LOCK_TYPE.
203         * resolve.c (resolve_symbol, resolve_lock_unlock): Add constraint
204         checks for LOCK_TYPE.
205         (gfc_resolve_iterator, resolve_deallocate_expr,
206         resolve_allocate_expr, resolve_code, resolve_transfer): Update
207         gfc_check_vardef_context call.
208         * trans-stmt.h (gfc_trans_lock_unlock): New prototype.
209         * trans-stmt.c (gfc_trans_lock_unlock): New function.
210         * trans.c (trans_code): Handle LOCK and UNLOCK.
211
212 2011-06-18  Janus Weil  <janus@gcc.gnu.org>
213
214         PR fortran/49400
215         * decl.c (gfc_match_procedure): Allow PROCEDURE declarations inside
216         BLOCK constructs.
217
218 2011-06-17  Janus Weil  <janus@gcc.gnu.org>
219
220         PR fortran/48699
221         * check.c (gfc_check_move_alloc): If 'TO' argument is polymorphic,
222         make sure the vtab is present.
223
224 2011-06-16  Janus Weil  <janus@gcc.gnu.org>
225
226         PR fortran/49074
227         * interface.c (gfc_extend_assign): Propagate the locus from the
228         assignment to the type-bound procedure call.
229
230 2011-06-16  Janus Weil  <janus@gcc.gnu.org>
231
232         PR fortran/49417
233         * module.c (mio_component): Make sure the 'class_ok' attribute is set
234         for use-associated CLASS components.
235         * parse.c (parse_derived): Check for 'class_ok' attribute.
236         * resolve.c (resolve_fl_derived): Ditto.
237
238 2011-06-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
239
240         * frontend-passes.c (remove_trim):  New function.
241         (optimize_assignment):  Use it.
242         (optimize_comparison):  Likewise.  Return correct status
243         for previous change.
244
245 2011-06-12  Tobias Burnus
246
247         PR fortran/49324
248         * trans-expr.c (gfc_trans_assignment_1): Tell
249         gfc_trans_scalar_assign to also deep-copy RHS nonvariables
250         with allocatable components.
251         * trans-array.c (gfc_conv_expr_descriptor): Ditto.
252
253 2011-05-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
254
255         * frontend-passes.c (optimize_assignment): Follow chains
256         of concatenation operators to the end for removing trailing
257         TRIMS for assignments.
258
259 2011-06-10  Daniel Carrera  <dcarrera@gmail.com>
260
261         * trans-decl.c (gfc_build_builtin_function_decls):
262         Updated declaration of caf_sync_all and caf_sync_images.
263         * trans-stmt.c (gfc_trans_sync): Function
264         can now handle a "stat" variable that has an integer type
265         different from integer_type_node.
266
267 2011-06-09  Richard Guenther  <rguenther@suse.de>
268
269         * trans.c (gfc_allocate_array_with_status): Mark error path
270         as unlikely.
271
272 2011-06-08  Tobias Burnus  <burnus@net-b.de>
273
274         PR fortran/18918
275         * gfortran.h (gfc_statement): Add ST_LOCK and ST_UNLOCK.
276         (gfc_exec_op): Add EXEC_LOCK and EXEC_UNLOCK.
277         (gfc_code): Add expr4.
278         * match.h (gfc_match_lock, gfc_match_unlock): New prototypes.
279         * match.c (gfc_match_lock, gfc_match_unlock,
280         lock_unlock_statement): New functions.
281         (sync_statement): Bug fix, avoiding double freeing.
282         (gfc_match_if): Handle LOCK/UNLOCK statement.
283         * parse.c (decode_statement, next_statement,
284         gfc_ascii_statement): Ditto.
285         * st.c (gfc_free_statement): Handle LOCK and UNLOCK.
286         * resolve.c (resolve_lock_unlock): New function.
287         (resolve_code): Call it.
288         * dump-parse-tree.c (show_code_node): Handle LOCK/UNLOCK.
289
290 2011-06-07  Richard Guenther  <rguenther@suse.de>
291
292         * f95-lang.c (gfc_init_decl_processing): Do not set
293         size_type_node or call set_sizetype.
294
295 2011-06-05  Tobias Burnus  <burnus@net-b.de>
296
297         PR fortran/49255
298         * trans-expr.c (gfc_conv_procedure_call): Fix -fcheck=pointer
299         for F2008.
300
301 2011-06-05  Andreas Schmidt  <andreas.schmidt.42@gmx.net>
302         Thomas Koenig  <tkoenig@gcc.gnu.org>
303
304         * dump-parse-tree.c (show_symbol):  Don't dump namespace
305         for ENTRY to avoid infinite recursion.
306
307 2011-06-02  Asher Langton  <langton2@llnl.gov>
308
309         PR fortran/49268
310         * trans-decl.c (gfc_trans_deferred_vars): Treat assumed-size Cray
311         pointees as AS_EXPLICIT.
312
313 2011-06-02  Asher Langton  <langton2@llnl.gov>
314
315         PR fortran/37039
316         * decl.c (variable_decl): Merge current_as before copying to cp_as.
317
318 2011-06-02  Steven G. Kargl  <kargl@gcc.gnu.org>
319
320         PR fortran/49265
321         * decl.c (gfc_match_modproc):  Allow for a double colon in a module
322         procedure statement.
323         * parse.c ( decode_statement): Deal with whitespace around :: in
324         gfc_match_modproc.
325
326 2011-05-31  Tobias Burnus  <burnus@net-b.de>
327
328         PR fortran/18918
329         * intrinsic.c (klass): Add CLASS_ATOMIC.
330         (add_subroutines): Add atomic_ref/atomic_define.
331         * intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
332         * intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
333         gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
334         * gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
335         and GFC_ISYM_ATOMIC_REF.
336         (gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
337         * iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New
338         functions.
339         * check.c (gfc_check_atomic, gfc_check_atomic_def,
340         gfc_check_atomic_ref): New functions.
341         * iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
342         ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
343         * trans-intrinsic.c (conv_intrinsic_atomic_def,
344         conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
345         functions.
346         (conv_intrinsic_move_alloc) Renamed from
347         gfc_conv_intrinsic_move_alloc - and made static.
348         * trans.h (gfc_conv_intrinsic_move_alloc): Remove.
349         (gfc_conv_intrinsic_subroutine) Add prototype.
350         * trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
351         * trans-types (gfc_atomic_int_kind, gfc_atomic_logical_kind): New
352         global vars.
353         (gfc_init_kinds): Set them.
354
355 2011-05-31  Tobias Burnus  <burnus@net-b.de>
356
357         PR fortran/18918
358         * trans-array.c (gfc_trans_dummy_array_bias): Handle
359         cobounds of assumed-shape arrays.
360
361 2011-05-31  Tobias Burnus  <burnus@net-b.de>
362
363         PR fortran/18918
364         * resolve.c (resolve_fl_variable): Handle static coarrays
365         with non-constant cobounds.
366
367 2011-05-29  Janus Weil  <janus@gcc.gnu.org>
368
369         PR fortran/47601
370         * module.c (mio_component_ref): Handle components of extended types.
371         * symbol.c (gfc_find_component): Return is sym is NULL.
372
373 2011-05-29  Tobias Burnus  <burnus@net-b.de>
374
375         PR fortran/18918
376         * interface.c (compare_parameter): Add check for passing coarray
377         to allocatable noncoarray dummy.
378
379 2011-05-29  Tobias Burnus  <burnus@net-b.de>
380             Richard Guenther  <rguenther@suse.de>
381
382         PR fortran/18918
383         * trans-types.c (gfc_get_nodesc_array_type): Don't mess with
384         the type's TREE_TYPE.
385         * trans-array.c (gfc_conv_array_ref): Use TYPE_MAIN_VARIANT.
386         * trans.c (gfc_build_array_ref): Ditto.
387
388 2011-05-27  Tobias Burnus  <burnus@net-b.de>
389
390         PR fortran/18918
391         * check.c (gfc_check_associated, gfc_check_null): Add coindexed check.
392         * match.c (gfc_match_nullify): Ditto.
393         * resolve.c (resolve_deallocate_expr): Ditto.
394         * trans-types.c (gfc_get_nodesc_array_type): Don't set restricted
395         for nonpointers.
396
397 2011-05-27  Tobias Burnus  <burnus@net-b.de>
398
399         PR fortran/48820
400         * gfortran.h (gfc_isym_id): Add GFC_ISYM_RANK.
401         * intrinsic.c (add_functions): Add rank intrinsic.
402         (gfc_check_intrinsic_standard): Handle GFC_STD_F2008_TR.
403         * intrinsic.h (gfc_simplify_rank, gfc_check_rank): Add prototypes.
404         * simplify.c (gfc_simplify_rank): New function.
405         * intrinsic.texi (RANK): Add description for rank intrinsic.
406         * check.c (gfc_check_rank): New function.
407
408 2011-05-26  Paul Thomas  <pault@gcc.gnu.org>
409             Thomas Koenig  <tkoenig@gcc.gnu.org>
410
411         PR fortran/48955
412         * trans-expr.c (gfc_trans_assignment_1): GFC_REVERSE_NOT_SET
413         changed to GFC_ENABLE_REVERSE.
414         * trans-array.c (gfc_init_loopinfo): GFC_CANNOT_REVERSE changed
415         to GFC_INHIBIT_REVERSE.
416         * gfortran.h : Enum gfc_reverse is now GFC_ENABLE_REVERSE,
417         GFC_FORWARD_SET, GFC_REVERSE_SET and GFC_INHIBIT_REVERSE.
418         * dependency.c (gfc_dep_resolver): Change names for elements of
419         gfc_reverse as necessary. Change the logic so that forward
420         dependences are remembered as well as backward ones. When both
421         have appeared, force a temporary.
422
423 2011-05-26  Tobias Burnus  <burnus@net-b.de>
424
425         PR fortran/18918
426         * trans-array.c (gfc_conv_array_ref): Handle pointer coarrays.
427         * trans-decl.c (has_coarray_vars, caf_init_block,
428         gfor_fndecl_caf_register): New file-global variables.
429         (gfc_finish_var_decl): Make sure that coarrays in main are static.
430         (gfc_build_qualified_array): Generate coarray token variable.
431         (gfc_get_symbol_decl): Don't use a static initializer for coarrays.
432         (gfc_build_builtin_function_decls): Set gfor_fndecl_caf_register.
433         (gfc_trans_deferred_vars, gfc_emit_parameter_debug_info): Skip for
434         static coarrays.
435         (generate_local_decl): Check for local coarrays.
436         (create_main_function): SYNC ALL before calling MAIN.
437         (generate_coarray_sym_init): Register static coarray.
438         (generate_coarray_init): Generate CAF registering constructor
439         function.
440         (gfc_generate_function_code): Call it, if needed, do not create
441         cgraph twice.
442         (gfc_generate_module_vars, gfc_process_block_locals): Call
443         generate_coarray_init.
444         * trans-types.c (gfc_get_nodesc_array_type): Generate pointers for
445         -fcoarray=lib.
446         * trans.h (gfor_fndecl_caf_register): New variable.
447         (lang_type): New element caf_token.
448         (GFC_TYPE_ARRAY_CAF_TOKEN): New macro.
449
450 2011-05-24  Joseph Myers  <joseph@codesourcery.com>
451
452         * Make-lang.in (GFORTRAN_D_OBJS): Remove prefix.o.
453         (gfortran$(exeext)): Use libcommon-target.a.
454
455 2011-05-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
456
457         * frontend-passes.c (cfe_register_funcs):  Also register
458         character functions if their charlens are known and constant.
459         Also register allocatable functions.
460
461 2011-05-21  Janus Weil  <janus@gcc.gnu.org>
462
463         PR fortran/48699
464         * match.c (select_type_set_tmp): Make the temporary ALLOCATABLE if the
465         selector is ALLOCATABLE.
466
467 2011-05-20  Janus Weil  <janus@gcc.gnu.org>
468
469         PR fortran/48706
470         * module.c (write_dt_extensions): Do not write extended types which
471         are local to a subroutine.
472
473 2011-05-20  Joseph Myers  <joseph@codesourcery.com>
474
475         * Make-lang.in (GFORTRAN_D_OBJS): Remove version.o and intl.o.
476
477 2011-05-20  Janne Blomqvist  <jb@gcc.gnu.org>
478
479         * gfortran.texi (set_fpe): Update documentation.
480         * invoke.texi (-ffpe-trap): Likewise.
481         * libgfortran.h (GFC_FPE_PRECISION): Rename to GFC_FPE_INEXACT.
482         * options.c (gfc_handle_fpe_trap_option): Handle inexact and make
483         precision an alias for it.
484
485 2011-05-19  Tobias Burnus  <burnus@net-b.de>
486
487         PR fortran/18918
488         * trans-types.c (gfc_get_element_type): Handle scalar coarrays.
489         (gfc_get_nodesc_array_type): Make a variant-type copy for scalar
490         coarrays.
491         * trans.c (gfc_build_array_ref): Return original type not variant
492         copy for scalar coarrays.
493         * trans-array.c (gfc_conv_array_ref): Ditto.
494
495 2011-05-18  Janus Weil  <janus@gcc.gnu.org>
496
497         PR fortran/48700
498         * trans-intrinsic.c (gfc_conv_intrinsic_move_alloc): Deallocate 'TO'
499         argument to avoid memory leaks.
500
501 2011-05-16  Tobias Burnus  <burnus@net-b.de>
502
503         * gfortran.texi (_gfortran_set_options): Add GFC_STD_F2008_TR.
504         (Fortran 2008 status): Multi-image support for coarrays.
505         (TR 19113 status): New section.
506
507 2011-05-15  Tobias Burnus  <burnus@net-b.de>
508
509         PR fortran/18918
510         actual argument is not an array; rank mismatch is diagnosted later.
511         * trans-decl.c (gfc_get_symbol_decl, gfc_trans_deferred_vars): Handle
512         scalar coarrays.
513         * trans-types.c (gfc_get_array_type_bounds): Ditto.
514
515 2011-05-15  Joern Rennecke  <amylaar@spamcop.net>
516
517         PR middle-end/46500
518         * trans-types.c: Include "tm.h".
519         [0] (c_size_t_size): Remove.
520
521 2011-05-15  Janne Blomqvist  <jb@gcc.gnu.org>
522
523         PR libfortran/48915
524         * gfortran.texi (_gfortran_set_options): Even though -fbacktrace
525         is now the default, the library defaults to backtracing disabled.
526
527 2011-05-14  Tobias Burnus  <burnus@net-b.de>
528
529         * lang.opt (fdump-core): Re-add as ignored option
530         for backward compatibility.
531
532 2011-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
533
534         PR libfortran/48915
535         * gfortran.texi: Update mixed-language programming section
536         reflecting the removal of the fdump-core option, and that
537         -fbacktrace is now enabled by default.
538
539 2011-05-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
540
541         PR fortran/22572
542         * frontend-passes.c (cfe_register_funcs):  Also register functions
543         for potential elimination if the rank is > 0, the shape is unknown
544         and reallocate on assignment is active.
545         (create_var):  For rank > 0 functions with unknown shape, create
546         an allocatable temporary.
547
548 2011-05-14  Tobias Burnus  <burnus@net-b.de>
549
550         PR fortran/18918
551         * interface.c (compare_parameter): Skip diagnostic if
552         actual argument is not an array; rank mismatch is diagnosted later.
553
554 2011-05-14  Tobias Burnus  <burnus@net-b.de>
555
556         * options.c (gfc_init_options, gfc_post_options): Enable
557         -fstack-arrays by default if -Ofast is used.
558         * invoke.texi (-fstack-arrays): Document this.
559
560 2011-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
561
562         PR libfortran/48915
563         * gfortran.h (gfc_option_t): Remove flag_dump_core.
564         * gfortran.texi (GFORTRAN_ERROR_DUMPCORE): Remove section.
565         (GFORTRAN_ERROR_BACKTRACE): Document that it's enabled by default.
566         * intrinsic.texi (ABORT): Remove explanation of -fdump-core.
567         * invoke.texi: Remove -fdump-core, document that -fbacktrace is
568         enabled by default.
569         * lang.opt: Remove -fdump-core.
570         * options.c (gfc_init_options): Make backtrace default to enabled,
571         remove dump_core.
572         (gfc_handle_option): Remove OPT_fdump-core.
573         * trans-decl.c: Pass a 0 to preserve ABI.
574
575 2011-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
576
577         * gfortran.texi: Remove GFORTRAN_USE_STDERR documentation.
578
579 2011-05-13  Tobias Burnus  <burnus@net-b.de>
580
581         PR fortran/48972
582         * io.c (resolve_tag_format, resolve_tag): Make sure
583         that the string is of default kind.
584         (gfc_resolve_inquire): Also resolve decimal tag.
585
586 2011-05-12  Tobias Burnus  <burnus@net-b.de>
587
588         PR fortran/48972
589         * resolve.c (resolve_intrinsic): Don't resolve module
590         intrinsics multiple times.
591
592 2011-05-11  Tobias Burnus  <burnus@net-b.de>
593
594         PR fortran/48889
595         * expr.c (gfc_is_constant_expr): Use e->value.function.esym
596         instead of e->symtree->n.sym, if available.
597
598 2011-05-07  Eric Botcazou  <ebotcazou@adacore.com>
599
600         * f95-lang.c (global_bindings_p): Return bool and simplify.
601
602 2011-05-07  Tobias Burnus  <burnus@net-b.de>
603
604         PR fortran/18918
605         PR fortran/48919
606         * trans.h: Move gfc_init_coarray_decl prototype ...
607         * gfortran.h: ... to here.
608         * parse.c (translate_all_program_units): Call gfc_init_coarray_decl.
609         (gfc_parse_file): Update translate_all_program_units call.
610         * trans-decl.c (gfc_init_coarray_decl): Fix variable declaration,
611         new argument whether DECL_EXTERNAL should be used.
612         (create_main_function): Update gfc_init_coarray_decl call.
613         * trans-intrinsic.c (trans_this_image, trans_image_index,
614         conv_intrinsic_cobound): Ditto.
615
616 2011-05-06  Tobias Burnus  <burnus@net-b.de>
617
618         PR fortran/18918
619         * trans-array.c (gfc_walk_variable_expr): Continue walking
620         for scalar coarrays.
621         * trans-intrinsic.c (convert_element_to_coarray_ref): New function.
622         (trans_this_image, trans_image_index, conv_intrinsic_cobound): Use it.
623         (trans_this_image): Fix algorithm.
624         * trans-types.c (gfc_get_element_type, gfc_get_array_descriptor_base,
625         gfc_sym_type): Handle scalar coarrays.
626
627 2011-05-06  Tobias Burnus  <burnus@net-b.de>
628
629         PR fortran/48858
630         PR fortran/48820
631         * lang.opt (std=f2008tr): New.
632         * libgfortran.h (GFC_STD_F2008_TR): New macro constant.
633         * decl.c (verify_c_interop_param): Allow OPTIONAL in BIND(C)
634         procedures for -std=f2008tr/gnu/legacy.
635         (gfc_match_import): Set sym to NULL.
636         * options.c (set_default_std_flags,gfc_handle_option): Handle
637         -std=f2008tr.
638         * invoke.texi (-std=): Document -std=f2008tr.
639
640 2011-05-05  Nathan Froyd  <froydnj@codesourcery.com>
641
642         * trans-decl.c (gfc_trans_entry_master_switch): Call build_case_label.
643         * trans-io.c (add_case): Likewise.
644         * trans-stmt.c (gfc_trans_integer_select): Likewise.
645         (gfc_trans_character_select): Likewise.
646
647 2011-05-05  Eric Botcazou  <ebotcazou@adacore.com>
648
649         * trans-decl.c (trans_function_start): Do not set
650         dont_save_pending_sizes_p.
651
652 2011-05-04  Nathan Froyd  <froydnj@codesourcery.com>
653
654         * trans.h (gfc_chainon_list): Delete.
655         * trans.c (gfc_chainon_list): Delete.
656
657 2011-05-04  Tobias Burnus  <burnus@net-b.de>
658
659         PR fortran/48864
660         * invoke.texi (fno-protect-parens): Document
661         that -Ofast implies -fno-protect-parens.
662         * options.c (gfc_init_options, gfc_post_options):
663         Make -Ofast imply -fno-protect-parens.
664
665 2011-05-04  Nathan Froyd  <froydnj@codesourcery.com>
666
667         * trans-decl.c (build_library_function_decl_1): Call
668         build_function_type_vec.  Adjust argument list building accordingly.
669         * trans-intrinsic.c (gfc_get_intrinsic_lib_fndecl): Likewise.
670         * trans-types.c (gfc_get_function_type): Likewise.
671
672 2011-05-04  Richard Guenther  <rguenther@suse.de>
673
674         * trans-array.c (gfc_trans_array_constructor_value): Use
675         size_int for bounds of range types.
676         (gfc_trans_array_constructor_value): Use size_type_node
677         for memcpy argument.
678         * trans-common.c (build_field): Use gfc_charlen_type_node
679         for lengths.
680         * trans-openmp.c (gfc_trans_omp_clauses): Do not pass NULL
681         as type to build_int_cst.
682         * trans-const.c (gfc_build_string_const): Use size_int
683         for bounds of range types.
684         (gfc_build_wide_string_const): Likewise.
685         * trans-stmt.c (gfc_trans_label_assign): Use gfc_charlen_type_node
686         for lengths.
687         (gfc_trans_character_select): Likewise.
688         (gfc_trans_character_select): Do not pass NULL
689         as type to build_int_cst.
690         (gfc_trans_character_select): Use size_int for bounds of range types.
691         * trans-io.c (gfc_build_io_library_fndecls): Likewise.
692         (add_case): Do not pass NULL as type to build_int_cst.
693         (transfer_expr): Likewise.
694         (transfer_array_desc): Likewise.
695         * trans-decl.c (gfc_add_assign_aux_vars): Use gfc_charlen_type_node
696         for lengths.
697         (gfc_trans_assign_aux_var): Likewise.
698         (create_main_function): Use size_int for bounds of range types.
699         * trans-intrinsic.c (gfc_conv_intrinsic_minmax_char): Do not pass
700         NULL as type to build_int_cst.
701         (gfc_conv_intrinsic_spacing): Likewise.
702         (gfc_conv_intrinsic_rrspacing): Likewise.
703         (gfc_conv_intrinsic_len): Use gfc_charlen_type_node for lengths.
704
705 2011-05-04  Richard Guenther  <rguenther@suse.de>
706
707         * trans-types.c (gfc_get_array_type_bounds): Remove zero notrunc
708         argument to int_const_binop.
709
710 2011-05-03  Tobias Burnus  <burnus@net-b.de>
711
712         PR fortran/18918
713         * trans-intrinsic.c (trans_this_image): Implement version with
714         coarray argument.
715         (conv_intrinsic_cobound): Simplify code.
716         (gfc_conv_intrinsic_function): Call trans_this_image for
717         this_image(coarray) except for -fcoarray=single.
718
719 2011-05-02  Steven G. Kargl  <kargl@gcc.gnu.org>
720
721         PR fortran/48720
722         * gfortran.texi: Document the 'Q' exponent-letter extension.
723         * invoke.texi: Document -Wreal-q-constant.
724         * lang.opt: Add -Wreal-q-constant option.
725         * gfortran.h: Add warn_real_q_constant to option struct.
726         * primary.c (match_real_constant):  Use it.  Accept 'Q' as
727         exponent-letter for REAL(16) real-literal-constant with a
728         fallback to REAL(10) or error if REAL(10) is not available.
729         * options.c (gfc_init_options, set_Wall) Set it.
730         (gfc_handle_option): Handle new option.
731
732 2011-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
733
734         * dump-prase-tree.c (show_code_node):  Set the current
735         namespace to the BLOCK before displaying it; restore
736         afterwards.
737
738 2011-04-30  Tobias Burnus  <burnus@net-b.de>
739
740         PR fortran/48821
741         * decl.c (gfc_match_import): Don't try to find the
742         symbol if already found.
743
744 2011-04-30  Paul Thomas  <pault@gcc.gnu.org>
745
746         PR fortran/48746
747         * trans-expr.c (fcncall_realloc_result): Set the bounds and the
748         offset so that the lbounds are one.
749         (gfc_trans_arrayfunc_assign): Add rank to arguments of above.
750
751 2011-04-29  Paul Thomas  <pault@gcc.gnu.org>
752
753         PR fortran/48462
754         * trans-expr.c (arrayfunc_assign_needs_temporary): Deal with
755         automatic reallocation when the lhs is a target.
756
757         PR fortran/48746
758         * trans-expr.c (fcncall_realloc_result): Make sure that the
759         result dtype field is set before the function call.
760
761 2011-04-29  Tobias Burnus  <burnus@net-b.de>
762
763         PR fortran/48810
764         * resolve.c (resolve_typebound_generic_call): Don't check access
765         flags of the specific function.
766
767         PR fortran/48800
768         * resolve.c (resolve_formal_arglist): Don't change AS_DEFERRED
769         to AS_ASSUMED_SHAPE for function results.
770         (resolve_fl_var_and_proc): Print also for function results with
771         AS_DEFERRED an error, if they are not a pointer or allocatable.
772         (resolve_types): Make sure arguments of procedures in interface
773         blocks are resolved.
774
775 2011-04-29  Michael Matz  <matz@suse.de>
776
777         * options.c (options.c): Set warn_maybe_uninitialized.
778
779 2011-04-28  Tobias Burnus  <burnus@net-b.de>
780
781         PR fortran/48112
782         * resolve.c (resolve_fl_var_and_proc): Print diagnostic of
783         function results only once.
784         (resolve_symbol): Always resolve function results.
785
786         PR fortran/48279
787         * expr.c (gfc_check_vardef_context): Fix handling of generic
788         EXPR_FUNCTION.
789         * interface.c (check_interface0): Reject internal functions
790         in generic interfaces, unless -std=gnu.
791
792 2011-04-27  Tobias Burnus  <burnus@net-b.de>
793
794         PR fortran/48788
795         * resolve.c (resolve_global_procedure): Error recovery -
796         avoid segfault for (non)character-returning functions.
797
798 2011-04-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
799
800         * decl.c (gfc_match_end):  Check that the block name starts
801         with "block@".
802         * parse.c (gfc_build_block_ns):  Make block names unique by
803         numbering them.
804
805 2011-04-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
806
807         * frontend-passes.c (inserted_block):  New variable.
808         (changed_statement):  Likewise.
809         (create_var):  Encase statement to be operated on in a BLOCK.
810         Adjust code insertion for BLOCK.
811         (cfe_code):  Set inserted_block and changed_statement to NULL.
812
813 2011-04-23  Tobias Burnus  <burnus@net-b.de>
814
815         PR fortran/18918
816         * module.c (mio_array_spec): Set as->cotype on reading.
817         * resolve.c (resolve_allocate_expr): Fix allocating coarray
818         components.
819
820 2011-04-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
821
822         PR fortran/48405
823         * frontend_passes (cfe_register_funcs): Remove workaround for DO
824         loops.
825         (gfc_code_walker):  Make sure the pointer to the current
826         statement doen't change when other statements are inserted.
827
828 2011-04-21  Tobias Burnus  <burnus@net-b.de>
829
830         PR fortran/18918
831         * array.c (gfc_match_array_spec): Fix maximal rank(+corank) check.
832
833 2011-04-20  Jim Meyering  <meyering@redhat.com>
834
835         * expr.c (free_expr0): Remove useless if-before-free.
836         * gfortranspec.c (lang_specific_pre_link): Likewise.
837         * interface.c (gfc_extend_expr): Likewise.
838         * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise.
839
840 2011-04-19  Tobias Burnus  <burnus@net-b.de>
841
842         PR fortran/48588
843         PR fortran/48692
844
845         * module.c (fix_mio_expr): Commit created symbol.
846
847 2011-04-19  Janne Blomqvist  <jb@gcc.gnu.org>
848
849         * scanner.c (load_file): Use XCNEWVAR instead of xcalloc.
850
851 2011-04-19  Janne Blomqvist  <jb@gcc.gnu.org>
852
853         * frontend-passes.c (gfc_run_passes): Use XDELETEVEC instead of
854         free.
855
856 2011-04-19  Janne Blomqvist  <jb@gcc.gnu.org>
857
858         * misc.c (gfc_getmem): Remove function.
859         * gfortran.h: Remove gfc_getmem prototype. Replace gfc_getmem
860         usage with XCNEW or XCNEWVEC.
861         * expr.c (gfc_check_assign_symbol): Replace gfc_getmem usage with
862         XCNEW or XCNEWVEC.
863         * options.c (gfc_handle_module_path_options)
864         (gfc_get_option_string): Likewise.
865         * resolve.c (gfc_resolve_forall): Likewise.
866         * simplify.c (simplify_transformation_to_array): Likewise.
867         * target-memory.c (gfc_target_interpret_expr): Likewise.
868         * trans-common.c (get_segment_info, copy_equiv_list_to_ns)
869         (get_init_field): Likewise.
870         * trans-expr.c (gfc_conv_statement_function): Likewise.
871         * trans-io.c (nml_full_name): Likewise.
872         * trans-stmt.c (gfc_trans_forall_1): Likewise.
873         * scanner.c (load_file): Replace gfc_getmem usage with xcalloc.
874
875 2011-04-19  Tobias Burnus  <burnus@net-b.de>
876
877         PR fortran/48588
878         * parse.c (resolve_all_program_units): Skip modules.
879         (translate_all_program_units): Handle modules.
880         (gfc_parse_file): Defer code generation for modules.
881
882 2011-04-19  Martin Jambor  <mjambor@suse.cz>
883
884         * trans-decl.c (gfc_generate_function_code): Call cgraph_create_node
885         instead of cgraph_get_create_node.
886
887 2011-04-18  Jim Meyering  <meyering@redhat.com>
888
889         remove now-unused definition of gfc_free
890         * misc.c (gfc_free): Remove function.
891         * gfortran.h (gfc_free): Remove its prototype.
892
893 2011-04-18  Jim Meyering  <meyering@redhat.com>
894
895         convert each use of gfc_free (p) to free (p)
896         Do that by running this command:
897           perl -pi -e    's/\bgfc_free ?\(/free (/' \
898             $(git grep -El '\bgfc_free ?\(')
899         which also corrects the few uses that lacked a space between
900         the function name and the open parenthesis.
901         Manually undo the change to the function definition itself
902         and its prototype.  They'll be removed next.
903         * array.c (gfc_free_array_spec, gfc_set_array_spec): s/gfc_free/free/
904         * constructor.c (node_free): Likewise.
905         * cpp.c (dump_queued_macros): Likewise.
906         * data.c (gfc_assign_data_value): Likewise.
907         * decl.c (free_variable, free_value, gfc_free_data): Likewise.
908         (gfc_free_data_all, match_old_style_init): Likewise.
909         (gfc_set_constant_character_len, gfc_free_enum_history, NUM_DECL):
910         Likewise.
911         (gfc_match_modproc): Likewise.
912         * dependency.c (check_section_vs_section): Likewise.
913         * error.c (gfc_pop_error, gfc_free_error): Likewise.
914         * expr.c (free_expr0, gfc_free_expr, gfc_free_actual_arglist): Likewise.
915         (gfc_free_ref_list, gfc_replace_expr, gfc_copy_ref): Likewise.
916         (find_substring_ref, gfc_simplify_expr, gfc_check_assign_symbol):
917         Likewise.
918         * frontend-passes.c (gfc_run_passes, cfe_expr_0): Likewise.
919         (strip_function_call, optimize_comparison): Likewise.
920         * interface.c (gfc_free_interface, arginfo, check_interface0): Likewise.
921         (CHECK_OS_COMPARISON, gfc_extend_assign, gfc_free_formal_arglist):
922         Likewise.
923         * intrinsic.c (gfc_intrinsic_done_1, gfc_convert_type_warn): Likewise.
924         (gfc_convert_chartype): Likewise.
925         * io.c (gfc_free_open, compare_to_allowed_values, gfc_free_close):
926         Likewise.
927         (gfc_free_filepos, gfc_free_dt, gfc_free_inquire): Likewise.
928         * match.c (gfc_free_iterator, gfc_match_associate): Likewise.
929         (gfc_free_alloc_list, gfc_free_namelist, gfc_free_equiv_until):
930         Likewise.
931         (free_case, gfc_free_forall_iterator): Likewise.
932         * misc.c: Likewise.
933         * module.c (free_pi_tree, resolve_fixups, free_rename): Likewise.
934         (free_true_name, peek_atom, mio_allocated_wide_string): Likewise.
935         (mio_pool_string, mio_internal_string, mio_gmp_integer): Likewise.
936         (mio_gmp_real, mio_expr, mio_typebound_proc): Likewise.
937         (mio_full_typebound_tree, skip_list, load_equiv): Likewise.
938         (free_written_common, gfc_use_module, gfc_free_use_stmts): Likewise.
939         * openmp.c (gfc_free_omp_clauses): Likewise.
940         * options.c (gfc_post_options): Likewise.
941         * parse.c (select_type_pop, parse_omp_structured_block): Likewise.
942         * primary.c (gfc_free_structure_ctor_component): Likewise.
943         * resolve.c (resolve_structure_cons, check_host_association): Likewise.
944         (gfc_resolve_forall, resolve_equivalence): Likewise.
945         * scanner.c (gfc_scanner_done_1, gfc_release_include_path): Likewise.
946         (gfc_define_undef_line, preprocessor_line, include_line): Likewise.
947         (load_file, gfc_read_orig_filename): Likewise.
948         * simplify.c (simplify_transformation_to_array): Likewise.
949         (gfc_simplify_ibits, simplify_shift, gfc_simplify_ishftc, STRING):
950         Likewise.
951         (gfc_simplify_compiler_options): Likewise.
952         * st.c (gfc_free_statement, gfc_free_statements): Likewise.
953         (gfc_free_association_list): Likewise.
954         * symbol.c (free_components, gfc_free_st_label, free_st_labels):
955         Likewise.
956         (gfc_delete_symtree, gfc_free_symbol, gfc_undo_symbols): Likewise.
957         (free_old_symbol, gfc_commit_symbols, free_tb_tree): Likewise.
958         (free_common_tree, free_uop_tree, free_sym_tree): Likewise.
959         (gfc_free_dt_list, gfc_free_equiv_infos, gfc_free_equiv_lists):
960         Likewise.
961         (gfc_free_finalizer, gfc_free_charlen, free_entry_list): Likewise.
962         (gfc_free_namespace): Likewise.
963         * trans-array.c (gfc_free_ss, gfc_trans_array_bound_check): Likewise.
964         (gfc_conv_array_ref, gfc_conv_ss_startstride): Likewise.
965         (gfc_trans_dummy_array_bias, gfc_conv_array_parameter): Likewise.
966         * trans-common.c (get_init_field, create_common): Likewise.
967         * trans-const.c (gfc_build_wide_string_const): Likewise.
968         (gfc_conv_string_init): Likewise.
969         * trans-decl.c (gfc_generate_function_code): Likewise.
970         * trans-expr.c (gfc_conv_substring, gfc_free_interface_mapping):
971         Likewise.
972         (SCALAR_POINTER, gfc_conv_statement_function): Likewise.
973         (gfc_trans_subarray_assign): Likewise.
974         * trans-intrinsic.c (conv_generic_with_optional_char_arg): Likewise.
975         * trans-io.c (gfc_trans_io_runtime_check, set_string): Likewise.
976         (transfer_namelist_element, transfer_array_component): Likewise.
977         * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise.
978         * trans-stmt.c (cleanup_forall_symtrees, gfc_trans_forall_1): Likewise.
979         * trans.c (trans_runtime_error_vararg, gfc_restore_backend_locus):
980         Likewise.
981
982 2011-04-15  Jim Meyering  <meyering@redhat.com>
983
984         gfortran: remove cpp definition of free, ...
985         in preparation for the s/gfc_free/free/ transformation.
986         * gfortran.h (free): Remove macro definition that would otherwise
987         prevent direct use of the function.
988
989 2011-04-18  Tobias Burnus  <burnus@net-b.de>
990
991         PR fortran/18918
992         * array.c (gfc_match_array_ref): Check for too many codimensions.
993         * check.c (gfc_check_image_index): Check number of elements
994         in SUB argument.
995         * simplify.c (gfc_simplify_image_index): Remove unreachable checks.
996
997 2011-04-18  Tobias Burnus  <burnus@net-b.de>
998
999         PR fortran/18918
1000         * iresolve.c (gfc_resolve_image_index): Set ts.type.
1001         * simplify.c (gfc_simplify_image_index): Don't abort if the bounds
1002         are not known at compile time and handle -fcoarray=lib.
1003         * trans-intrinsics.c (gfc_conv_intrinsic_function): Handle
1004         IMAGE_INDEX.
1005         (conv_intrinsic_cobound): Fix comment typo.
1006         (trans_this_image): New function.
1007         * trans-array.c (gfc_unlikely): Move to trans.c.
1008         * trans.c (gfc_unlikely): Function moved from trans-array.c.
1009         (gfc_trans_runtime_check): Use it.
1010         * trans-io.c (gfc_trans_io_runtime_check): Ditto.
1011         * trans.h (gfc_unlikely): Add prototype.
1012
1013 2011-04-18  Paul Thomas  <pault@gcc.gnu.org>
1014
1015         PR fortran/48462
1016         * trans-expr.c (fcncall_realloc_result): Renamed version of
1017         realloc_lhs_bounds_for_intrinsic_call that does not touch the
1018         descriptor bounds anymore but makes a temporary descriptor to
1019         hold the result.
1020         (gfc_trans_arrayfunc_assign): Modify the reference to above
1021         renamed function.
1022
1023 2011-05-17  Tobias Burnus  <burnus@net-b.de>
1024
1025         PR fortran/48624
1026         * trans-decl.c (gfc_get_extern_function_decl): Fix decl
1027         for external procedures with proc arguments.
1028
1029 2011-04-15  Michael Matz  <matz@suse.de>
1030
1031         * trans-array.c (toplevel): Include gimple.h.
1032         (gfc_trans_allocate_array_storage): Check flag_stack_arrays,
1033         properly expand variable length arrays.
1034         (gfc_trans_auto_array_allocation): If flag_stack_arrays create
1035         variable length decls and associate them with their scope.
1036         * gfortran.h (gfc_option_t): Add flag_stack_arrays member.
1037         * options.c (gfc_init_options): Handle -fstack_arrays option.
1038         * lang.opt (fstack-arrays): Add option.
1039         * invoke.texi (Code Gen Options): Document it.
1040         * Make-lang.in (trans-array.o): Depend on GIMPLE_H.
1041
1042 2011-04-15  Tobias Burnus  <burnus@net-b.de>
1043
1044         PR fortran/18918
1045         * trans-intrinsic.c (conv_intrinsic_cobound): Remove unused
1046         code which is also causing an ICE.
1047
1048 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
1049
1050         * f95-lang.c (poplevel): Use BLOCK_CHAIN and block_chainon.
1051
1052 2011-04-12  Nathan Froyd  <froydnj@codesourcery.com>
1053
1054         * f95-lang.c (union lang_tree_node): Check for TS_COMMON before
1055         calling TREE_CHAIN.
1056
1057 2011-04-12  Paul Thomas  <pault@gcc.gnu.org>
1058
1059         PR fortran/48360
1060         PR fortran/48456
1061         * trans-array.c (get_std_lbound): For derived type variables
1062         return array valued component lbound.
1063
1064 2011-04-12  Martin Jambor  <mjambor@suse.cz>
1065
1066         * trans-decl.c (gfc_generate_function_code): Call
1067         cgraph_get_create_node instead of cgraph_node.
1068
1069 2011-04-11  Tobias Burnus  <burnus@net-b.de>
1070
1071         PR fortran/18918
1072         * simplify.c (simplify_bound_dim): Exit for
1073         ucobound's last dimension unless -fcoarray=single.
1074         * trans-array (gfc_conv_descriptor_size_1): Renamed from
1075         gfc_conv_descriptor_size, made static, has now from_dim and
1076         to_dim arguments.
1077         (gfc_conv_descriptor_size): Call gfc_conv_descriptor_size.
1078         (gfc_conv_descriptor_cosize): New function.
1079         * trans-array.h (gfc_conv_descriptor_cosize): New prototype.
1080         * trans-intrinsic.c (conv_intrinsic_cobound): Add input_location
1081         and handle last codim of ucobound for when -fcoarray is not "single".
1082
1083 2011-04-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
1084
1085         PR fortran/48448
1086         * gfortran.h (gfc_option_t):  Add warn_function_elimination and
1087         flag_frontend_optimize.
1088         * lang.opt (Wfunction-elimination):  Add.
1089         (ffrontend-optimize):  Add.
1090         * invoke.texi:  Add documentation for -Wfunction-elimination
1091         and -ffrontend-optimize.  Add -faggressive-function-elimination
1092         to list of code generation options.
1093         * frontend-passes.c (gfc_run_passes):  Run optimizations if
1094         flag_frontend_optimize is set.
1095         (warn_function_elimination):  New function.
1096         (cfe_expr_0):  Call it if requested to do so.
1097         * options.c (gfc_init_options):  Initiate warn_function_elimination
1098         and flag_frontend_optimize.
1099         (gfc_post_options):  Set flag_frontend_optimize if not specified
1100         by user, depending on the optimization level.
1101         (gfc_handle_option):  Handle -Wfunction-elimination and
1102         -ffrontend-optimize.
1103
1104 2011-04-06  Tobias Burnus  <burnus@net-b.de>
1105
1106         PR fortran/18918
1107         * trans-intrinsic.c (gfc_conv_intrinsic_function): Fix
1108         call for this_image.
1109
1110 2011-04-05  Nathan Froyd  <froydnj@codesourcery.com>
1111
1112         * trans-intrinsic.c (gfc_build_intrinsic_lib_fndecls): Use
1113         build_function_type_list instead of build_function_type.  Correct
1114         argument order for func_frexp and func_scalbn.
1115
1116 2011-04-05  Duncan Sands  <baldrick@free.fr>
1117
1118         * f95-lang.c (build_builtin_fntypes): Swap frexp parameter types.
1119
1120 2011-04-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
1121
1122         * frontend-passes: (optimize_lexical_comparison): New function.
1123         (optimize_expr): Call it.
1124         (optimize_comparison): Also handle lexical comparison functions.
1125         Return false instad of -2 for unequal comparison.
1126
1127 2011-04-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
1128
1129         PR fortran/48412
1130         * frontend-passes (cfe_expr_0):  Reverse the order of going
1131         through the loops.
1132
1133 2011-04-04  Tobias Burnus  <burnus@net-b.de>
1134             Mikael Morin  <mikael.morin@sfr.fr>
1135
1136         PR fortran/18918
1137         * check.c (is_coarray): Update - because of DIMEN_THIS_IMAGE.
1138         * expr.c (gfc_is_coindexed): Ditto.
1139         * gfortran.h (gfc_array_ref_dimen_type): Add DIMEN_THIS_IMAGE.
1140         * interface.c (compare_parameter): Use gfc_expr_attr and
1141         gfc_is_coindexed.
1142         * resolve.c (check_dimension, compare_spec_to_ref,
1143         resolve_allocate_expr, check_data_variable): Update for
1144         DIMEN_THIS_IMAGE.
1145         * simplify.c (gfc_simplify_lcobound, gfc_simplify_this_image,
1146         gfc_simplify_ucobound): Allow non-constant bounds.
1147         * trans-array.c (gfc_set_loop_bounds_from_array_spec,
1148         gfc_trans_create_temp_array, gfc_trans_constant_array_constructor,
1149         gfc_set_vector_loop_bounds, gfc_conv_array_index_offset,
1150         gfc_start_scalarized_body, gfc_trans_scalarizing_loops,
1151         gfc_trans_scalarized_loop_boundary, gfc_conv_section_startstride,
1152         gfc_conv_ss_startstride, gfc_conv_loop_setup,
1153         gfc_trans_array_bounds, gfc_conv_expr_descriptor,
1154         gfc_walk_variable_expr): Handle codimen.
1155         * trans-decl.c (gfc_build_qualified_array): Save cobounds.
1156         * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use arg2.
1157         (conv_intrinsic_cobound): New function.
1158         (gfc_conv_intrinsic_function): Call it.
1159         (gfc_walk_intrinsic_function, gfc_add_intrinsic_ss_code): Handle
1160         ucobound, lcobound, this_image.
1161         * fortran/trans-types.c (gfc_build_array_type): Save cobounds.
1162         (gfc_get_dtype): Honour corank.
1163         (gfc_get_nodesc_array_type): Save corank and codimensions.
1164         (gfc_get_array_type_bounds): Save cobound.
1165         * fortran/trans.h (gfc_ss_info,gfc_loopinfo): Add codimen item.
1166         (gfc_array_kind): Add corank item.
1167         (GFC_TYPE_ARRAY_CORANK): New macro.
1168
1169 2011-04-03  Kai Tietz  <ktietz@redhat.com>
1170
1171         PR middle-end/48422
1172         * Make-lang.in (f95-lang.o): Add some missing dependencies.
1173
1174 2011-04-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
1175
1176         PR fortran/48352
1177         * frontend-passes (cfe_register_funcs):  Don't
1178         register functions if they appear as iterators in DO loops.
1179
1180 2011-03-30  Michael Matz  <matz@suse.de>
1181
1182         PR fortran/47516
1183         * trans-expr.c (realloc_lhs_loop_for_fcn_call): Take loop as parameter,
1184         don't use local variable.
1185         (gfc_trans_arrayfunc_assign): Adjust caller.
1186
1187 2011-03-29  Janus Weil  <janus@gcc.gnu.org>
1188
1189         PR fortran/48095
1190         * decl.c (match_procedure_decl,match_ppc_decl): Set flavor of interface.
1191         * module.c (MOD_VERSION): Bump.
1192         (mio_typespec): Read/write 'interface' field.
1193         * primary.c (match_string_constant,match_logical_constant): Remove
1194         unneeded code.
1195         (match_complex_constant): Make sure to clear the typespec.
1196
1197 2011-03-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
1198
1199         * frontend-passes.c (create_var):  Warn about creating an
1200         array temporary if requested.
1201
1202 2011-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
1203
1204         PR fortran/47065
1205         * frontend-passes.c (optimize_trim): Also follow references, except
1206         when they are substring references or array references.
1207
1208 2011-03-27  Tobias Burnus  <burnus@net-b.de>
1209
1210         PR fortran/18918
1211         * gfortran.h (gfc_isym_id): Rename GFC_ISYM_NUMIMAGES to
1212         GFC_ISYM_NUM_IMAGES.
1213         (gfc_fcoarray): Add GFC_FCOARRAY_LIB.
1214         * intrinsic.c (add_functions): Update due to GFC_ISYM_NUM_IMAGES
1215         rename.
1216         * invoke.texi (-fcoarray=): Document "lib" argument.
1217         * iresolve.c (gfc_resolve_this_image): Fix THIS IMAGE().
1218         * libgfortran.h (libgfortran_stat_codes): Add comments.
1219         * options.c (gfc_handle_coarray_option): Add -fcoarray=lib.
1220         * simplify.c (gfc_simplify_num_images, gfc_simplify_this_image):
1221         Handle GFC_FCOARRAY_LIB.
1222         * trans.h (gfc_init_coarray_decl): New prototype.
1223         (gfor_fndecl_caf_init, gfor_fndecl_caf_finalize,
1224         gfor_fndecl_caf_critical, gfor_fndecl_caf_end_critical,
1225         gfor_fndecl_caf_sync_all, gfor_fndecl_caf_sync_images,
1226         gfor_fndecl_caf_error_stop, gfor_fndecl_caf_error_stop_str,
1227         gfort_gvar_caf_num_images, gfort_gvar_caf_this_image):
1228         New global variables.
1229         * trans-decl.c: Declare several CAF functions (cf. above).
1230         (gfc_build_builtin_function_decls): Initialize those.
1231         (gfc_init_coarray_decl): New function.
1232         (create_main_function): Call CAF init/finalize functions.
1233         * trans-intrinsic.c (trans_this_image, trans_num_images): New.
1234         (gfc_conv_intrinsic_function): Call those.
1235         * trans-stmt.c (gfc_trans_stop, gfc_trans_sync, gfc_trans_critical):
1236         Add code for GFC_FCOARRAY_LIB.
1237
1238 2011-03-26  Janus Weil  <janus@gcc.gnu.org>
1239
1240         PR fortran/48291
1241         * class.c (get_unique_hashed_string): Adjust maximum allowable length
1242         for unique type string.
1243
1244 2011-03-25  Kai Tietz  <ktietz@redhat.com>
1245
1246         * scanner.c (preprocessor_line): Use filename_cmp
1247         instead of strcmp.
1248
1249 2011-03-25  Tobias Burnus  <burnus@net-b.de>
1250
1251         PR fortran/48174
1252         PR fortran/45304
1253         * trans-types.c (gfc_get_function_type): Don't use varargs if the
1254         procedure is known to have no arguments.
1255
1256 2011-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
1257
1258         PR fortran/22572
1259         * gfortran.h (gfc_option_t) : Add
1260         flag_aggressive_function_elimination.
1261         (gfc_dep_compare_functions):  Add prototype.
1262         * lang.opt: Add faggressive-function-elimination.
1263         * invoke.texi: Document -faggressive-function-elimination.
1264         * frontend_passes (expr_array):  New static variable.
1265         (expr_size):  Likewise.
1266         (expr_count):  Likewise.
1267         (current_code):  Likewise.
1268         (current_ns):  Likewise.
1269         (gfc_run_passes):  Allocate and free space for expressions.
1270         (cfe_register_funcs):  New function.
1271         (create_var):  New function.
1272         (cfc_expr_0):  New function.
1273         (cfe_code):  New function.
1274         (optimize_namespace):  Invoke gfc_code_walker with cfe_code
1275         and cfe_expr_0.
1276         * dependency.c (gfc_dep_compare_functions):  New function.
1277         (gfc_dep_compare_expr):  Use it.
1278         * options.c (gfc_init_options):  Handle
1279         flag_aggressive_function_elimination.
1280         (gfc_handle_option):  Likewise.
1281
1282 2011-03-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1283
1284         * arith.c (arith_power): Plug memory leak.
1285
1286 2011-03-12  Janus Weil  <janus@gcc.gnu.org>
1287
1288         PR fortran/48059
1289         * trans-expr.c (gfc_apply_interface_mapping_to_expr): Replace base type
1290         for polymorphic arguments.
1291
1292 2011-03-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1293
1294         PR fortran/48054
1295         * intrinsic.texi: Clarify doc of logarithm functions.
1296
1297 2011-03-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1298
1299         PR fortran/47552
1300         * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Fix type of
1301         the string length variable.
1302
1303 2011-03-11  Janus Weil  <janus@gcc.gnu.org>
1304
1305         PR fortran/47768
1306         * module.c (ab_attribute,attr_bits): Add AB_PROC_POINTER_COMP.
1307         (mio_symbol_attribute): Handle attribute 'proc_pointer_comp'.
1308
1309 2011-03-06  Paul Thomas  <pault@gcc.gnu.org>
1310             Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1311
1312         PR fortran/47850
1313         * expr.c (gfc_is_constant_expr): Only use gfc_constant_ac if
1314         the expression has an iterator.  Otherwise, iterate through the
1315         array, checking for constant expressions for each element.
1316
1317 2011-03-04  Janne Blomqvist  <jb@gcc.gnu.org>
1318
1319         PR libfortran/47802
1320         * intrinsic.texi: Update CTIME and FDATE documentation.
1321
1322 2011-03-03  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1323
1324         * invoke.texi (Option Summary, Fortran Dialect Options)
1325         (Preprocessing Options, Runtime Options, Code Gen Options):
1326         Fix vertical list spacing by using @itemx for additinoal
1327         items, empty line before @table.  Fix typos.
1328
1329 2011-02-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1330
1331         PR fortran/47894
1332         * intrinsic.texi: Fix doc of the VERIFY intrinsic.
1333
1334 2011-02-26  Tobias Burnus  <burnus@net-b.de>
1335
1336         PR fortran/47846
1337         * trans-stmt.c (gfc_trans_allocate): Fix allocation with
1338         type-spec of deferred-length strings.
1339
1340 2011-02-26  Tobias Burnus  <burnus@net-b.de>
1341
1342         PR fortran/47886
1343         * openmp.c (gfc_resolve_omp_directive): Resolve if()
1344         condition of OpenMP's task.
1345
1346 2011-02-26  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1347
1348         PR fortran/47894
1349         * intrinsic.texi: Fix doc of the VERIFY intrinsic.
1350
1351 2011-02-24  Tobias Burnus  <burnus@net-b.de>
1352
1353         PR fortran/47872
1354         * intrinsic.texi (ALLOCATED, ATAN, BESSEL_JN, BESSEL_YN): Add
1355         multitable for linebreak between different syntax variants.
1356
1357 2011-02-24  Richard Guenther  <rguenther@suse.de>
1358
1359         PR fortran/47839
1360         * f95-lang.c (pushdecl): For externs in non-global scope push
1361         a copy of the decl into the BLOCK.
1362
1363 2011-02-23  Mikael Morin  <mikael@gcc.gnu.org>
1364
1365         PR fortran/40850
1366         * trans.c (gfc_prepend_expr_to_block): New function.
1367         * trans.h (gfc_prepend_expr_to_block): Declare.
1368         * trans-array.c (gfc_conv_array_parameter): Replace
1369         gfc_add_expr_to_block with gfc_prepend_expr_to_block.
1370
1371 2011-02-22  Paul Thomas  <pault@gcc.gnu.org>
1372
1373         PR fortran/45743
1374         * trans-decl.c (gfc_get_extern_function_decl): Don't use the
1375         gsymbol backend_decl if the procedure has a formal argument
1376         that is a procedure.
1377
1378 2011-02-22  Tobias Burnus  <burnus@net-b.de>
1379
1380         PR fortran/41359
1381         * trans-stmt.c (gfc_trans_if_1): Use correct line for
1382         expressions in the if condition.
1383
1384 2011-02-20  Tobias Burnus  <burnus@net-b.de>
1385
1386         PR fortran/47797
1387         * trans-decl.c (gfc_trans_deferred_vars): Use gfc_set_backend_locus and
1388         gfc_restore_backend_locus to have better debug locations.
1389         * trans-array.c (gfc_trans_deferred_array): Ditto.
1390
1391 2011-02-20  Paul Thomas  <pault@gcc.gnu.org>
1392
1393         PR fortran/45077
1394         PR fortran/44945
1395         * trans-types.c (gfc_get_derived_type): Remove code that looks
1396         for decls in gsym and add call to gfc_get_module_backend_decl.
1397         * trans.h : Add prototype for gfc_get_module_backend_decl.
1398         * trans-decl.c (gfc_get_module_backend_decl): New function.
1399         (gfc_get_symbol_decl): Call it.
1400
1401 2011-02-19  Paul Thomas  <pault@gcc.gnu.org>
1402
1403         PR fortran/47348
1404         * trans-array.c (get_array_ctor_all_strlen): Move up in file.
1405         (get_array_ctor_var_strlen): Add block dummy and add call to
1406         get_array_ctor_all_strlen instead of giving up on substrings.
1407         Call gcc_unreachable for default case.
1408         (get_array_ctor_strlen): Add extra argument to in call to
1409         get_array_ctor_var_strlen.
1410
1411 2011-02-18  Janus Weil  <janus@gcc.gnu.org>
1412
1413         PR fortran/47789
1414         * primary.c (gfc_match_structure_constructor): Handle empty parent
1415         types.
1416
1417 2011-02-18  Tobias Burnus
1418
1419         PR fortran/47775
1420         * trans-expr.c (arrayfunc_assign_needs_temporary): Use
1421         esym to check whether the specific procedure returns an
1422         allocatable or pointer.
1423
1424 2011-02-18  Michael Matz  <matz@suse.de>
1425
1426         PR fortran/45586
1427         * gfortran.h (struct gfc_component): Add norestrict_decl member.
1428         * trans.h (struct lang_type): Add nonrestricted_type member.
1429         * trans-expr.c (gfc_conv_component_ref): Search fields with correct
1430         parent type.
1431         * trans-types.c (mirror_fields, gfc_nonrestricted_type): New.
1432         (gfc_sym_type): Use it.
1433
1434 2011-02-18  Janus Weil  <janus@gcc.gnu.org>
1435
1436         PR fortran/47768
1437         * resolve.c (resolve_transfer): Reject variables with procedure pointer
1438         components.
1439
1440 2011-02-18  Janus Weil  <janus@gcc.gnu.org>
1441
1442         PR fortran/47767
1443         * gfortran.h (gfc_check_access): Removed prototype.
1444         (gfc_check_symbol_access): Added prototype.
1445         * module.c (gfc_check_access): Renamed to 'check_access', made static.
1446         (gfc_check_symbol_access): New function, basically a shortcut for
1447         'check_access'.
1448         (write_dt_extensions,write_symbol0,write_generic,write_symtree): Use
1449         'gfc_check_symbol_access'.
1450         (write_operator,write_module): Renamed 'gfc_check_access'.
1451         * resolve.c (resolve_fl_procedure,resolve_fl_derived,
1452         resolve_fl_namelist,resolve_symbol,resolve_fntype): Use
1453         'gfc_check_symbol_access'.
1454
1455 2011-02-16  Janus Weil  <janus@gcc.gnu.org>
1456
1457         PR fortran/47745
1458         * class.c (gfc_build_class_symbol): Set 'class_ok' attribute.
1459         * decl.c (build_sym,attr_decl1): Move setting of 'class_ok' into
1460         'gfc_build_class_symbol'.
1461         (gfc_match_decl_type_spec): Reject unlimited polymorphism.
1462         * interface.c (matching_typebound_op): Check for 'class_ok' attribute.
1463         * match.c (select_type_set_tmp): Move setting of 'class_ok' into
1464         'gfc_build_class_symbol'.
1465         * primary.c (gfc_variable_attr): Check for 'class_ok' attribute.
1466
1467 2011-02-15  Steven G. Kargl  <kargl@gcc.gnu.org>
1468
1469         PR fortran/47633
1470         . simplify.c (gfc_simplify_compiler_version): Fix off-by-one issue.
1471
1472 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
1473
1474         PR fortran/47730
1475         * parse.c (gfc_build_block_ns): Commit 'block@' symbol.
1476
1477 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
1478
1479         PR fortran/47728
1480         * class.c (gfc_build_class_symbol): Give a fatal error on polymorphic
1481         arrays.
1482         * primary.c (gfc_match_varspec): Avoid ICE for invalid class
1483         declaration.
1484
1485 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
1486
1487         PR fortran/47349
1488         * interface.c (get_expr_storage_size): Handle derived-type components.
1489
1490 2011-02-13  Tobias Burnus  <burnus@net-b.de>
1491
1492         PR fortran/47569
1493         * interface.c (compare_parameter): Avoid ICE with
1494         character components.
1495
1496 2011-02-12  Janus Weil  <janus@gcc.gnu.org>
1497
1498         * class.c (gfc_build_class_symbol): Reject polymorphic arrays.
1499         * decl.c (build_sym,build_struct,attr_decl1): Use return value of
1500         'gfc_build_class_symbol'.
1501
1502 2011-02-12  Michael Matz  <matz@suse.de>
1503             Janus Weil  <janus@gcc.gnu.org>
1504             Tobias Burnus  <burnus@net-b.de>
1505
1506         PR fortran/45586
1507         * trans-expr.c (conv_parent_component_references): Avoid unintendent
1508         skipping of parent compounds.
1509
1510 2011-02-11  Tobias Burnus  <burnus@net-b.de>
1511
1512         PR fortran/47550
1513         * resolve.c (resolve_formal_arglist): PURE with VALUE
1514         and no INTENT: Add -std= diagnostics.
1515
1516 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
1517
1518         PR fortran/47352
1519         * resolve.c (resolve_procedure_interface): If interface has a result
1520         variable, copy the typespec and set result pointer to self.
1521
1522 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
1523
1524         PR fortran/47463
1525         * resolve.c (resolve_typebound_subroutine): Remove erroneous line.
1526
1527 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
1528
1529         PR fortran/47637
1530         * trans-decl.c (init_intent_out_dt): Handle CLASS arguments.
1531
1532 2011-02-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1533
1534         * io.c (match_io_element): Do not set dt if not inquire.
1535
1536 2011-02-08  Janus Weil  <janus@gcc.gnu.org>
1537
1538         PR fortran/45290
1539         * expr.c (gfc_check_assign_symbol): Reject pointers as pointer
1540         initialization target.
1541
1542 2011-02-07  Janne Blomqvist  <jb@gcc.gnu.org>
1543             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
1544
1545         * gfortran.texi (Thread-safety): texinfo styling fixes.
1546         * intrinsic.texi: Likewise.
1547
1548 2011-02-06  Janne Blomqvist  <jb@gcc.gnu.org>
1549
1550         * gfortran.texi (Compiler Characteristics): Add reference to
1551         thread-safety section.
1552
1553 2011-02-06  Janne Blomqvist  <jb@gcc.gnu.org>
1554
1555         * gfortran.texi (Thread-safety): New section.
1556         * intrinsic.texi (EXECUTE_COMMAND_LINE): Mention thread-safety.
1557         (GETENV): Likewise.
1558         (GET_ENVIRONMENT_VARIABLE): Likewise.
1559         (SYSTEM): Likewise.
1560
1561 2011-02-06  Paul Thomas  <pault@gcc.gnu.org>
1562
1563         PR fortran/47592
1564         * trans-stmt.c (gfc_trans_allocate): For deferred character
1565         length allocations with SOURCE, store to the values and string
1566         length to avoid calculating twice.  Replace gfc_start_block
1567         with gfc_init_block to avoid unnecessary contexts and to keep
1568         declarations of temporaries where they should be. Tidy up the
1569         code a bit.
1570
1571 2011-02-05  Janne Blomqvist  <jb@gcc.gnu.org>
1572
1573         PR fortran/42434
1574         * intrinsic.texi (SYSTEM_CLOCK): Update documentation.
1575
1576 2011-02-02  Janus Weil  <janus@gcc.gnu.org>
1577             Paul Thomas  <pault@gcc.gnu.org>
1578
1579         PR fortran/47082
1580         * trans-expr.c (gfc_trans_class_init_assign): Add call to
1581         gfc_get_derived_type.
1582         * module.c (read_cleanup): Do not use unique_symtrees for vtabs
1583         or vtypes.
1584
1585 2011-02-02  Janus Weil  <janus@gcc.gnu.org>
1586
1587         PR fortran/47572
1588         * resolve.c (resolve_fl_variable): Handle polymorphic allocatables.
1589
1590 2011-02-01  Janus Weil  <janus@gcc.gnu.org>
1591
1592         PR fortran/47565
1593         * trans-expr.c (gfc_conv_structure): Handle constructors for procedure
1594         pointer components with allocatable result.
1595
1596 2011-01-31  Janus Weil  <janus@gcc.gnu.org>
1597
1598         PR fortran/47455
1599         * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointers
1600         with pointer or allocatable result.
1601
1602 2011-01-31  Paul Thomas  <pault@gcc.gnu.org>
1603
1604         PR fortran/47519
1605         * trans-stmt.c (gfc_trans_allocate): Improve handling of
1606         deferred character lengths with SOURCE.
1607         * iresolve.c (gfc_resolve_repeat): Calculate character
1608         length from source length and ncopies.
1609         * dump-parse-tree.c (show_code_node): Show MOLD and SOURCE
1610         expressions for ALLOCATE.
1611
1612 2011-01-31  Janus Weil  <janus@gcc.gnu.org>
1613
1614         PR fortran/47463
1615         * resolve.c (resolve_typebound_subroutine): Bug fix for the case of
1616         an argument of a typebound assignment being a component.
1617
1618 2011-01-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1619
1620         * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use
1621         LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
1622
1623 2011-01-31  Tobias Burnus  <burnus@net-b.de>
1624
1625         PR fortran/47042
1626         * resolve.c (resolve_fl_procedure): Reject stmt functions
1627         with pointer/allocatable attribute.
1628
1629 2011-01-31  Tobias Burnus  <burnus@net-b.de>
1630
1631         PR fortran/47042
1632         * interface.c (gfc_procedure_use): Add explicit interface check for
1633         pointer/allocatable functions.
1634
1635 2011-01-30  Paul Thomas  <pault@gcc.gnu.org>
1636
1637         PR fortran/47523
1638         * trans-expr.c (gfc_trans_assignment_1): If the rhs is an op
1639         expr and is assigned to a deferred character length scalar,
1640         make sure that the function is called before reallocation,
1641         so that the length is available. Include procedure pointer
1642         and procedure pointer component rhs as well.
1643
1644         PR fortran/45170
1645         PR fortran/35810
1646         PR fortran/47350
1647         * gfortran.dg/allocatable_function_5.f90: New test not added by
1648         mistake on 2011-01-28.
1649
1650 2011-01-29  Tobias Burnus  <burnus@net-b.de>
1651
1652         PR fortran/47531
1653         * check.c (gfc_check_shape): Support kind argument in SHAPE.
1654         * intrinsic.c (add_functions): Ditto.
1655         * resolve.c (gfc_resolve_shape): Ditto.
1656         * simplify.c (gfc_simplify_shape): Ditto.
1657         * intrinsic.h (gfc_check_shape, gfc_resolve_shape,
1658         gfc_simplify_shape): Update prototypes.
1659         * intrinisc.text (SHAPE): Document kind argument.
1660
1661 2011-01-28  Tobias Burnus  <burnus@net-b.de>
1662
1663         PR fortran/47507
1664         * resolve.c (resolve_formal_arglist): Allow arguments with VALUE
1665         attribute also without INTENT.
1666
1667 2011-01-28  Tobias Burnus  <burnus@net-b.de>
1668
1669         * gfortran.texi (Fortran 2003 status): Mention support for
1670         nonconstant namelist variables.
1671
1672 2011-01-28  Paul Thomas  <pault@gcc.gnu.org>
1673             Tobias Burnus  <burnus@gcc.gnu.org>
1674
1675         PR fortran/45170
1676         PR fortran/35810
1677         PR fortran/47350
1678         * interface.c (compare_actual_formal): An allocatable or pointer
1679         deferred length actual is only allowed if the formal argument
1680         is also deferred length. Clean up whitespace.
1681         * trans-expr.c (gfc_conv_procedure_call): Pass string length for
1682         deferred character length formal arguments by reference. Do the
1683         same for function results.
1684         (gfc_trans_pointer_assignment): Do not do runtime check of lhs
1685         and rhs character lengths, if deferred length lhs.  In this case
1686         set the lhs character length to that of the rhs.
1687         (gfc_conv_string_parameter): Remove assert that string length is
1688         an integer type.
1689         (is_scalar_reallocatable_lhs): New function.
1690         (alloc_scalar_allocatable_for_assignment): New function.
1691         (gfc_trans_assignment_1): Call above new function. If the rhs is
1692         a deferred character length itself, makes ure that the function
1693         is called before reallocation, so that the length is available.
1694         (gfc_trans_asssignment): Remove error about assignment to
1695         deferred length character variables.
1696         * gfortran.texi : Update entry about (re)allocation on
1697         assignment.
1698         * trans-stmt.c (gfc_trans_allocate): Add code to handle deferred
1699         length character variables.
1700         * module.c (mio_typespec): Transfer deferred characteristic.
1701         * trans-types.c (gfc_get_function_type): New code to generate
1702         hidden typelist, so that those character lengths that are
1703         passed by reference get the right type.
1704         * resolve.c (resolve_contained_fntype): Supress error for
1705         deferred character length functions.
1706         (resolve_function, resolve_fl_procedure) The same.
1707         (check_symbols): Remove the error that support for
1708         entity with deferred type parameter is not yet implemented.
1709         (resolve_fl_derived): The same.
1710         match.c (alloc_opt_list): Allow MOLD for deferred length object.
1711         * trans-decl.c (gfc_get_symbol_decl): For deferred character
1712         length dummies, generate a local variable for string length.
1713         (create_function_arglist): Hidden length can be a pointer.
1714         (gfc_trans_deferred_vars): For deferred character length
1715         results and dummies, assign the string length to the local
1716         variable from the hidden argument on entry and the other way
1717         round on exit, as appropriate.
1718
1719 2011-01-27  Tobias Burnus  <burnus@net-b.de>
1720
1721         PR fortran/47474
1722         * trans-decl.c (gfc_generate_function_code): Fix init
1723         of allocatable result variable with allocatable components.
1724
1725 2011-01-27  Tobias Burnus  <burnus@net-b.de>
1726
1727         PR fortran/47472
1728         * options.c (gfc_handle_module_path_options): Save
1729         module path without trailing slash as include path.
1730
1731 2011-01-25  Tobias Burnus  <burnus@net-b.de>
1732
1733         PR fortran/47448
1734         * interface.c (gfc_check_operator_interface): Fix
1735         defined-assignment check.
1736
1737 2011-01-23  Tobias Burnus  <burnus@net-b.de>
1738
1739         PR fortran/47421
1740         * trans-decl.c (gfc_trans_deferred_vars): Do not nullify
1741         scalar allocatable dummy arguments.
1742
1743 2011-01-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
1744
1745         PR fortran/38536
1746         * resolve.c (gfc_iso_c_func_interface):  For C_LOC,
1747         check for array sections followed by component references
1748         which are illegal.  Also check for coindexed arguments.
1749
1750 2011-01-22  Tobias Burnus  <burnus@net-b.de>
1751
1752         PR fortran/47399
1753         * primary.c (gfc_match_varspec): Relax gcc_assert to allow for
1754         PARAMETER TBP.
1755
1756 2011-01-21  Tobias Burnus  <burnus@net-b.de>
1757
1758         PR fortran/47394
1759         * error.c (gfc_error_now, gfc_fatal_error, gfc_error_check):
1760         Use defined instead of magic number exit status codes.
1761         * scanner.c (include_line, gfc_new_file): Ditto.
1762
1763 2011-01-21  Tobias Burnus  <burnus@net-b.de>
1764
1765         PR fortran/47377
1766         * expr.c (gfc_check_pointer_assign): Reject expr data-targets
1767         without pointer attribute.
1768
1769 2011-01-18  Janus Weil  <janus@gcc.gnu.org>
1770
1771         PR fortran/47240
1772         * resolve.c (expression_rank): Fix rank of procedure poiner components.
1773         * trans-expr.c (gfc_conv_procedure_call): Take care of procedure
1774         pointer components as actual arguments.
1775
1776 2011-01-17  Jakub Jelinek  <jakub@redhat.com>
1777
1778         PR fortran/47331
1779         * gfortran.h (struct gfc_omp_saved_state): New type.
1780         (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New prototypes.
1781         * resolve.c (resolve_global_procedure): Call it around gfc_resolve
1782         call.
1783         * openmp.c (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New
1784         functions.
1785
1786 2011-01-17  Tobias Burnus  <burnus@net-b.de>
1787
1788         PR fortran/47327
1789         * invoke.texi (Options to request or suppress errors
1790         and warnings): Fix cross link.
1791
1792 2011-01-15  Tobias Burnus  <burnus@net-b.de>
1793
1794         * gfortran.texi: Update Fortran 2003 Status section.
1795
1796         PR fortran/47177
1797         * invoke.texi: Add missing "-E" to the -dM example.
1798
1799 2011-01-13  Tobias Burnus  <burnus@net-b.de>
1800
1801         PR fortran/47268
1802         * intrinsic.texi (get_command_argument, get_environment_variable):
1803         Mark arguments as optional in the Arguments section.
1804
1805 2011-01-13  Kai Tietz  <kai.tietz@onevision.com>
1806             Tobias Burnus  <burnus@net-b.de>
1807
1808         PR fortran/47260
1809         * trans-decl.c (gfc_get_extern_function_decl,
1810         build_function_decl): Set TREE_PUBLIC/TREE_EXTERNAL before
1811         calling decl_attributes.
1812
1813 2011-01-13  Tobias Burnus  <burnus@net-b.de>
1814             Mikael Morin  <mikael@gcc.gnu.org>
1815
1816         PR fortran/45848
1817         PR fortran/47204
1818         * gfortran.h (gfc_code): Move union ext's case_list into
1819         the struct block.
1820         * dump-parse-tree.c (show_code_node): Adapt by prefixing case_list
1821         by "block.".
1822         * frontend-passes.c (gfc_code_walker): Ditto.
1823         * match.c (gfc_match_goto, gfc_match_call, gfc_match_case,
1824         gfc_match_type_is, gfc_match_class_is): Ditto.
1825         * resolve.c (resolve_select, resolve_select_type): Ditto.
1826         * st.c (gfc_free_statement): Ditto.
1827         * trans-stmt.c (gfc_trans_integer_select, gfc_trans_logical_select,
1828         gfc_trans_character_select): Ditto.
1829         * parse.c (resolve_all_program_units): For error recovery, avoid
1830         segfault is proc_name is NULL.
1831
1832 2011-01-11  Paul Thomas  <pault@gcc.gnu.org>
1833
1834         PR fortran/47051
1835         * trans-array.c (gfc_alloc_allocatable_for_assignment): Change
1836         to be standard compliant by testing for shape rather than size
1837         before skipping reallocation. Improve comments.
1838
1839 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
1840
1841         PR fortran/47224
1842         * resolve.c (resolve_actual_arglist): Remove unneeded and buggy piece
1843         of code.
1844
1845 2011-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
1846
1847         PR fortran/38536
1848         * resolve.c (is_scalar_expr_ptr):  For a substring reference,
1849         use gfc_dep_compare_expr to compare start and end expession.
1850         Add FIXME for using gfc_deb_compare_expr elsewhere.
1851
1852 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
1853
1854         PR fortran/46313
1855         * class.c (get_unique_type_string): Make type name start with upper
1856         case letter.
1857
1858 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
1859
1860         PR fortran/46405
1861         * invoke.texi:  Mention -ffree-line-length-none and
1862         -ffixed-line-length-none for preprocessing.
1863
1864 2011-01-08  Paul Thomas  <pault@gcc.gnu.org>
1865
1866         PR fortran/46896
1867         * trans-expr.c (gfc_conv_procedure_call): With a non-copying
1868         procedure argument (eg TRANSPOSE) use a temporary if there is
1869         any chance of aliasing due to host or use association.
1870         (arrayfunc_assign_needs_temporary): Correct logic for function
1871         results and do not use a temporary for implicitly PURE
1872         variables.  Use a temporary for Cray pointees.
1873         * symbol.c (gfc_add_save): Explicit SAVE not compatible with
1874         implicit pureness of containing procedure.
1875         * decl.c (match_old_style_init, gfc_match_data): Where decl
1876         would fail in PURE procedure, set implicit_pure to zero.
1877         * gfortran.h : Add implicit_pure to structure symbol_attr and
1878         add prototype for function gfc_implicit_pure.
1879         * expr.c (gfc_check_pointer_assign, gfc_check_vardef_context):
1880         Where decl would fail in PURE procedure, reset implicit_pure.
1881         * io.c (match_vtag, gfc_match_open, gfc_match_close,
1882         gfc_match_print, gfc_match_inquire, gfc_match_wait): The same.
1883         * match.c (gfc_match_critical, gfc_match_stopcode,
1884         sync_statement, gfc_match_allocate, gfc_match_deallocate): The
1885         same.
1886         * parse.c (decode_omp_directive): The same.
1887         (parse_contained): If not PURE, set implicit pure attribute.
1888         * resolve.c (resolve_formal_arglist, resolve_structure_cons,
1889         resolve_function, resolve_ordinary_assign) : The same.
1890         (gfc_implicit_pure): New function.
1891         * module.c (mio_symbol_attribute): Introduce AB_IMPLICIT_PURE
1892         to ab_attribute enum and use it in this function.
1893
1894 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
1895
1896         PR fortran/45777
1897         * symbol.c (gfc_symbols_could_alias):  Strip gfc_ prefix,
1898         make static and move in front of its only caller, to ...
1899         * trans-array.c (symbols_could_alias): ... here.
1900         Pass information about pointer and target status as
1901         arguments.  Allocatable arrays don't alias anything
1902         unless they have the POINTER attribute.
1903         (gfc_could_be_alias):  Keep track of pointer and target
1904         status when following references.  Also check if typespecs
1905         of components match those of other components or symbols.
1906
1907 2011-01-07  Tobias Burnus  <burnus@net-b.de>
1908
1909         PR fortran/41580
1910         * class.c (gfc_build_class_symbol): Mark __vtab as attr.vtab.
1911         * intrinsic.c (add_functions): Use simplify functions for
1912         EXTENDS_TYPE_OF and SAME_TYPE_AS.
1913         * intrinsic.h (gfc_simplify_extends_type_of,
1914         gfc_simplify_same_type_as): New prototypes.
1915         * simplify.c (is_last_ref_vtab, gfc_simplify_extends_type_of,
1916         gfc_simplify_same_type_as): New functions.
1917
1918 2011-01-07  Janus Weil  <janus@gcc.gnu.org>
1919
1920         PR fortran/47189
1921         PR fortran/47194
1922         * gfortran.h (gfc_lval_expr_from_sym): Moved prototype.
1923         * class.c (gfc_class_null_initializer): Initialize _vptr to declared
1924         type.
1925         * expr.c (gfc_lval_expr_from_sym): Moved here from symbol.c.
1926         * resolve.c (resolve_deallocate_expr): _data component will be added
1927         at translation stage.
1928         * symbol.c (gfc_lval_expr_from_sym): Moved to expr.c.
1929         * trans-stmt.c (gfc_trans_deallocate): Reset _vptr to declared type.
1930
1931 2011-01-06  Daniel Franke  <franke.daniel@gmail.com>
1932
1933         PR fortran/33117
1934         PR fortran/46478
1935         * parse.c (parse_interface): Remove check for procedure types.
1936         * interface.c (check_interface0): Verify that procedures are
1937         either all SUBROUTINEs or all FUNCTIONs.
1938
1939 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
1940
1941         PR fortran/47180
1942         * trans-expr.c (gfc_trans_class_assign): Bugfix for r168524 (make sure
1943         'vtab' is initialized).
1944
1945 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
1946
1947         PR fortran/47180
1948         * trans-expr.c (gfc_trans_class_assign): For a polymorphic NULL pointer
1949         assignment, set the _vptr component to the declared type.
1950
1951 2011-01-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
1952
1953         PR fortran/46017
1954         * resolve.c (resolve_allocate_deallocate): Follow references to
1955         check for duplicate occurence of allocation/deallocation objects.
1956
1957 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
1958
1959         PR fortran/47024
1960         * trans-decl.c (gfc_trans_deferred_vars): Initialize the _vpr component
1961         of polymorphic allocatables according to their declared type.
1962
1963 2011-01-04  Janus Weil  <janus@gcc.gnu.org>
1964
1965         PR fortran/46448
1966         * class.c (gfc_find_derived_vtab): Set the module field for the copying
1967         routine to make sure it receives module name mangling.
1968
1969 2011-01-03  Jakub Jelinek  <jakub@redhat.com>
1970
1971         * gfortranspec.c (lang_specific_driver): Update copyright notice
1972         dates.
1973
1974 2011-01-03  Janus Weil  <janus@gcc.gnu.org>
1975
1976         * intrinsic.texi (LEADZ): Fix example.
1977
1978 2011-01-02  Janus Weil  <janus@gcc.gnu.org>
1979
1980         PR fortran/46408
1981         * class.c (gfc_find_derived_vtab): Use EXEC_INIT_ASSIGN for __copy_
1982         routine.
1983
1984 \f
1985 Copyright (C) 2011 Free Software Foundation, Inc.
1986
1987 Copying and distribution of this file, with or without modification,
1988 are permitted in any medium without royalty provided the copyright
1989 notice and this notice are preserved.