OSDN Git Service

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