OSDN Git Service

2011-12-10 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2011-12-10  Tobias Burnus  <burnus@net-b.de>
2
3         * trans-decl.c (add_argument_checking): Fix syntax.
4
5 2011-12-10  Tobias Burnus  <burnus@net-b.de>
6             Kai Tietz  <ktietz@redhat.com>
7
8         * trans-decl.c (add_argument_checking): Check ts.deferred earlier.
9         * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use %ld with long.
10
11 2011-12-08  Tobias Burnus  <burnus@net-b.de>
12
13         PR fortran/50815
14         * trans-decl.c (add_argument_checking): Skip bound checking
15         for deferred-length strings.
16
17 2011-12-08  Tobias Burnus  <burnus@net-b.de>
18
19         PR fortran/51378
20         * symbol.c (gfc_find_component): Fix access check of parent
21         components.
22
23 2011-12-08  Tobias Burnus  <burnus@net-b.de>
24
25         PR fortran/51407
26         * io/transfer.c (require_numeric_type): New function.
27         (formatted_transfer_scalar_read, formatted_transfer_scalar_write):
28         Use it, allow BOZ edit descriptors with F2008.
29
30 2011-12-08  Tobias Burnus  <burnus@net-b.de>
31
32         PR fortran/51448
33         * fortran/trans-array.c (get_std_lbound): Fix handling of
34         conversion functions.
35
36 2011-12-08  Toon Moene  <toon@moene.org>
37
38         PR fortran/51310
39         * invoke.texi: Itemize the cases for which
40         -finit-<type>=<constant> doesn't work.
41
42 2011-12-06  Tobias Burnus  <burnus@net-b.de>
43
44         PR fortran/51435
45         * expr.c (gfc_has_default_initializer): Fix handling of
46         DT with initialized pointer components.
47
48 2011-12-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
49
50         PR fortran/51338
51         * dependency.c (are_identical_variables):  Handle case where
52         end fields of substring references are NULL.
53
54 2011-12-04  Tobias Burnus  <burnus@net-b.de>
55
56         PR fortran/51383
57         * resolve.c (find_array_spec): Use ref->u.c.component
58         directly without starting from ts.u.derived.
59
60 2011-12-03  Tobias Burnus  <burnus@net-b.de>
61
62         PR fortran/48887
63         * match.c (select_type_set_tmp): Don't set allocatable/pointer
64         attribute.
65         * class.c (gfc_build_class_symbol): Handle
66         attr.select_type_temporary.
67
68 2011-12-03  Tobias Burnus  <burnus@net-b.de>
69
70         PR fortran/50684
71         * check.c (variable_check): Fix intent(in) check.
72
73 2011-12-03  Tobias Burnus  <burnus@net-b.de>
74
75         * check.c (gfc_check_move_alloc): Allow nonpolymorphic
76         FROM with polymorphic TO.
77         * trans-intrinsic.c (conv_intrinsic_move_alloc): Handle
78         nonpolymorphic FROM with polymorphic TO.
79
80 2011-12-01  Janne Blomqvist  <jb@gcc.gnu.org>
81
82         * module.c (dt_lower_string): Make static.
83         (dt_upper_string): Likewise.
84
85 2011-12-01  Janne Blomqvist  <jb@gcc.gnu.org>
86
87         PR fortran/25708
88         * module.c (parse_string): Read string into resizable array
89         instead of parsing twice and seeking.
90         (peek_atom): New implementation avoiding seeks.
91         (require_atom): Save and set column and line explicitly for error
92         handling.
93
94 2011-12-01  Janne Blomqvist  <jb@gcc.gnu.org>
95
96         * misc.c (gfc_open_file): Don't call stat.
97
98 2011-11-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
99
100         PR fortran/40958
101         * module.c (prev_module_line):  New variable.
102         (prev_module_column):  New variable.
103         (prev_character):  New variable.
104         (module_char):  Update the new variables.
105         (module_unget_char):  New function.
106         (parse_string):  Use module_unget_char.
107         (parse_integer):  Likewise.
108         (parse_name):  Likewise.
109
110 2011-11-29  Tobias Burnus  <burnus@net-b.de>
111
112         PR fortran/51306
113         PR fortran/48700
114         * check.c (gfc_check_move_alloc): Make sure that from/to
115         are both polymorphic or neither.
116         * trans-intrinsic.c (conv_intrinsic_move_alloc): Cleanup,
117         generate inline code.
118
119 2011-11-28  Tobias Burnus  <burnus@net-b.de>
120             Steven G. Kargl  <kargl@gcc.gnu.org>
121
122         PR fortran/51308
123         * symbol.c (check_conflict): Ignore BIND(C) + PARAMETER
124         conflicts for ISO_C_BINDING variables.
125         (gen_special_c_interop_ptr): Don't mark c_ptr_null/c_funptr_null
126         as SAVE.
127
128 2011-11-25  Mikael Morin  <mikael@gcc.gnu.org>
129
130         * trans-array.c (set_loop_bounds): Remove dead conditions.
131
132 2011-11-25  Mikael Morin  <mikael@gcc.gnu.org>
133
134         PR fortran/51250
135         PR fortran/43829
136         * trans-array.c (gfc_trans_create_temp_array): Get dimension from
137         the right gfc_ss struct.
138
139 2011-11-25  Tobias Burnus  <burnus@net-b.de>
140
141         PR fortran/50408
142         * trans-decl.c (gfc_get_module_backend_decl): Also copy
143         ts.u.derived from the gsym if the ts.type is BT_CLASS.
144         (gfc_get_extern_function_decl): Copy also the backend_decl
145         for the symbol's ts.u.{derived,cl} from the gsym.
146         * trans-types.c (gfc_copy_dt_decls_ifequal): Directly
147         return if "from" and "to" are the same.
148
149 2011-11-25  Tobias Burnus  <burnus@net-b.de>
150
151         PR fortran/51302
152         * trans-stmt.c (gfc_trans_simple_do): Add a fold_convert.
153
154 2011-11-24  Tobias Burnus  <burnus@net-b.de>
155
156         PR fortran/51218
157         * resolve.c (pure_subroutine): If called subroutine is
158         impure, unset implicit_pure.
159         (resolve_function): Move impure check to simplify code.
160
161 2011-11-19  Tobias Burnus  <burnus@net-b.de>
162
163         PR fortran/51207
164         * class.c (gfc_find_derived_vtab): Mark __def_init as PARAMETER
165         and hence as TREE_READONLY; add subroutine attribute to
166         __copy_ procedure.
167
168         PR fortran/50640
169         * trans.h (GFC_DECL_PUSH_TOPLEVEL): New DECL_LANG_FLAG_7.
170         * trans-decl.c (gfc_get_symbol_decl): Mark __def_init and vtab as
171         GFC_DECL_PUSH_TOPLEVEL.
172         (gfc_generate_function_code): If GFC_DECL_PUSH_TOPLEVEL, push it there.
173         (build_function_decl): Push __copy_ procedure to the toplevel.
174
175 2011-11-16  Tobias Burnus  <burnus@net-b.de>
176
177         PR fortran/39427
178         PR fortran/37829
179         * decl.c (match_data_constant, match_data_constant, variable_decl,
180         gfc_match_decl_type_spec, access_attr_decl,
181         check_extended_derived_type, gfc_match_derived_decl,
182         gfc_match_derived_decl, gfc_match_derived_decl) Modified to deal
183         with DT constructors.
184         * gfortran.h (gfc_find_dt_in_generic,
185         gfc_convert_to_structure_constructor): New function prototypes.
186         * interface.c (check_interface0, check_interface1,
187         gfc_search_interface): Ignore DT constructors in generic list.
188         * match.h (gfc_match_structure_constructor): Update prototype.
189         * match.c (match_derived_type_spec): Ensure that one uses the DT
190         not the generic function.
191         * module.c (MOD_VERSION): Bump.
192         (dt_lower_string, dt_upper_string): New functions.
193         (find_use_name_n, find_use_operator, compare_true_names,
194         find_true_name, add_true_name, fix_mio_expr, load_needed,
195         read_module, write_dt_extensions, write_symbol): Changes to deal with
196         different symtree vs. sym names.
197         (create_derived_type): Create also generic procedure.
198         * parse.c (gfc_fixup_sibling_symbols): Don't regard DT and generic
199         function as the same.
200         * primary.c (gfc_convert_to_structure_constructor): New function.
201         (gfc_match_structure_constructor): Restructured; calls
202         gfc_convert_to_structure_constructor.
203         (build_actual_constructor, gfc_match_rvalue): Update for DT generic
204         functions.
205         * resolve.c (resolve_formal_arglist, resolve_structure_cons,
206         is_illegal_recursion, resolve_generic_f, resolve_variable,
207         resolve_fl_variable_derived, resolve_fl_derived0,
208         resolve_symbol): Handle DT and DT generic constructors.
209         * symbol.c (gfc_use_derived, gfc_undo_symbols,
210         gen_special_c_interop_ptr, gen_cptr_param,
211         generate_isocbinding_symbol, gfc_get_derived_super_type): Handle
212         derived-types, which are hidden in the generic type.
213         (gfc_find_dt_in_generic): New function
214         * trans-array.c (gfc_conv_array_initializer): Replace FL_PARAMETER
215         expr by actual value.
216         * trans-decl.c (gfc_get_module_backend_decl, gfc_trans_use_stmts):
217         Ensure that we use the DT and not the generic function.
218         * trans-types.c (gfc_get_derived_type): Ensure that we use the DT
219         and not the generic procedure.
220
221 2011-11-14  Tobias Burnus  <burnus@net-b.de>
222
223         PR fortran/51073
224         * trans-decl.c (generate_coarray_sym_init): Handle zero-sized arrays.
225
226 2011-11-09  Tobias Burnus  <burnus@net-b.de>
227
228         * symbol.c (clear_sym_mark, traverse_ns): Remove functions.
229         (count_st_nodes, do_traverse_symtree, fill_st_vector): New functions.
230         (gfc_traverse_symtree, gfc_traverse_ns): Call do_traverse_symtree.
231
232 2011-11-09  Janne Blomqvist  <jb@gcc.gnu.org>
233
234         PR libfortran/50016
235         * gfortran.texi (Data consistency and durability): New section.
236
237 2011-11-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
238
239         PR fortran/50540
240         * resolve.c (resolve_forall_iterators): Transform internal errors
241         to normal errors.
242
243 2011-11-09  Janus Weil  <janus@gcc.gnu.org>
244
245         PR fortran/50960
246         * class.c (gfc_find_derived_vtab): Make the vtab symbols FL_PARAMETER.
247         * expr.c (gfc_simplify_expr): Prevent vtabs from being replaced with
248         their value.
249         * resolve.c (resolve_values): Use-associated symbols do not need to
250         be resolved again.
251         (resolve_fl_parameter): Make sure the symbol has a value.
252
253 2011-11-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
254
255         PR fortran/38718
256         * intrinsic.c (add_functions): Allow dreal simplification.
257         * intrinsic.h (gfc_simplify_dreal): New prototype.
258         * simplify.c (gfc_simplify_dreal): New function.
259
260 2011-11-09  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
261
262         PR fortran/21881
263         * trans-types.c (gfc_get_dtype): Issue a fatal error instead of
264         an internal error.
265
266 2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
267
268         PR fortran/50404
269         * io.c (gfc_resolve_close): CLOSE requires a UNIT.
270
271 2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
272
273         PR fortran/50409
274         * expr.c (gfc_simplify_expr): Substrings can't have negative
275         length.
276
277 2011-11-08  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
278
279         PR fortran/50334
280         * invoke.texi (-finit-*): Document interaction with
281         -Wuninitialized.
282
283 2011-11-07  François-Xavier Coudert  <fxcoudert@gcc.gnu.org>
284
285         PR libfortran/49188
286         PR libfortran/49336
287         * invoke.texi: Fix documentation of fsign-zero option. Remove
288         contractions.
289         * intrinsic.texi: Fix ATAN2 documentation for signed zeros.
290         Remove contractions.
291         * gfortran.texi: Remove contractions.
292
293 2011-11-07  Janus Weil  <janus@gcc.gnu.org>
294
295         PR fortran/50919
296         * class.c (add_proc_comp): Don't add non-overridable procedures to the
297         vtable.
298         * resolve.c (resolve_typebound_function,resolve_typebound_subroutine):
299         Don't generate a dynamic _vptr call for non-overridable procedures.
300
301 2011-11-07  Janne Blomqvist  <jb@gcc.gnu.org>
302
303         * intrinsic.texi (MCLOCK, MCLOCK8, TIME, TIME8): Functions clock
304         and time are part of the C standard library.
305
306 2011-11-06  Janus Weil  <janus@gcc.gnu.org>
307
308         * gfortran.h (gfc_extend_expr): Modified prototype.
309         * interface.c (gfc_extend_expr): Return 'match' instead of 'gfc_try'.
310         Remove argument 'real_error'.
311         * resolve.c (resolve_operator): Modified call to 'gfc_extend_expr'.
312
313 2011-11-06  Andrew MacLeod  <amacleod@redhat.com>
314             Aldy Hernandez  <aldyh@redhat.com>
315
316         Merged from cxx-mem-model.
317
318         * types.def: (BT_SIZE, BT_CONST_VOLATILE_PTR, BT_FN_VOID_INT,
319         BT_FN_I{1,2,4,8,16}_CONST_VPTR_INT, BT_FN_VOID_VPTR_INT,
320         BT_FN_BOOL_VPTR_INT, BT_FN_BOOL_SIZE_CONST_VPTR,
321         BT_FN_VOID_VPTR_I{1,2,4,8,16}_INT, BT_FN_VOID_SIZE_VPTR_PTR_INT,
322         BT_FN_VOID_SIZE_CONST_VPTR_PTR_INT, BT_FN_VOID_SIZE_VPTR_PTR_PTR_INT,
323         BT_FN_BOOL_VPTR_PTR_I{1,2,4,8,16}_BOOL_INT_INT,
324         BT_FN_I{1,2,4,8,16}_VPTR_I{1,2,4,8,16}_INT): New types.
325
326 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
327
328         PR fortran/43829
329         * trans-array.c (gfc_conv_expr_descriptor): Accept the inline intrinsic
330         case in the assertion.
331         * trans-intrinsic (enter_nested_loop): New function.
332         (gfc_conv_intrinsic_arith): Support non-scalar cases.
333         (nest_loop_dimension, walk_inline_intrinsic_arith): New functions.
334         (walk_inline_intrinsic_function): Handle sum and product.
335         (gfc_inline_intrinsic_function_p): Ditto.
336         * trans.h (gfc_get_loopinfo): New macro.
337
338 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
339
340         * trans-intrinsic.c (gfc_conv_intrinsic_arith): Introduce parent
341         expression variable.  Use it.
342
343 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
344
345         * trans-intrinsic.c (gfc_conv_intrinsic.c): Introduce current loop
346         pointer.  Use it.
347
348 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
349
350         * trans-intrinsic.c (gfc_conv_intrinsic_arith): Small argument handling
351         cleanup.
352
353 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
354
355         * trans-intrinsic.c (gfc_conv_intrinsic_arith): Update conditions.
356
357 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
358
359         * frontend-passes.c (cfe_register_funcs): Return early in the case
360         of an inline intrinsic function.
361         (optimize_binop_array_assignment): Skip optimization in the case of
362         an inline intrinsic function.
363
364 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
365
366         * array.c (match_subscript): Skip whitespaces before setting locus.
367         * matchexp.c (match_level_1): Ditto.
368
369 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
370
371         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxval): Set loop's
372         temporary rank to the loop rank. Mark ss chains for multiple loop
373         if necessary.  Use gfc_trans_scalarized_loop_boundary to end one loop
374         and start another.
375
376 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
377
378         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Set loop's
379         temporary rank to the loop rank. Mark ss chains for multiple loop
380         if necessary.  Use gfc_trans_scalarized_loop_boundary to end one loop
381         and start another.
382
383 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
384
385         * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Don't calculate
386         offset twice in generated code.
387
388 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
389
390         * trans-expr.c (gfc_conv_procedure_call): Handle temporaries for
391         arguments to elemental calls.
392         * trans-stmt.c (replace_ss): New function.
393         (gfc_conv_elemental_dependencies): Remove temporary loop handling.
394         Create a new ss for the temporary and replace the original one with it.
395         Remove fake array references. Recalculate all offsets.
396
397 2011-11-04  Mikael Morin  <mikael@gcc.gnu.org>
398
399         * trans-array.h (gfc_free_ss, gfc_set_delta): New prototypes.
400         * trans-array.c (gfc_free_ss): Remove forward declaration.
401         Make non-static.
402         (set_delta, gfc_set_delta): Remove forward declaration.
403         Make non-static and rename the former to the later. Update uses.
404
405 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
406
407         * trans.h (gfc_inline_intrinsic_function_p): Move prototype...
408         * gfortran.h (gfc_inline_intrinsic_function_p): ... here.
409         * dependency.c (gfc_check_argument_var_dependency): Check dependencies
410         of inline intrinsics' arguments.
411
412 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
413
414         * trans-array.c (gfc_trans_preloop_setup): New pointers to outer
415         dimension's ss and loop. Use them.
416
417 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
418
419         * trans-array.c (outermost_loop): New function.
420         (gfc_trans_array_constructor, gfc_set_vector_loop_bounds,
421         gfc_add_loop_ss_code): Put generated code out of the outermost loop.
422
423 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
424
425         * trans-array.c (constant_array_constructor_loop_size):
426         Handle multiple loops.
427
428 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
429
430         * trans-array.c (get_rank, get_loop_upper_bound_for_array):
431         New functions.
432         (gfc_trans_array_constructor): Handle multiple loops.
433
434 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
435
436         * trans.h (struct gfc_loopinfo): New field parent.
437         * trans-array.c (gfc_cleanup_loop): Free nested loops.
438         (gfc_add_ss_to_loop): Set nested_loop's parent loop.
439         (gfc_trans_array_constructor): Update assertion.
440         (gfc_conv_loop_setup): Ditto.
441
442 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
443
444         * trans-array.c (gfc_add_loop_ss_code): Skip non-nestedmost ss.
445         Call recursively gfc_add_loop_ss_code for all the nested loops.
446         (gfc_conv_ss_startstride): Only get the descriptor for the outermost
447         ss. Call recursively gfc_conv_ss_startstride for all the nested loops.
448         (set_loop_bounds): Call recursively for all the nested loops.
449         (set_delta): Ditto.
450
451 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
452
453         * trans.h (struct gfc_loopinfo): New fields nested and next.
454         * trans-array.c (gfc_add_ss_to_loop): Update list of nested list if
455         ss has non-null nested_ss field.
456
457 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
458
459         * trans-array.c (gfc_trans_create_temp_array): Loop over the parents.
460
461 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
462
463         * trans-array.c (get_array_ref_dim, get_scalarizer_dim_for_array_dim): 
464         Rename the former to the latter and loop over the parents.
465         (innermost_ss): New function.
466         (get_array_ref_dim_for_loop_dim): New function.
467         (gfc_trans_create_temp_array): Use get_scalarizer_dim_for_array_dim.
468         (set_loop_bounds): Use get_array_dim_for_loop_dim).
469
470 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
471
472         * trans.h (struct gfc_ss): New field nested_ss.
473         * trans-expr.c (gfc_advance_se_ss_chain): Update assertion.
474
475 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
476
477         * trans-array.c (set_vector_loop_bounds): Loop over the parents.
478
479 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
480
481         * trans-array.c (gfc_trans_array_constructor): Loop over the parents.
482
483 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
484
485         * trans-array.c (gfc_set_loop_bounds_from_array_spec): Loop over the
486         parents.
487
488 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
489
490         * trans.h (struct gfc_ss): New field parent.
491         * trans-array.c (gfc_trans_scalarizing_loops): Skip clearing if a
492         parent exists.
493         * trans-expr.c (gfc_advance_se_ss_chain): Move to parent ss at the
494         end of the chain.
495
496 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
497
498         * trans-array.h (gfc_trans_create_temp_array): Remove loop argument.
499         * trans-array.c (gfc_trans_create_temp_array): Ditto.  Get loop from ss.
500         Update reference to loop.  Remove loop argument.
501         (gfc_trans_array_constructor, gfc_conv_loop_setup): Update calls to
502         gfc_trans_create_temp_array.
503         * trans-expr.c (gfc_conv_procedure_call): Ditto.
504         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
505         * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
506         Set loop before calling gfc_trans_create_temp_array.
507
508 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
509
510         * trans-array.c (gfc_trans_create_temp_array): New variable total_dim.
511         Set total_dim to loop's rank. Replace usages of loop's rank.
512
513 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
514
515         * trans-array.c (gfc_trans_array_constructor, trans_array_constructor):
516         Rename the former to the later.  Get loop from ss.
517         Remove loop argument.
518         (gfc_add_loop_ss_code): Update call.
519
520 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
521
522         * trans-array.c (gfc_set_vector_loop_bounds): Get loop from ss.
523         Remove loop argument.
524         (gfc_add_loop_ss_code): Update call.
525
526 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
527
528         * trans.h (struct gfc_ss): New field loop.
529         * trans-array.c (set_ss_loop): New function.
530         (gfc_add_ss_to_loop): Call set_ss_loop.
531
532 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
533
534         * trans.h (struct gfc_ss_info): New field refcount.
535         * trans-array.c (free_ss_info): Decrement refcount. Return early if
536         still non-zero.
537         (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss): Increment
538         refcount.
539
540 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
541
542         * trans-array.c (gfc_trans_create_temp_array): Move invariant condition
543         out of the containing loop. 
544
545 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
546
547         * trans-array.c (gfc_conv_loop_setup, gfc_trans_create_temp_array):
548         Move specloop arrays clearing from the former to the latter.
549
550 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
551
552         * trans-array.c (set_loop_bounds): Separate the beginning of
553         gfc_conv_loop_setup into a function of its own.
554         (set_delta): Separate the end of gfc_conv_loop_setup into a function
555         of its own.
556         (gfc_conv_loop_setup): Call set_loop_bounds and set delta.
557         (set_loop_bounds, set_delta, gfc_conv_loop_setup): Make loopspec a
558         pointer to the specloop field from the loop struct.
559
560 2011-11-03  Tobias Burnus  <burnus@net-b.de>
561
562         PR fortran/50933
563         * interface.c (gfc_compare_derived_types): Fix check for BIND(C).
564
565 2011-11-03  Tobias Burnus  <burnus@net-b.de>
566
567         PR fortran/50960
568         * trans-decl.c (gfc_finish_var_decl): Mark PARAMETER as TREE_READONLY.
569
570 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
571
572         * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
573         gfc_ss::where into gfc_ss_info.
574         * trans-array.c (gfc_add_loop_ss_code):
575         Update reference chains.
576         * trans-stmt.c (gfc_trans_where_assign, gfc_trans_where_3): Ditto.
577
578 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
579
580         * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
581         gfc_ss::useflags into gfc_ss_info.
582         * trans-array.c (gfc_mark_ss_chain_used, gfc_trans_preloop_setup,
583         gfc_trans_scalarizing_loops, gfc_trans_scalarized_boundary):
584         Update reference chains.
585         * trans-expr.c (gfc_conv_procedure_call): Ditto.
586         * trans-intrinsic.c (gfc_conv_intrinsic_function): Ditto.
587
588 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
589
590         * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
591         gfc_ss::data::info into gfc_ss_info::data and remove empty union
592         gfc_ss::data.
593         * trans-array.c (gfc_free_ss, gfc_trans_create_temp_array,
594         gfc_trans_constant_array_constructor, gfc_trans_array_constructor,
595         gfc_set_vector_loop_bounds, gfc_add_loop_ss_code,
596         gfc_conv_ss_descriptor, gfc_trans_array_bound_check,
597         gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref,
598         add_array_offset, gfc_trans_preloop_setup,
599         gfc_trans_scalarized_boundary, gfc_conv_section_startstride,
600         gfc_conv_ss_startstride, gfc_could_be_alias,
601         gfc_conv_loop_setup, gfc_conv_expr_descriptor,
602         gfc_alloc_allocatable_for_assignment, gfc_walk_array_ref):
603         Update reference chains and factor them where possible.
604         * trans-expr.c (gfc_conv_variable, gfc_conv_subref_array_arg,
605         gfc_conv_procedure_call, gfc_trans_subarray_assign): Updata reference
606         chains.
607         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
608         * trans-io.c (transfer_array_component): Ditto.
609         * trans-stmt.c (gfc_conv_elemental_dependencies,
610         gfc_trans_pointer_assign_need_temp): Ditto.
611
612 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
613
614         * trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct
615         gfc_ss::data::temp into gfc_ss_info::data.
616         * trans-array.c (gfc_get_temp_ss, gfc_conv_loop_setup): Update reference
617         chains.
618
619 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
620
621         * trans.h (struct gfc_ss, struct gfc_ss_info): Move member struct
622         gfc_ss::data::scalar into newly created union gfc_ss_info::data,
623         and rename subfield expr to value.
624         * trans-array.c (gfc_add_loop_ss_code, gfc_conv_array_index_offset,
625         gfc_conv_expr_descriptor): Update reference chains.
626         * trans-const.c (gfc_conv_constant): Ditto.
627         * trans-expr.c (gfc_conv_expr): Ditto.
628
629 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
630
631         * trans.h (struct gfc_ss, struct gfc_ss_info): Move field
632         string_length from the former struct to the latter.
633         * trans-array.c
634         (gfc_get_temp_ss, gfc_trans_array_constructor, gfc_add_loop_ss_code,
635         gfc_conv_ss_descriptor, gfc_conv_scalarized_array_ref,
636         gfc_conv_resolve_dependencies, gfc_conv_loop_setup,
637         gfc_conv_expr_descriptor): Update references to string_length and
638         factor common reference chains where possible.
639         * trans-const.c (gfc_conv_constant): Ditto.
640         * trans-expr.c (gfc_conv_variable, gfc_conv_subref_array_arg,
641         gfc_conv_expr): Ditto.
642
643 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
644
645         * trans.h (struct gfc_ss, struct gfc_ss_info): Move field expr from
646         the former struct to the latter.
647         * trans-array.c
648         (gfc_get_array_ss, gfc_get_scalar_ss,
649         gfc_trans_constant_array_constructor, gfc_trans_array_constructor,
650         gfc_add_loop_ss_code, gfc_conv_ss_descriptor,
651         gfc_trans_array_bound_check, gfc_conv_array_index_offset,
652         gfc_conv_scalarized_array_ref, gfc_conv_ss_startstride,
653         gfc_could_be_alias, gfc_conv_resolve_dependencies,
654         gfc_conv_loop_setup, gfc_conv_expr_descriptor,
655         gfc_alloc_allocatable_for_assignment): Update references to expr and
656         factor common reference chains where possible.
657         * trans-const.c (gfc_conv_constant): Ditto.
658         * trans-expr.c (gfc_conv_variable, gfc_conv_procedure_call,
659         gfc_conv_array_constructor_expr, gfc_conv_expr,
660         gfc_conv_expr_reference): Ditto.
661         * trans-intrinsic.c (trans_this_image, gfc_conv_intrinsic_bound,
662         gfc_conv_intrinsic_cobound, gfc_conv_intrinsic_funcall,
663         gfc_add_intrinsic_ss_code): Ditto.
664         * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
665
666 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
667
668         * trans.h (struct gfc_ss_info): New struct.
669         (gfc_get_ss_info): New macro.
670         (struct gfc_ss): Move type field to struct gfc_ss_info.
671         Add an info field of type gfc_ss_info.
672         * trans-array.c (free_ss_info): New function.
673         (gfc_free_ss): Call free_ss_info.
674         (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss):
675         Allocate gfc_ss_info field.
676         (gfc_get_array_ss, gfc_get_temp_ss, gfc_get_scalar_ss,
677         gfc_set_vector_loop_bounds, gfc_add_loop_ss_code,
678         gfc_conv_array_index_offset, gfc_trans_preloop_setup,
679         gfc_trans_scalarized_loop_boundary, gfc_conv_section_startstride,
680         gfc_conv_ss_startstride, gfc_conv_resolve_dependencies,
681         gfc_conv_loop_setup, transposed_dims, gfc_conv_expr_descriptor,
682         gfc_walk_elemental_function_args): Update references to type.
683         * trans-const.c (gfc_conv_constant): Factor common reference chains
684         and update reference to type.
685         * trans-expr.c (gfc_conv_procedure_call, gfc_trans_assignment_1):
686         Update reference to type.
687         (gfc_conv_array_constructor_expr, gfc_conv_expr,
688         gfc_conv_expr_reference): Ditto. Factor common reference chains.
689         * trans-intrinsic.c (walk_inline_intrinsic_transpose): Update references
690         to type
691         * trans-stmt.c (gfc_trans_where_assign): Ditto.
692
693 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
694
695         * trans.h (struct gfc_ss, struct gfc_array_info): Move shape field
696         from the former struct to the latter.
697         * trans-array.c (gfc_conv_ss_startstride, gfc_conv_loop_setup):
698         Update field references.
699         * trans-expr.c (gfc_trans_subarray_assign): Update field references
700         and factor common reference chains.
701         * trans-io.c (transfer_array_component): Ditto.
702
703 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
704
705         * trans.h (struct gfc_array_info): Move dim and dimen fields...
706         (struct gfc_ss): ... here.  Remove gfc_ss::data::temp::dimen field.
707         * trans-array.c (gfc_conv_loop_setup): Remove temp_ss dim array
708         initialization.
709         (gfc_get_temp_ss): Initialize dim and dimen.
710         (gfc_free_ss, gfc_get_array_ss, gfc_get_temp_ss,
711         gfc_set_loop_bounds_from_array_spec, get_array_ref_dim,
712         gfc_trans_create_temp_array, gfc_trans_constant_array_constructor,
713         gfc_set_vector_loop_bounds, gfc_conv_scalarized_array_ref,
714         gfc_trans_preloop_setup, gfc_conv_ss_startstride,
715         gfc_conv_resolve_dependencies, gfc_conv_loop_setup, transposed_dims,
716         gfc_conv_expr_descriptor, gfc_alloc_allocatable_for_assignment,
717         gfc_walk_array_ref): Update field references.
718         * trans-expr.c (gfc_conv_subref_array_arg, gfc_conv_procedure_call):
719         Ditto.
720         * trans-intrinsic.c (walk_inline_intrinsic_transpose): Ditto.
721         * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
722
723 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
724
725         * trans.h (struct gfc_ss_info, struct gfc_array_info):
726         Rename the former to the latter.
727         * trans-array.c (gfc_get_array_ss, gfc_trans_allocate_array_storage,
728         get_array_ref_dim, gfc_trans_create_temp_array,
729         gfc_trans_constant_array_constructor, gfc_set_vector_loop_bounds,
730         gfc_conv_array_index_offset, gfc_conv_scalarized_array_ref,
731         add_array_offset, gfc_trans_preloop_setup, gfc_conv_section_startstride,
732         gfc_conv_ss_startstride, gfc_conv_loop_setup, transposed_dims,
733         gfc_conv_expr_descriptor): Update all uses.
734         * trans-expr.c (gfc_conv_subref_array_arg, gfc_conv_procedure_call):
735         Ditto.
736         * trans-intrinsic.c (gfc_conv_intrinsic_transfer,
737         walk_inline_intrinsic_transpose): Ditto.
738         * trans-stmt.c (gfc_conv_elemental_dependencies,
739         gfc_trans_pointer_assign_need_temp): Ditto.
740
741 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
742
743         * trans-array.c (dim_ok, transposed_dims): Rename the former to the
744         latter.  Change argument type.  Invert return value.
745         (gfc_conv_expr_descriptor): Update calls.
746
747 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
748
749         * trans-array.c (get_array_ref_dim): Change argument type and name.
750         Obtain previous argument from the new argument in the body.
751         (gfc_trans_create_temp_arry, gfc_conv_loop_setup): Update calls.
752
753 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
754
755         * trans-array.c (gfc_set_vector_loop_bounds, set_vector_loop_bounds):
756         Rename the former to the latter.  Change type and name of argument.
757         Get previous argument from the new one.
758         (gfc_add_loop_ss_code): Update call.
759
760 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
761
762         * trans-array.h (gfc_trans_create_temp_array): Replace info argument
763         with ss argument.
764         * trans-array.c (gfc_trans_create_temp_array): Ditto. Get info from ss.
765         (gfc_trans_array_constructor, gfc_conv_loop_setup): Update call to
766         gfc_trans_create_temp_array.
767         * trans-expr.c (gfc_conv_procedure_call): Ditto.
768         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ditto.
769         * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
770
771 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
772
773         * trans-array.c (gfc_trans_array_bound_check): Use ss argument
774         to get name.
775
776 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
777
778         * trans-array.c (gfc_trans_array_bound_check,
779         trans_array_bound_check): Rename the former to the latter.
780         Replace descriptor argument with ss argument.  Get descriptor from ss.
781         (gfc_conv_array_index_offset, conv_array_index_offset): Rename the
782         former to the latter.  Update call to trans_array_bound_check.
783         Replace info argument with ss argument.  Get info from ss.
784         (gfc_conv_scalarized_array_ref): Update call to conv_array_index_offset.
785         (add_array_offset): Ditto
786
787 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
788
789         * trans-array.c (gfc_trans_constant_array_constructor,
790         trans_constant_array_constructor): Rename the former to the latter.
791         Don't set the rank of the temporary for the loop.  Remove then unused
792         loop argument.
793         (gfc_trans_array_constructor): Update call.
794
795 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
796
797         * trans-array.c (gfc_trans_scalarizing_loops): Stop loop before end
798         marker, not after it.
799
800 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
801
802         * trans-array.c (gfc_conv_loop_setup): Also skip temporary arrays.
803
804 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
805
806         * trans-array.c (gfc_conv_ss_startstride): Access array bounds along
807         array dimensions instead of loop dimensions.
808
809 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
810
811         * trans-array.c (gfc_trans_preloop_setup): Assertify one condition.
812
813 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
814
815         * trans-array.c (gfc_walk_array_ref): Skip coarray dimensions.
816
817 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
818
819         * trans-array.c (get_array_ref_dim): Remove redundant condition.
820
821 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
822
823         * trans-array.c (gfc_trans_preloop_setup): Move common code...
824         (add_array_offset): ...into that new function.
825
826 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
827
828         * trans-array.c (gfc_trans_preloop_setup): Use loop's dimension instead
829         of array's dimention. Check that it is indeed the same.
830
831 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
832
833         * trans-array.c (gfc_trans_preloop_setup): Remove redundant assertion.
834         Special case outermost loop.
835
836 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
837
838         * trans-array.c (gfc_trans_preloop_setup): Factor loop index
839         initialization.
840
841 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
842
843         * trans-array.c (gfc_trans_preloop_setup): Move code earlier.
844
845 2011-11-03  Mikael Morin  <mikael@gcc.gnu.org>
846
847         * trans-array.c (gfc_trans_preloop_setup): Move array reference
848         initialisation earlier. Factor subsequent array references.
849
850 2011-11-02  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
851
852         * Makef-lang.in (gfortranspec.o): Pass SHLIB instead of SHLIB_LINK.
853
854 2011-10-30  Steven G. Kargl  <kargl@gcc.gnu.org>
855
856         PR fortran/50573
857         * check.c (gfc_check_dshift): Update argument checking for BOZ.
858         Update checking SHIFT against BITSIZE of I or J.
859         * intrinsic.texi: Update docs for DSHIFTL and DSHIFTR.
860
861 2011-10-28  Steven G. Kargl  <kargl@gcc.gnu.org>
862
863         * check.c (gfc_check_atan_2): Typo in comment.
864         (gfc_check_nearest): If 's' is constant, check that it is not 0.
865         * simplify.c (simplify_dshift, gfc_simplify_ibclr, gfc_simplify_ibits,
866         gfc_simplify_ibset, simplify_shift, gfc_simplify_ishftc,
867         gfc_simplify_nearest): Remove dead code.
868
869 2011-10-23  Steven G. Kargl  <kargl@gcc.gnu.org>
870
871         * simplify.c (simplify_transformation_to_array): Fix memory leak.
872
873 2011-10-20  Steven G. Kargl  <kargl@gcc.gnu.org>
874
875         PR fortran/50821
876         * check.c (gfc_check_ishftc): Check args are constant before 
877         extracting the integer.
878
879 2011-10-20  Steven G. Kargl  <kargl@gcc.gnu.org>
880
881         PR fortran/50514
882         * check.c (less_than_bitsize1): Check |shift| <= bit_size(i).
883         (gfc_check_ishftc):  Check |shift| <= bit_size(i) and check
884         that size is positive.
885
886 2011-10-20  Steven G. Kargl  <kargl@gcc.gnu.org>
887
888         PR fortran/50524
889         * resolve.c (resolve_ref): Check return value of resolve_substring().
890
891 2011-10-20  Steven G. Kargl  <kargl@gcc.gnu.org>
892
893         * io.c (match_dt_format): Match a user-defined operator or a kind
894         type prefixed string.
895
896 2011-10-19  Janus Weil  <janus@gcc.gnu.org>
897
898         PR fortran/47023
899         * check.c (gfc_check_sizeof): Reject procedures as argument of SIZEOF.
900         * intrinsinc.texi (SIZEOF): Document it.
901         (STORAGE_SIZE): Fix special characters. Fix line breaks.
902
903 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
904
905         PR fortran/50420
906         * trans.c (gfc_build_array_ref): If type is not an array, check that
907         there is nothing to do, and do nothing.
908
909 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
910
911         PR fortran/50420
912         * trans-types.c (gfc_build_array_type): Don't force lower bound to one
913         in the deferred case.
914
915 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
916
917         PR fortran/50420
918         * simplify.c (simplify_cobound): Accept non-last-in-ref-chain coarrays.
919         Don't set already set array ref.
920
921 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
922
923         * array.c (gfc_find_array_ref): Remove coarray-specific handling.
924
925 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
926
927         PR fortran/50420
928         * check.c (dim_corank_check): Use gfc_get_corank to get corank.
929
930 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
931
932         PR fortran/50420
933         * trans-intrinsic.c (walk_coarray): Change AR_ELEMENT to AR_SECTION.
934
935         PR fortran/50420
936         * trans-intrinsic.c (walk_coarray): Use gfc_walk_array_ref for
937         the scalarization chain initialization. 
938
939 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
940
941         PR fortran/50420
942         * trans-intrinsic.c (walk_coarray): Allow subreferences after a
943         coarray object reference.
944
945 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
946
947         PR fortran/50420
948         * trans-array.c (gfc_walk_array_ref): Allow zero rank arrays
949         if they are coarrays.
950
951 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
952
953         * trans-array.h (gfc_walk_array_ref): New prototype.
954         * trans-array.c (gfc_walk_array_ref): New function, containing
955         all but the beginning of gfc_walk_variable_expr's code.
956         (gfc_walk_variable_expr): Use gfc_walk_array_ref.
957
958 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
959
960         PR fortran/50420
961         * trans-array.c (gfc_conv_expr_descriptor): Use loop.dimen instead of
962         ndim for the descriptor's rank.
963
964 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
965
966         PR fortran/50420
967         * trans-array.c (gfc_conv_expr_descriptor): Count codimensions starting
968         from zero, and add then the relevant offset (either ndim or loop.dimen)
969         depending on context.
970
971 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
972
973         * trans-array.c (gfc_conv_expr_descriptor): Save some horizontal space.
974
975 2011-10-18  Mikael Morin  <mikael@gcc.gnu.org>
976
977         * trans-array.c (gfc_conv_expr_descriptor): Move ndim initialization
978         earlier.
979
980 2011-10-18  Janus Weil  <janus@gcc.gnu.org>
981
982         PR fortran/47023
983         * decl.c (verify_c_interop_param): Renamed to
984         'gfc_verify_c_interop_param'. Add error message for polymorphic
985         arguments.
986         (verify_c_interop): Renamed to 'gfc_verify_c_interop'. Reject
987         polymorphic variables.
988         (verify_bind_c_sym): Renamed 'verify_c_interop'.
989         * gfortran.h (verify_c_interop,verify_c_interop_param): Renamed.
990         * check.c (gfc_check_sizeof): Ditto.
991         * resolve.c (gfc_iso_c_func_interface,resolve_fl_procedure): Ditto.
992         * symbol.c (verify_bind_c_derived_type): Ditto.
993
994 2011-10-15  Tom Tromey  <tromey@redhat.com>
995             Dodji Seketeli  <dodji@redhat.com>
996
997         * cpp.c (print_line, cb_define): Adjust to avoid using internals
998         of struct line_map.  Use the public API instead.
999
1000 2011-10-17  Janus Weil  <janus@gcc.gnu.org>
1001
1002         PR fortran/47023
1003         PR fortran/50752
1004         * primary.c (match_kind_param): Avoid segfault.
1005
1006 2011-10-16  Thomas Koenig  <tkoenig@gcc.gnu.org>
1007
1008         * frontend-passes.c (current_ns):  Make static.
1009         (create_var):  Note parent of newly created namespace.
1010         (optimize_namespace):  Don't wak sibling namespaces
1011         if they are EXEC_BLOCK because this is handled...
1012         (gfc_code_walker):  ... here.  Also walk ASSOCIATE lists.
1013
1014 2011-10-16  Janus Weil  <janus@gcc.gnu.org>
1015
1016         PR fortran/47023
1017         * primary.c (match_kind_param): Detect ISO_C_BINDING kinds.
1018         (get_kind): Pass on 'is_iso_c' flag.
1019         (match_integer_constant,match_real_constant,match_logical_constant):
1020         Set 'ts.is_c_interop'.
1021
1022 2011-10-16  Janus Weil  <janus@gcc.gnu.org>
1023
1024         PR fortran/50547
1025         * resolve.c (resolve_formal_arglist): Remove unneeded error message.
1026         Some reshuffling.
1027
1028 2011-10-15  Tobias Burnus  <burnus@net-b.de>
1029
1030         * gfortran.texi (Fortran 2008 status, TS 29113 status,
1031         Further Interoperability of Fortran with C): Update implementation
1032         status, change references from TR 29113 to TS 29113.
1033         * intrinsic.texi (RANK): Change TR 29113 to TS 29113.
1034         * invoke.text (-std=): Ditto, change -std=f2008tr to -std=f2008ts.
1035         * lang.opt (std=): Ditto.
1036         * options.c (gfc_handle_option, set_default_std_flags): Ditto and
1037         change GFC_STD_F2008_TR to GFC_STD_F2008_TS.
1038         * libgfortran.h: Ditto.
1039         * intrinsic.c (add_functions, gfc_check_intrinsic_standard): Ditto.
1040         * decl.c (verify_c_interop_param): Ditto.
1041
1042 2011-10-14  Janus Weil  <janus@gcc.gnu.org>
1043
1044         PR fortran/50570
1045         * expr.c (gfc_check_vardef_context): Don't throw an error on
1046         non-pointer assignments involving an intent(in) pointer dummy.
1047
1048 2011-10-14  Tobias Burnus  <burnus@net-b.de>
1049
1050         PR fortran/50718
1051         * trans-expr.c (gfc_conv_procedure_call): Fix -fcheck=pointer
1052         for dummy arguments with VALUE attribute.
1053
1054 2011-10-11  Tobias Burnus  <burnus@net-b.de>
1055             Janus Weil  <janus@gcc.gnu.org>
1056
1057         * invoke.texi (-fwhole-file): Update wording since -fwhole-file
1058         is now enabled by default.
1059
1060 2011-10-11  Michael Meissner  <meissner@linux.vnet.ibm.com>
1061
1062         * trans-expr.c (gfc_conv_power_op): Delete old interface with two
1063         parallel arrays to hold standard builtin declarations, and replace
1064         it with a function based interface that can support creating
1065         builtins on the fly in the future.  Change all uses, and poison
1066         the old names.  Make sure 0 is not a legitimate builtin index.
1067         (fill_with_spaces): Ditto.
1068         (gfc_trans_string_copy): Ditto.
1069         (gfc_trans_zero_assign): Ditto.
1070         (gfc_build_memcpy_call): Ditto.
1071         (alloc_scalar_allocatable_for_assignment): Ditto.
1072         * trans-array.c (gfc_trans_array_constructor_value): Ditto.
1073         (duplicate_allocatable): Ditto.
1074         (gfc_alloc_allocatable_for_assignment): Ditto.
1075         * trans-openmp.c (gfc_omp_clause_copy_ctor): Ditto.
1076         (gfc_omp_clause_assign_op): Ditto.
1077         (gfc_trans_omp_atomic): Ditto.
1078         (gfc_trans_omp_do): Ditto.
1079         (gfc_trans_omp_task): Ditto.
1080         * trans-stmt.c (gfc_trans_stop): Ditto.
1081         (gfc_trans_sync): Ditto.
1082         (gfc_trans_allocate): Ditto.
1083         (gfc_trans_deallocate): Ditto.
1084         * trans.c (gfc_call_malloc): Ditto.
1085         (gfc_allocate_using_malloc): Ditto.
1086         (gfc_call_free): Ditto.
1087         (gfc_deallocate_with_status): Ditto.
1088         (gfc_deallocate_scalar_with_status): Ditto.
1089         * f95-lang.c (gfc_define_builtin): Ditto.
1090         (gfc_init_builtin_functions): Ditto.
1091         * trans-decl.c (create_main_function): Ditto.
1092         * trans-intrinsic.c (builtin_decl_for_precision): Ditto.
1093
1094 2011-10-10  Thomas Koenig  <tkoenig@gcc.gnu.org>
1095
1096         PR fortran/50564
1097         * frontend-passes (forall_level):  New variable.
1098         (cfe_register_funcs):  Don't register functions if we
1099         are within a forall loop.
1100         (optimize_namespace):  Set forall_level to 0 before entry.
1101         (gfc_code_walker):  Increase/decrease forall_level.
1102
1103 2011-10-09  Tobias Burnus  <burnus@net-b.de>
1104
1105         PR fortran/50273
1106         * trans-common.c (translate_common): Fix -Walign-commons check.
1107
1108 2011-10-09  Mikael Morin  <mikael.morin@sfr.fr>
1109
1110         * interface.c (check_dummy_characteristics): Count dimensions starting
1111         from one in diagnostic.
1112
1113 2011-10-09  Tobias Burnus  <burnus@net-b.de>
1114
1115         * Make-lang.in (F95_PARSER_OBJS, GFORTRAN_TRANS_DEPS): Add
1116         dependency on iso-c-binding.def and iso-fortran-env.def.
1117         * module.c (import_iso_c_binding_module): Add error when
1118         explicitly importing a nonstandard symbol; extend standard-
1119         depending loading.
1120         * iso-c-binding.def: Add c_float128 and c_float128_complex
1121         integer parameters (for -std=gnu).
1122         * intrinsic.texi (ISO_C_Binding): Document them.
1123         * symbol.c (generate_isocbinding_symbol): Change macros
1124         to ignore GFC_STD_* data.
1125         * trans-types.c (gfc_init_c_interop_kinds): Ditto; make
1126         nonstatic and renamed from "init_c_interop_kinds".
1127         (gfc_init_kinds): Don't call it
1128         * trans-types.h (gfc_init_c_interop_kinds): Add prototype.
1129         * f95-lang.c (gfc_init_decl_processing): Call it.
1130
1131 2011-10-09  Janus Weil  <janus@gcc.gnu.org>
1132
1133         PR fortran/50659
1134         * expr.c (replace_symbol): Only do replacement if the symbol is a dummy.
1135
1136 2011-10-08  Paul Thomas  <pault@gcc.gnu.org>
1137
1138         PR fortran/47844
1139         * trans-array.c (gfc_conv_array_index_offset): Use descriptor
1140         stride for pointer function results.
1141
1142 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1143
1144         * trans-array.c (gfc_conv_expr_descriptor): Remove trailing whitespace.
1145
1146 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1147
1148         * trans-array.c (gfc_conv_ss_startstride): Merge two switch cases.
1149
1150 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1151
1152         * trans-array.c (gfc_conv_section_startstride): Remove coarray argument.
1153         Remove conditions on coarray.
1154         (gfc_conv_ss_startstride): Update call to gfc_conv_section_startstride.
1155         (gfc_conv_expr_descriptor): Ditto. Add assertions before the call.
1156
1157 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1158
1159         * trans-array.c (gfc_conv_section_startstride): Remove coarray_last
1160         argument. Remove condition on coarray_last.
1161         (gfc_conv_ss_startstride): Update call to gfc_conv_section_startstride.
1162         (gfc_conv_expr_descriptor): Ditto.
1163
1164 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1165
1166         * trans-array.c (gfc_walk_variable_expr): Remove scalar coarray
1167         handling.  Don't reset array ref's corank and codimensions' types
1168         in the full array ref case.  Update loop upper limit.
1169         Remove DIMEN_THIS_IMAGE case.  Remove unnecessary conditions.
1170
1171 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1172
1173         * trans.h (gfc_ss_info): Remove codimen field.
1174         * trans-array.c (gfc_get_array_ss): Don't set codimen field.
1175         (gfc_trans_create_temp_array): Don't set descriptor's cobounds.
1176         (gfc_trans_constant_array_constructor): Update loop upper limit.
1177         (gfc_conv_ss_startstride): Don't set codimen field.
1178         Don't get descriptor's cobounds.
1179         (gfc_walk_variable_expr): Update dimension index.
1180         * trans-intrinsic.c (trans_this_image, trans_image_index,
1181         conv_intrinsic_cobound): Don't set codimen field
1182
1183 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1184
1185         * trans.h (gfc_loopinfo): Remove codimen field.
1186         * trans-array.c (gfc_set_vector_loop_bounds,
1187         gfc_trans_scalarizing_loops, gfc_conv_loop_setup): Update loop upper
1188         limit.
1189         (gfc_set_loop_bounds_from_array_spec): Ditto. Remove skip on last
1190         codimension.
1191         (gfc_start_scalarized_body): Update loop lower limit.
1192         (gfc_conv_ss_startstride): Don't set loop's codimen field.
1193         (gfc_conv_loop_setup): Remove unnecessary condition.
1194         (gfc_conv_expr_descriptor): Don't use loop's codimen field as corank.
1195
1196 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1197
1198         * trans.h (gfc_ss): Remove data.temp.codimen field.
1199         * trans-array.c (gfc_conv_resolve_dependencies,
1200         gfc_conv_expr_descriptor): Don't set temp's codimen field.
1201
1202 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1203
1204         * resolve.c (resolve_array_ref): Set array_ref's dimen field (and the
1205         associated dimen_type) in the full array ref case.
1206
1207 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1208
1209         * trans-intrinsic.c (walk_coarray): New function.
1210         (convert_element_to_coarray_ref): Move code to walk_coarray. Remove.
1211         (trans-this_image, trans_image_index, conv_intrinsic_cobound):
1212         Use walk_coarray.
1213
1214 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1215
1216         * trans-array.c (gfc_conv_expr_descriptor): Add out-of-the-scalarizer
1217         cobounds evaluation.
1218
1219 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1220
1221         * trans-array.c (gfc_conv_ss_startstride): Support zero rank loop.
1222
1223 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1224
1225         * trans-array.c (gfc_conv_section_startstride): Move code to
1226         evaluate_bound.  Use evaluate_bound.
1227         (evaluate_bound): New function.
1228
1229 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1230
1231         * trans-array.c (gfc_conv_section_startstride): Update assertion to
1232         also accept coarrays.
1233
1234 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1235
1236         * trans-array.c (gfc_conv_section_startstride): Factor common
1237         array ref references.
1238
1239 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1240
1241         * trans-array.c (gfc_conv_expr_descriptor): Use codim instead of
1242         loop.codimen as argument to gfc_get_array_type_bounds.
1243
1244 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1245
1246         * trans-array.h (struct gfc_se): New flag want_coarray.
1247         * trans-intrinsic.c (trans_this_image, trans_image_index,
1248         conv_intrinsic_cobound): Set want_coarray.
1249         * trans_array.c (gfc_conv_expr_descriptor): Evaluate codimension
1250         earlier and without relying on the scalarizer.
1251
1252 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1253
1254         * expr.c (gfc_get_corank): Return 0 if input expression is not a
1255         coarray.
1256
1257 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1258
1259         * trans-array.c (gfc_conv_expr_descriptor): Simplify coarray
1260         descriptor setup code.
1261
1262 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1263
1264         * resolve.c (compare_spec_to_ref): Move coarray ref initialization
1265         code...
1266         (resolve_array_ref): ... here.
1267
1268 2011-10-07  Mikael Morin  <mikael.morin@sfr.fr>
1269
1270         * check.c (is_coarray): Remove.
1271         (coarray_check): Use gfc_is_coarray.
1272
1273 2011-10-07  Janus Weil  <janus@gcc.gnu.org>
1274
1275         PR fortran/50625
1276         * class.c (gfc_build_class_symbol): Fix whitespace.
1277         * module.c (mio_symbol): Set 'class_ok' attribute.
1278         * trans-decl.c (gfc_get_symbol_decl): Make sure the backend_decl has
1279         been built for class symbols.
1280
1281 2011-10-04  Janus Weil  <janus@gcc.gnu.org>
1282
1283         PR fortran/35831
1284         * interface.c (check_dummy_characteristics): Check the array shape.
1285
1286 2011-10-01  Janus Weil  <janus@gcc.gnu.org>
1287
1288         PR fortran/50585
1289         * interface.c (get_expr_storage_size): Check if 'length' component is
1290         associated.
1291
1292 2011-09-29  Janus Weil  <janus@gcc.gnu.org>
1293
1294         PR fortran/50547
1295         * resolve.c (resolve_formal_arglist): Fix pureness check for dummy
1296         functions.
1297
1298         PR fortran/50553
1299         * symbol.c (check_conflict): Forbid TARGET attribute for statement
1300         functions.
1301
1302 2011-09-27  Jakub Jelinek  <jakub@redhat.com>
1303
1304         * trans-types.c (gfc_type_for_size): Return wider type
1305         if no suitable narrower type has been found.
1306         (gfc_type_for_mode): Return NULL_TREE if gfc_type_for_size
1307         returned type doesn't have expected TYPE_MODE.
1308
1309 2011-09-26  Janus Weil  <janus@gcc.gnu.org>
1310
1311         PR fortran/50515
1312         * resolve.c (resolve_common_blocks): Check for EXTERNAL attribute.
1313
1314         PR fortran/50517
1315         * interface.c (gfc_compare_interfaces): Bugfix in check for result type.
1316
1317 2011-09-22  Janus Weil  <janus@gcc.gnu.org>
1318
1319         PR fortran/41733
1320         * expr.c (gfc_check_pointer_assign): Check for nonintrinsic elemental
1321         procedures.
1322         * interface.c (gfc_compare_interfaces): Rename 'intent_flag'. Check
1323         for PURE and ELEMENTAL attributes.
1324         (compare_actual_formal): Remove pureness check here.
1325
1326 2011-09-20  Steven G. Kargl  <kargl@gcc.gnu.org>
1327
1328         * check.c (gfc_check_c_sizeof): Remove redundant word.
1329
1330 2011-09-20  Simon Baldwin  <simonb@google.com>
1331
1332         * module.c (gfc_dump_module): Omit timestamp from output.
1333
1334 2011-09-17  Janus Weil  <janus@gcc.gnu.org>
1335
1336         PR fortran/50403
1337         * symbol.c (gfc_use_derived): Fix coding style.
1338
1339 2011-09-15  Janus Weil  <janus@gcc.gnu.org>
1340
1341         PR fortran/50401
1342         * resolve.c (resolve_transfer): Check if component 'ref' is defined.
1343
1344         PR fortran/50403
1345         * symbol.c (gfc_use_derived): Check if argument 'sym' is defined.
1346
1347 2011-09-14  Tobias Burnus  <burnus@net-b.de>
1348
1349         PR fortran/34547
1350         PR fortran/50375
1351         * check.c (gfc_check_null): Allow allocatables as MOLD to NULL.
1352         * resolve.c (resolve_transfer): Reject NULL without MOLD.
1353         * interface.c (gfc_procedure_use): Reject NULL without MOLD
1354         if no explicit interface is known.
1355         (gfc_search_interface): Reject NULL without MOLD if it would
1356         lead to ambiguity.
1357
1358 2011-09-13  Janus Weil  <janus@gcc.gnu.org>
1359
1360         PR fortran/50379
1361         * symbol.c (check_conflict): Check conflict between GENERIC and RESULT
1362         attributes.
1363
1364 2011-09-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
1365
1366         PR fortran/50327
1367         * frontend-passes.c (dummy_expr_callback):  New function.
1368         (convert_do_while):  New function.
1369         (optimize_namespace):  Call code walker to convert do while loops.
1370
1371 2011-09-11  Janus Weil  <janus@gcc.gnu.org>
1372
1373         PR fortran/35831
1374         PR fortran/47978
1375         * interface.c (check_dummy_characteristics): New function to check the
1376         characteristics of dummy arguments.
1377         (gfc_compare_interfaces,gfc_check_typebound_override): Call it here.
1378
1379 2011-09-08  Mikael Morin  <mikael.morin@sfr.fr>
1380
1381         * trans-array.c (gfc_trans_constant_array_constructor): Remove
1382         superfluous initialisation of DIM field.
1383         (gfc_trans_array_constructor): Assert that DIMEN field is properly set.
1384         (gfc_conv_expr_descriptor): Ditto.
1385         * trans-expr.c (gfc_conv_procedure_call): Ditto.
1386
1387 2011-09-08  Mikael Morin  <mikael.morin@sfr.fr>
1388
1389         * trans-array.h (gfc_get_scalar_ss): New prototype.
1390         * trans-array.c (gfc_get_scalar_ss): New function.
1391         (gfc_walk_variable_expr, gfc_walk_op_expr,
1392         gfc_walk_elemental_function_args): Re-use gfc_get_scalar_ss.
1393         * trans-expr.c (gfc_trans_subarray_assign): Ditto.
1394         (gfc_trans_assignment_1): Ditto.
1395         * trans-stmt.c (compute_inner_temp_size, gfc_trans_where_assign,
1396         gfc_trans_where_3): Ditto.
1397
1398 2011-09-08  Mikael Morin  <mikael.morin@sfr.fr>
1399
1400         * trans-array.h (gfc_get_temp_ss): New prototype.
1401         * trans-array.c (gfc_get_temp_ss): New function.
1402         (gfc_conv_resolve_dependencies): Re-use gfc_get_temp_ss.
1403         (gfc_conv_expr_descriptor): Ditto.
1404         * trans-expr.c (gfc_conv_subref_array_arg): Ditto.
1405
1406 2011-09-08  Mikael Morin  <mikael.morin@sfr.fr>
1407
1408         * trans-array.h (gfc_get_array_ss): New prototype.
1409         * trans-array.c (gfc_get_array_ss): New function.
1410         (gfc_walk_variable_expr, gfc_walk_function_expr,
1411         gfc_walk_array_constructor): Re-use gfc_get_array_ss.
1412         * trans-expr.c (gfc_trans_subarray_assign): Ditto.
1413         * trans-intrinsic.c (gfc_walk_intrinsic_bound,
1414         gfc_walk_intrinsic_libfunc): Ditto.
1415         * trans-io.c (transfer_array_component): Ditto.
1416
1417 2011-09-08  Tobias Burnus  <burnus@net-b.de>
1418
1419         PR fortran/44646
1420         * decl.c (gfc_match_entry, gfc_match_end): Handle COMP_DO_CONCURRENT.
1421         * dump-parse-tree.c (show_code_node): Handle EXEC_DO_CONCURRENT.
1422         * gfortran.h (gfc_exec_op): Add EXEC_DO_CONCURRENT.
1423         * match.c (gfc_match_critical, match_exit_cycle, gfc_match_stopcode,
1424         lock_unlock_statement, sync_statement, gfc_match_allocate,
1425         gfc_match_deallocate, gfc_match_return): Add DO CONCURRENT diagnostic.
1426         (gfc_match_do): Match DO CONCURRENT.
1427         (match_derived_type_spec, match_type_spec, gfc_free_forall_iterator,
1428         match_forall_iterator, match_forall_header, match_simple_forall,
1429         gfc_match_forall): Move up in the file.
1430         * parse.c (check_do_closure, parse_do_block): Handle do concurrent.
1431         * parse.h (gfc_compile_state): Add COMP_DO_CONCURRENT.
1432         * resolve.c (do_concurrent_flag): New global variable.
1433         (resolve_function, pure_subroutine, resolve_branch,
1434         gfc_resolve_blocks, resolve_code, resolve_types): Add do concurrent
1435         diagnostic.
1436         * st.c (gfc_free_statement): Handle EXEC_DO_CONCURRENT.
1437         * trans-stmt.c (gfc_trans_do_concurrent): New function.
1438         (gfc_trans_forall_1): Handle do concurrent.
1439         * trans-stmt.h (gfc_trans_do_concurrent): New function prototype.
1440         * trans.c (trans_code): Call it.
1441         * frontend-passes.c (gfc_code_walker): Handle EXEC_DO_CONCURRENT.
1442
1443 2011-09-07  Janus Weil  <janus@gcc.gnu.org>
1444
1445         PR fortran/48095
1446         * primary.c (gfc_match_structure_constructor): Handle parsing of
1447         procedure pointers components in structure constructors.
1448         * resolve.c (resolve_structure_cons): Check interface of procedure
1449         pointer components. Changed wording of some error messages.
1450
1451 2011-09-04  Janus Weil  <janus@gcc.gnu.org>
1452
1453         PR fortran/50227
1454         * trans-types.c (gfc_sym_type): Check for proc_name.
1455
1456 2011-08-30  Tobias Burnus  <burnus@net-b.de>
1457
1458         PR fortran/45044
1459         * trans-common.c (build_common_decl): Warn if named common
1460         block's size is not everywhere the same.
1461
1462 2011-08-30  Steven G. Kargl  <kargl@gcc.gnu.org>
1463
1464         PR fortran/45170
1465         * trans-stmt.c (gfc_trans_allocate): Evaluate the substring.
1466
1467 2011-08-29  Janus Weil  <janus@gcc.gnu.org>
1468
1469         PR fortran/50225
1470         * trans-decl.c (gfc_generate_function_code): Nullify polymorphic
1471         allocatable function results.
1472
1473 2011-08-29  Tobias Burnus  <burnus@net-b.de>
1474
1475         * trans-decl.c (generate_coarray_sym_init): Use
1476         GFC_CAF_COARRAY_STATIC for static coarrays.
1477
1478 2011-08-28  Dodji Seketeli  <dodji@redhat.com>
1479
1480         * scanner.c (load_file): Don't abuse LC_RENAME reason while
1481         (indirectly) calling linemap_add.
1482
1483 2011-08-26  Jakub Jelinek  <jakub@redhat.com>
1484
1485         * trans-decl.c (get_proc_pointer_decl): Set DECL_TLS_MODEL
1486         if threadprivate.
1487         * symbol.c (check_conflict): Allow threadprivate attribute with
1488         FL_PROCEDURE if proc_pointer.
1489
1490 2011-08-25  Mikael Morin  <mikael@gcc.gnu.org>
1491
1492         PR fortran/50050
1493         * expr.c (gfc_free_shape): Do nothing if shape is NULL.
1494         (free_expr0): Remove redundant NULL shape check.
1495         * resolve.c (check_host_association): Ditto.
1496         * trans-expr.c (gfc_trans_subarray_assign): Assert that shape is
1497         non-NULL.
1498         * trans-io.c (transfer_array_component): Ditto.
1499
1500 2011-08-25  Tobias Burnus  <burnus@net-b.de>
1501
1502         * trans-array.c (gfc_conv_descriptor_token): Add assert.
1503         * trans-decl.c (gfc_build_qualified_array,
1504         create_function_arglist): Handle assumed-shape arrays.
1505         * trans-expr.c (gfc_conv_procedure_call): Ditto.
1506         * trans-types.c (gfc_get_array_descriptor_base): Ditto, don't
1507         add "caf_token" to assumed-shape descriptors, new akind argument.
1508         (gfc_get_array_type_bounds): Pass akind.
1509         * trans.h (lang_decl): New elements caf_offset and token.
1510         (GFC_DECL_TOKEN, GFC_DECL_CAF_OFFSET): New macros.
1511
1512 2011-08-25  Tobias Burnus  <burnus@net-b.de>
1513
1514         * trans-array.c (structure_alloc_comps): Fix for allocatable
1515         scalar coarray components.
1516         * trans-expr.c (gfc_conv_component_ref): Ditto.
1517         * trans-type.c (gfc_get_derived_type): Ditto.
1518
1519 2011-08-24  Tobias Burnus  <burnus@net-b.de>
1520
1521         PR fortran/50163
1522         * expr.c (check_init_expr): Return when an error occured.
1523
1524 2011-08-24  Joseph Myers  <joseph@codesourcery.com>
1525
1526         * Make-lang.in (fortran/cpp.o): Remove explicit compilation rule.
1527
1528 2011-08-23  Tobias Burnus  <burnus@net-b.de>
1529
1530         PR fortran/31600
1531         * symbol.c (gfc_add_type): Better diagnostic if redefining
1532         use-associated symbol.
1533         * module.c (gfc_use_module): Use module name as locus.
1534
1535 2011-08-22  Gabriel Charette  <gchare@google.com>
1536
1537         * cpp.c (gfc_cpp_init): Force BUILTINS_LOCATION for tokens
1538         defined in cpp_define_builtins.
1539
1540 2011-08-22  Mikael Morin  <mikael@gcc.gnu.org>
1541
1542         PR fortran/50050
1543         * gfortran.h (gfc_clear_shape, gfc_free_shape): New prototypes.
1544         * expr.c (gfc_clear_shape, gfc_free_shape): New functions.
1545         (free_expr0): Re-use gfc_free_shape.
1546         * trans-expr.c (gfc_trans_subarray_assign): Ditto.
1547         * trans-io.c (transfer_array_component): Ditto.
1548         * resolve.c (check_host_association): Ditto.
1549         (gfc_expr_to_initialize): Don't force the rank value and free the shape
1550         after updating the expression. Recalculate shape and rank.
1551         (resolve_where_shape): Re-use gfc_clear_shape.
1552         * array.c (gfc_array_ref_shape): Ditto.
1553
1554 2011-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
1555
1556         PR fortran/47659
1557         * expr.c (gfc_check_assign): Check for type conversions when the
1558         right-hand side is a constant REAL/COMPLEX contstant the left-hand
1559         side is also REAL/COMPLEX.  Don't warn when a narrowing conversion
1560         for REAL does not change the value of the constant.
1561
1562 2011-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
1563
1564         PR fortran/50130
1565         * resolve.c (resolve_array_ref):  Don't calculate upper bound
1566         if the stride is zero.
1567
1568 2011-08-20  Janus Weil  <janus@gcc.gnu.org>
1569
1570         PR fortran/49638
1571         * dependency.c (gfc_dep_compare_expr): Add new result value "-3".
1572         (gfc_check_element_vs_section,gfc_check_element_vs_element): Handle
1573         result value "-3".
1574         * frontend-passes.c (optimize_comparison): Ditto.
1575         * interface.c (gfc_check_typebound_override): Ditto.
1576
1577 2011-08-19  Mikael Morin  <mikael.morin@sfr.fr>
1578
1579         PR fortran/50129
1580         * parse.c (parse_where): Undo changes after emitting an error. 
1581
1582 2011-08-19  Jakub Jelinek  <jakub@redhat.com>
1583
1584         PR fortran/49792
1585         * trans-expr.c (gfc_trans_assignment_1): Set OMPWS_SCALARIZER_WS
1586         bit in ompws_flags only if loop.temp_ss is NULL, and clear it if
1587         lhs needs reallocation.
1588         * trans-openmp.c (gfc_trans_omp_workshare): Don't return early if
1589         code is NULL, emit a barrier if workshare emitted no code at all
1590         and NOWAIT clause isn't present.
1591
1592 2011-08-19  Mikael Morin  <mikael.morin@sfr.fr>
1593
1594         PR fortran/50071
1595         * gfortran.h (gfc_exec_op): New constant EXEC_END_NESTED_BLOCK.
1596         * parse.c (check_statement_label): Accept ST_END_BLOCK and
1597         ST_END_ASSOCIATE as valid branch target.
1598         (accept_statement): Change EXEC_END_BLOCK to EXEC_END_NESTED_BLOCK.
1599         Add EXEC_END_BLOCK code in the ST_END_BLOCK and ST_END_ASSOCIATE cases.
1600         * resolve.c (find_reachable_labels): Change EXEC_END_BLOCK to
1601         EXEC_END_NESTED_BLOCK.
1602         (resolve_branch): Ditto.
1603         (resolve_code): Add EXEC_END_NESTED_BLOCK case.
1604         * st.c (gfc_free_statement): Ditto.
1605         * trans.c (trans_code): Ditto.
1606
1607 2011-08-18  Mikael Morin  <mikael.morin@sfr.fr>
1608
1609         PR fortran/50071
1610         * symbol.c (gfc_get_st_label): Use the derived type namespace when
1611         we are parsing a derived type definition.
1612
1613 2011-08-18  Tobias Burnus  <burnus@net-b.de>
1614
1615         PR fortran/18918
1616         * parse.c (parse_derived): Add lock_type
1617         checks, improve coarray_comp handling.
1618         * resolve.c (resolve_allocate_expr,
1619         resolve_lock_unlock, resolve_symbol): Fix lock_type
1620         constraint checks.
1621
1622 2011-08-17  Tobias Burnus  <burnus@net-b.de>
1623
1624         PR fortran/31461
1625         * trans-decl.c (generate_local_decl): Warn about
1626         unused explicitly imported module variables/parameters.
1627
1628 2011-08-17  Janus Weil  <janus@gcc.gnu.org>
1629
1630         PR fortran/50070
1631         * resolve.c (resolve_fl_variable): Reject non-constant character lengths
1632         in COMMON variables.
1633
1634 2011-08-16  Tobias Burnus  <burnus@net-b.de>
1635             Dominique Dhumieres  <dominiq@lps.ens.fr>
1636
1637         PR fortran/50094
1638         * resolve.c (resolve_symbol): Fix stupid typo.
1639
1640 2011-08-15  Tobias Burnus  <burnus@net-b.de>
1641
1642         * resolve.c (resolve_symbol): Fix coarray result-var check.
1643
1644 2011-08-14  Steven G. Kargl  <kargl@gcc.gnu.org>
1645
1646         * module.c (use_iso_fortran_env_module):  Spell 'referrenced' correctly.
1647
1648 2011-08-14  Janus Weil  <janus@gcc.gnu.org>
1649
1650         PR fortran/50073
1651         * decl.c (check_function_name): New function, separated off from
1652         'variable_decl' and slightly extended.
1653         (variable_decl,attr_decl1): Call it.
1654
1655 2011-08-08  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
1656
1657         * Make-lang.in (gfortran$(exeext)): Add $(EXTRA_GCC_LIBS).
1658
1659 2011-08-07  Janus Weil  <janus@gcc.gnu.org>
1660             Thomas Koenig  <tkoenig@gcc.gnu.org>
1661
1662         PR fortran/49638
1663         * dependency.c (are_identical_variables): For dummy arguments only
1664         check for equal names, not equal symbols.
1665         * interface.c (gfc_check_typebound_override): Add checking for rank
1666         and character length.
1667
1668 2011-08-07  Janus Weil  <janus@gcc.gnu.org>
1669
1670         PR fortran/49638
1671         * dependency.h (gfc_is_same_range,gfc_are_identical_variables): Remove
1672         two prototypes.
1673         * dependency.c (gfc_are_identical_variables,are_identical_variables):
1674         Renamed the former to the latter and made static.
1675         (gfc_dep_compare_expr): Renamed 'gfc_are_identical_variables', handle
1676         commutativity of multiplication.
1677         (gfc_is_same_range,is_same_range): Renamed the former to the latter,
1678         made static and removed argument 'def'.
1679         (check_section_vs_section): Renamed 'gfc_is_same_range'.
1680         * gfortran.h (gfc_check_typebound_override): New prototype.
1681         * interface.c (gfc_check_typebound_override): Moved here from ...
1682         * resolve.c (check_typebound_override): ... here (and renamed).
1683         (resolve_typebound_procedure): Renamed 'check_typebound_override'.
1684
1685 2011-08-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
1686
1687         PR fortran/50004
1688         * target-memory.c (gfc_target_expr-size): Don't clobber typespec
1689         for derived types.
1690         * simplify.c (gfc_simplify_transfer): Don't calculate source_size
1691         twice.
1692
1693 2011-08-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
1694
1695         PR fortran/37211
1696         * gfortran.h (gfc_calculate_transfer_sizes):  Add prototype.
1697         * target-memory.h (gfc_target_interpret_expr):  Add boolean
1698         argument wether to convert wide characters.
1699         * target-memory.c (gfc_target_expr_size):  Also return length
1700         of characters for non-constant expressions if these can be
1701         determined from the cl.
1702         (interpret_array):  Add argument for gfc_target_interpret_expr.
1703         (gfc_interpret_derived):  Likewise.
1704         (gfc_target_interpret_expr):  Likewise.
1705         * check.c:  Include target-memory.h.
1706         (gfc_calculate_transfer_sizes):  New function.
1707         (gfc_check_transfer):  When -Wsurprising is in force, calculate
1708         sizes and warn if result is larger than size (check moved from
1709         gfc_simplify_transfer).
1710         * simplify.c (gfc_simplify_transfer):  Use
1711         gfc_calculate_transfer_sizes.  Remove warning.
1712
1713 2011-08-04  Richard Guenther  <rguenther@suse.de>
1714
1715         PR fortran/49957
1716         * trans-array.c (add_to_offset): New function.
1717         (gfc_conv_array_ref): Build the array index expression in optimally
1718         associated order.
1719         (gfc_walk_variable_expr): Adjust for the backward walk.
1720
1721 2011-08-02  Daniel Kraft  <d@domob.eu>
1722
1723         PR fortran/49885
1724         * trans-array.c (gfc_trans_auto_array_allocation): Change
1725         gfc_start_block to gfc_init_block to avoid spurious extra-scope.
1726
1727 2011-08-02  Tobias Burnus  <burnus@net-b.de>
1728
1729         * trans-array.c (gfc_array_allocate): Pass token to
1730           gfc_allocate_allocatable for -fcoarray=lib.
1731         * trans-stmt.c (gfc_trans_allocate): Update
1732         gfc_allocate_allocatable call.
1733         * trans.h (gfc_allocate_allocatable): Update prototype.
1734         (gfc_allocate_using_lib): Remove.
1735         * trans.c (gfc_allocate_using_lib): Make static, handle token.
1736         (gfc_allocate_allocatable): Ditto.
1737
1738 2011-08-02  Jakub Jelinek  <jakub@redhat.com>
1739
1740         PR fortran/46752
1741         * cpp.c (cpp_define_builtins): Change _OPENMP to 201107.
1742         * openmp.c (gfc_free_omp_clauses): Free also final_expr.
1743         (OMP_CLAUSE_FINAL, OMP_CLAUSE_MERGEABLE): Define.
1744         (gfc_match_omp_clauses): Handle parsing final and mergeable
1745         clauses.
1746         (OMP_TASK_CLAUSES): Allow final and mergeable clauses.
1747         (gfc_match_omp_taskyield): New function.
1748         (resolve_omp_clauses): Resolve final clause.  Allow POINTERs and
1749         Cray pointers in clauses other than REDUCTION.
1750         (gfc_match_omp_atomic): Match optional
1751         read/write/update/capture keywords after !$omp atomic.
1752         (resolve_omp_atomic): Handle all OpenMP 3.1 atomic forms.
1753         * dump-parse-tree.c (show_omp_node): Handle EXEC_OMP_TASKYIELD,
1754         print final and mergeable clauses.
1755         (show_code_node): Handle EXEC_OMP_TASKYIELD.
1756         * trans-openmp.c (gfc_trans_omp_clauses): Handle final and
1757         mergeable clauses.
1758         (gfc_trans_omp_taskyield): New function.
1759         (gfc_trans_omp_directive): Handle EXEC_OMP_TASKYIELD.
1760         (gfc_trans_omp_atomic): Handle all OpenMP 3.1 atomic forms.
1761         (gfc_omp_clause_copy_ctor): Handle non-allocated allocatable.
1762         (gfc_omp_predetermined_sharing): Adjust comment.
1763         * gfortran.h (gfc_statement): Add ST_OMP_TASKYIELD and
1764         ST_OMP_END_ATOMIC.
1765         (gfc_omp_clauses): Add final_expr and mergeable fields.
1766         (gfc_exec_op): Add EXEC_OMP_TASKYIELD.
1767         (gfc_omp_atomic_op): New enum typedef.
1768         (struct gfc_code): Add ext.omp_atomic.
1769         * trans.c (trans_code): Handle EXEC_OMP_TASKYIELD.
1770         * frontend-passes.c (gfc_code_walker): Also walk final_expr.
1771         * resolve.c (gfc_resolve_blocks, resolve_code): Handle
1772         EXEC_OMP_TASKYIELD.
1773         * st.c (gfc_free_statement): Likewise.
1774         * match.h (gfc_match_omp_taskyield): New prototype.
1775         * parse.c (decode_omp_directive): Handle taskyield directive.
1776         Handle !$omp end atomic.
1777         (case_executable): Add ST_OMP_TASKYIELD case.
1778         (gfc_ascii_statement): Handle ST_OMP_TASKYIELD.
1779         (parse_omp_atomic): Return gfc_statement instead of void.
1780         For !$omp atomic capture parse two assignments instead of
1781         just one and require !$omp end atomic afterwards, for
1782         other !$omp atomic forms just allow !$omp end atomic at the
1783         end.
1784         (parse_omp_structured_block, parse_executable): Adjust
1785         parse_omp_atomic callers.
1786
1787 2011-08-02  Tobias Burnus  <burnus@net-b.de>
1788
1789         * intrinsic.c (OMP_LIB): Updated openmp_version's
1790         value to 201107.
1791         * gfortran.texi (OpenMP): Update ref to OpenMP 3.1.
1792         * intrinsic.texi (OpenMP Modules): Update ref to OpenMP 3.1;
1793         remove deleted omp_integer_kind and omp_logical_kind constants.
1794
1795 2011-07-31  Janus Weil  <janus@gcc.gnu.org>
1796
1797         PR fortran/49112
1798         * resolve.c (resolve_structure_cons): Don't do the full dt resolution,
1799         only call 'resolve_fl_derived0'.
1800         (resolve_typebound_procedures): Resolve typebound procedures of
1801         parent type.
1802         (resolve_fl_derived0): New function, which does a part of the work
1803         for 'resolve_fl_derived'.
1804         (resolve_fl_derived): Call 'resolve_fl_derived0' and do some additional
1805         things.
1806
1807 2011-07-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
1808
1809         PR fortran/48876
1810         * expr.c (gfc_simplify_expr):  If end of a string is less
1811         than zero, set it to zero.
1812
1813 2011-07-28  Jakub Jelinek  <jakub@redhat.com>
1814
1815         PR fortran/31067
1816         * frontend-passes.c (optimize_minmaxloc): New function.
1817         (optimize_expr): Call it.
1818
1819 2011-07-27  Tobias Burnus  <burnus@net-b.de>
1820
1821         PR fortran/45586
1822         * trans-types.c (gfc_get_derived_type): Ensure that pointer
1823         component types are marked as nonrestricted.
1824
1825 2011-07-27  Daniel Carrera  <dcarrera@gmail.com>
1826
1827         PR fortran/49755
1828         * trans.c (gfc_allocate_using_malloc): Change function signature.
1829         Return nothing. New parameter "pointer". Eliminate temorary variables. 
1830         (gfc_allocate_using_lib): Ditto.
1831         (gfc_allocate_allocatable): Ditto. Update call to gfc_allocate_using_lib
1832         and gfc_allocate_using_malloc. Do not free and then reallocate a
1833         variable that is already allocated.
1834         (gfc_likely): New function. Basedon gfc_unlikely.
1835         * trans-array.c (gfc_array_init_size): New parameter "descriptor_block".
1836         Instructions to modify the array descriptor are stored in this block
1837         while other instructions continue to be stored in "pblock".
1838         (gfc_array_allocate): Update call to gfc_array_init_size. Move the
1839         descriptor_block so that the array descriptor is only updated if
1840         the array was allocated successfully.
1841         Update calls to gfc_allocate_allocatable and gfc_allocate_using_malloc.
1842         * trans.h (gfc_allocate_allocatable): Change function signature.
1843         Function now returns void.
1844         (gfc_allocate_using_lib): Ditto, and new function parameter.
1845         (gfc_allocate_using_malloc): Ditto.
1846         * trans-openmp.c (gfc_omp_clause_default_ctor,
1847         gfc_omp_clause_copy_ctor,gfc_trans_omp_array_reduction): Replace a call
1848         to gfc_allocate_allocatable with gfc_allocate_using_malloc.
1849         * trans-stmt.c (gfc_trans_allocate): Update function calls for
1850         gfc_allocate_allocatable and gfc_allocate_using_malloc.
1851
1852 2011-07-26  Tobias Burnus  <burnus@net-b.de>
1853
1854         * trans-array.c (CAF_TOKEN_FIELD): New macro constant.
1855         (gfc_conv_descriptor_token): New function.
1856         * trans-array.h (gfc_conv_descriptor_token): New prototype.
1857         * trans-types.c (gfc_get_array_descriptor_base): For coarrays
1858         with -fcoarray=lib, append "void *token" to the array descriptor.
1859         (gfc_array_descriptor_base_caf): New static variable.
1860         * trans-expr.c (gfc_conv_procedure_call): Handle token and offset
1861         when passing a descriptor coarray to a nondescriptor dummy. 
1862
1863 2011-07-23  Tobias Burnus  <burnus@net-b.de>
1864
1865         * resolve.c (resolve_symbol): Fix coarray var decl check.
1866
1867 2011-07-21  Daniel Carrera  <dcarrera@gmail.com>
1868
1869         * trans.c (gfc_allocate_with_status): Split into two functions
1870         gfc_allocate_using_malloc and gfc_allocate_usig_lib.
1871         (gfc_allocate_using_malloc): The status parameter is now the
1872         actual status rather than a pointer. Code cleanup.
1873         (gfc_allocate_using_lib): Ditto. Add new parametrs errmsg and
1874         errlen. Pass these to the coarray lib.
1875         * trans-openmp.c (gfc_omp_clause_default_ctor): Update calls to
1876         gfc_allocate_allocatable.
1877         (gfc_omp_clause_copy_ctor): Ditto.
1878         (gfc_trans_omp_array_reduction): Ditto.
1879         * trans-stmt.c (gfc_trans_allocate): Ditto. Update call to
1880         gfc_allocate_using_malloc. Pass stat rather than pstat to the allocate
1881         fuctions. If using coarray lib, pass errmsg and errlen to the allocate
1882         functions. Move error checking outside the if (!gfc_array_allocate)
1883         block so that it also affects trees produced by gfc_array_allocate.
1884         * trans-array.c (gfc_array_allocate): Add new parameters errmsg
1885         and errlen. Replace parameter pstat by status. Code cleanup. Update
1886         calls to gfc_allocate_allocatable and gfc_allocate_using_malloc.
1887         * trans-array.h (gfc_array_allocate): Update signature of
1888         gfc_array_allocate.
1889
1890 2011-07-21  Steven G. Kargl  <kargl@gcc.gnu.org>
1891
1892         * gfortran.texi: Remove a duplicate word.
1893
1894 2011-07-21  Tobias Burnus  <burnus@net-b.de>
1895
1896         * check.c (gfc_check_present): Allow coarrays.
1897         * trans-array.c (gfc_conv_array_ref): Avoid casting
1898         when a pointer is wanted.
1899         * trans-decl.c (create_function_arglist): For -fcoarray=lib,
1900         handle hidden token and offset arguments for nondescriptor
1901         coarrays.
1902         * trans-expr.c (get_tree_for_caf_expr): New function.
1903         (gfc_conv_procedure_call): For -fcoarray=lib pass the
1904         token and offset for nondescriptor coarray dummies.
1905         * trans.h (lang_type): Add caf_offset tree.
1906         (GFC_TYPE_ARRAY_CAF_OFFSET): New macro.
1907
1908 2011-07-19  Tobias Burnus  <burnus@net-b.de>
1909
1910         * expr.c (gfc_is_coarray): New function.
1911         * gfortran.h (gfc_is_coarray): New prototype.
1912         * interface.c (compare_parameter): Use it.
1913
1914 2011-07-19  Richard Guenther  <rguenther@suse.de>
1915
1916         * trans-expr.c (fill_with_spaces): Use fold_build_pointer_plus.
1917         (gfc_trans_string_copy): Likewise.
1918         * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Likewise.
1919         * trans-types.c (gfc_get_array_descr_info): Likewise.
1920         * trans.c (gfc_build_array_ref): Likewise.
1921
1922 2011-07-19  Janus Weil  <janus@gcc.gnu.org>
1923
1924         PR fortran/49708
1925         * resolve.c (resolve_allocate_expr): Fix diagnostics for pointers.
1926
1927 2011-07-18  Tobias Burnus  <burnus@net-b.de>
1928
1929         * trans-decl.c (gfc_build_qualified_array): Make coarray's
1930         token TYPE_QUAL_RESTRICT.
1931
1932 2011-07-18  Tobias Burnus  <burnus@net-b.de>
1933
1934         * resolve.c (resolve_transfer): Mention defined I/O
1935         in the diagnostic for alloc_comp/pointer_comp.
1936
1937 2011-07-17  Tobias Burnus  <burnus@net-b.de>
1938
1939         PR fortran/34657
1940         * module.c (check_for_ambiguous): Check whether the name is matches
1941         the current program unit.
1942
1943 2011-07-17  Tobias Burnus  <burnus@net-b.de>
1944
1945         PR fortran/49624
1946         * expr.c (gfc_check_pointer_assign): Fix checking for invalid
1947         pointer bounds.
1948
1949 2011-07-16  Tobias Burnus  <burnus@net-b.de>
1950         
1951         * expr.c (gfc_ref_this_image): New function.
1952         (gfc_is_coindexed): Use it.
1953         * gfortran.h (gfc_ref_this_image): New prototype.
1954         * resolve.c (resolve_deallocate_expr,
1955         resolve_allocate_expr): Support alloc scalar coarrays.
1956         * trans-array.c (gfc_conv_array_ref, gfc_array_init_size,
1957         gfc_conv_descriptor_cosize, gfc_array_allocate,
1958         gfc_trans_deferred_array): Ditto.
1959         * trans-expr.c (gfc_conv_variable) Ditto.:
1960         * trans-stmt.c (gfc_trans_deallocate): Ditto.
1961         * trans-types.c (gfc_get_element_type, gfc_get_array_type_bounds
1962         gfc_get_array_descr_info): Ditto.
1963         * trans-decl.c (gfc_get_symbol_decl): Ditto.
1964
1965 2011-07-11  Jakub Jelinek  <jakub@redhat.com>
1966
1967         PR fortran/49698
1968         * trans-stmt.c (gfc_trans_pointer_assign_need_temp): Initialize
1969         inner_size to gfc_index_one_node instead of integer_one_node.
1970
1971 2011-07-10  Tobias Burnus  <burnus@net-b.de>
1972
1973         PR fortran/49690
1974         * intrinsic.c (add_functions): Use BT_VOID for 2nd argument of SIGNAL.
1975
1976 2011-07-09  Uros Bizjak  <ubizjak@gmail.com>
1977
1978         PR fortran/48926
1979         * expr.c (gfc_get_corank): Change return value to int.
1980         * gfortran.h (gfc_get_corank): Update function prototype.
1981
1982 2011-07-07  Mikael Morin  <mikael.morin@sfr.fr>
1983
1984         PR fortran/49648
1985         * resolve.c (resolve_symbol): Force resolution of function result's
1986         array specification.
1987
1988 2011-07-07  Tobias Burnus  <burnus@net-b.de>
1989
1990         * trans.c (gfc_allocate_with_status): Call _gfortran_caf_register
1991         with NULL arguments for (new) stat=/errmsg= arguments.
1992
1993 2011-07-06  Daniel Carrera  <dcarrera@gmail.com>
1994
1995         * trans-array.c (gfc_array_allocate): Rename allocatable_array to
1996         allocatable. Rename function gfc_allocate_array_with_status to
1997         gfc_allocate_allocatable_with_status. Update function call for
1998         gfc_allocate_with_status.
1999         * trans-opemp.c (gfc_omp_clause_default_ctor): Rename function
2000         gfc_allocate_array_with_status to gfc_allocate_allocatable_with_status.
2001         * trans-stmt.c (gfc_trans_allocate): Update function call for
2002         gfc_allocate_with_status. Rename function gfc_allocate_array_with_status
2003         to gfc_allocate_allocatable_with_status.
2004         * trans.c (gfc_call_malloc): Add new parameter gfc_allocate_with_status
2005         so it uses the library for memory allocation when -fcoarray=lib.
2006         (gfc_allocate_allocatable_with_status): Renamed from
2007         gfc_allocate_array_with_status.
2008         (gfc_allocate_allocatable_with_status): Update function call for
2009         gfc_allocate_with_status.
2010         * trans.h (gfc_coarray_type): New enum.
2011         (gfc_allocate_with_status): Update prototype.
2012         (gfc_allocate_allocatable_with_status): Renamed from
2013         gfc_allocate_array_with_status.
2014         * trans-decl.c (generate_coarray_sym_init): Use the new constant
2015         GFC_CAF_COARRAY_ALLOC in the call to gfor_fndecl_caf_register.
2016
2017 2011-07-06  Richard Guenther  <rguenther@suse.de>
2018
2019         * f95-lang.c (gfc_init_decl_processing):
2020         Merge calls to build_common_tree_nodes and build_common_tree_nodes_2.
2021
2022 2011-07-04  Jakub Jelinek  <jakub@redhat.com>
2023
2024         PR fortran/49623
2025         * gfortranspec.c (lang_specific_driver): Ignore options with
2026         CL_ERR_MISSING_ARG errors.
2027
2028 2011-07-02  Janus Weil  <janus@gcc.gnu.org>
2029
2030         PR fortran/49562
2031         * expr.c (gfc_check_vardef_context): Handle type-bound procedures.
2032
2033 2011-06-30  Jakub Jelinek  <jakub@redhat.com>
2034
2035         PR fortran/49540
2036         * gfortran.h (gfc_constructor): Add repeat field.
2037         * trans-array.c (gfc_conv_array_initializer): Handle repeat > 1.
2038         * array.c (current_expand): Add repeat field.
2039         (expand_constructor): Copy repeat.
2040         * constructor.c (node_free, node_copy, gfc_constructor_get,
2041         gfc_constructor_lookup): Handle repeat field.
2042         (gfc_constructor_lookup_next, gfc_constructor_remove): New functions.
2043         * data.h (gfc_assign_data_value): Add mpz_t * argument.
2044         (gfc_assign_data_value_range): Removed.
2045         * constructor.h (gfc_constructor_advance): Removed.
2046         (gfc_constructor_lookup_next, gfc_constructor_remove): New prototypes.
2047         * data.c (gfc_assign_data_value): Add REPEAT argument, handle it and
2048         also handle overwriting a range with a single entry.
2049         (gfc_assign_data_value_range): Removed.
2050         * resolve.c (check_data_variable): Adjust gfc_assign_data_value
2051         call.  Use gfc_assign_data_value instead of
2052         gfc_assign_data_value_expr.
2053
2054 2011-06-27  Janus Weil  <janus@gcc.gnu.org>
2055
2056         PR fortran/49466
2057         * trans-array.c (structure_alloc_comps): Make sure sub-components
2058         and extended types are correctly deallocated.
2059
2060 2011-06-21  Andrew MacLeod  <amacleod@redhat.com>
2061
2062         * trans-openmp.c: Add sync_ or SYNC__ to builtin names.
2063         * trans-stmt.c: Add sync_ or SYNC__ to builtin names.
2064         * trans-decl.c: Add sync_ or SYNC__ to builtin names.
2065
2066 2011-06-21  Janus Weil  <janus@gcc.gnu.org>
2067
2068         PR fortran/49112
2069         * class.c (gfc_find_derived_vtab): Make vtab and default initialization
2070         symbols SAVE_IMPLICIT.
2071
2072 2011-06-20  Tobias Burnus  <burnus@net-b.de>
2073
2074         PR fortran/18918
2075         * gfortran.h (gfc_check_vardef_context): Update prototype.
2076         (iso_fortran_env_symbol): Handle derived types.
2077         (symbol_attribute): Add lock_comp.
2078         * expr.c (gfc_check_vardef_context): Add LOCK_TYPE check.
2079         * interface.c (compare_parameter, gfc_procedure_use): Handle
2080         LOCK_TYPE.
2081         (compare_actual_formal): Update
2082         gfc_check_vardef_context call.
2083         * check.c (gfc_check_atomic_def, gfc_check_atomic_ref): Ditto.
2084         * intrinsic.c (check_arglist): Ditto.
2085         * io.c (resolve_tag, gfc_resolve_dt, gfc_resolve_inquire): Ditto.
2086         * iso-fortran-env.def (ISOFORTRAN_LOCK_TYPE): Add.
2087         * intrinsic.texi (ISO_FORTRAN_ENV): Document LOCK_TYPE.
2088         * module.c (mio_symbol_attribute): Handle lock_comp.
2089         (create_derived_type): New function.
2090         (use_iso_fortran_env_module): Call it to handle LOCK_TYPE.
2091         * parse.c (parse_derived): Add constraint check for LOCK_TYPE.
2092         * resolve.c (resolve_symbol, resolve_lock_unlock): Add constraint
2093         checks for LOCK_TYPE.
2094         (gfc_resolve_iterator, resolve_deallocate_expr,
2095         resolve_allocate_expr, resolve_code, resolve_transfer): Update
2096         gfc_check_vardef_context call.
2097         * trans-stmt.h (gfc_trans_lock_unlock): New prototype.
2098         * trans-stmt.c (gfc_trans_lock_unlock): New function.
2099         * trans.c (trans_code): Handle LOCK and UNLOCK.
2100
2101 2011-06-18  Janus Weil  <janus@gcc.gnu.org>
2102
2103         PR fortran/49400
2104         * decl.c (gfc_match_procedure): Allow PROCEDURE declarations inside
2105         BLOCK constructs.
2106
2107 2011-06-17  Janus Weil  <janus@gcc.gnu.org>
2108
2109         PR fortran/48699
2110         * check.c (gfc_check_move_alloc): If 'TO' argument is polymorphic,
2111         make sure the vtab is present.
2112
2113 2011-06-16  Janus Weil  <janus@gcc.gnu.org>
2114
2115         PR fortran/49074
2116         * interface.c (gfc_extend_assign): Propagate the locus from the
2117         assignment to the type-bound procedure call.
2118
2119 2011-06-16  Janus Weil  <janus@gcc.gnu.org>
2120
2121         PR fortran/49417
2122         * module.c (mio_component): Make sure the 'class_ok' attribute is set
2123         for use-associated CLASS components.
2124         * parse.c (parse_derived): Check for 'class_ok' attribute.
2125         * resolve.c (resolve_fl_derived): Ditto.
2126
2127 2011-06-13  Thomas Koenig  <tkoenig@gcc.gnu.org>
2128
2129         * frontend-passes.c (remove_trim):  New function.
2130         (optimize_assignment):  Use it.
2131         (optimize_comparison):  Likewise.  Return correct status
2132         for previous change.
2133
2134 2011-06-12  Tobias Burnus
2135
2136         PR fortran/49324
2137         * trans-expr.c (gfc_trans_assignment_1): Tell
2138         gfc_trans_scalar_assign to also deep-copy RHS nonvariables
2139         with allocatable components.
2140         * trans-array.c (gfc_conv_expr_descriptor): Ditto.
2141
2142 2011-05-11  Thomas Koenig  <tkoenig@gcc.gnu.org>
2143
2144         * frontend-passes.c (optimize_assignment): Follow chains
2145         of concatenation operators to the end for removing trailing
2146         TRIMS for assignments.
2147
2148 2011-06-10  Daniel Carrera  <dcarrera@gmail.com>
2149
2150         * trans-decl.c (gfc_build_builtin_function_decls):
2151         Updated declaration of caf_sync_all and caf_sync_images.
2152         * trans-stmt.c (gfc_trans_sync): Function
2153         can now handle a "stat" variable that has an integer type
2154         different from integer_type_node.
2155
2156 2011-06-09  Richard Guenther  <rguenther@suse.de>
2157
2158         * trans.c (gfc_allocate_array_with_status): Mark error path
2159         as unlikely.
2160
2161 2011-06-08  Tobias Burnus  <burnus@net-b.de>
2162
2163         PR fortran/18918
2164         * gfortran.h (gfc_statement): Add ST_LOCK and ST_UNLOCK.
2165         (gfc_exec_op): Add EXEC_LOCK and EXEC_UNLOCK.
2166         (gfc_code): Add expr4.
2167         * match.h (gfc_match_lock, gfc_match_unlock): New prototypes.
2168         * match.c (gfc_match_lock, gfc_match_unlock,
2169         lock_unlock_statement): New functions.
2170         (sync_statement): Bug fix, avoiding double freeing.
2171         (gfc_match_if): Handle LOCK/UNLOCK statement.
2172         * parse.c (decode_statement, next_statement,
2173         gfc_ascii_statement): Ditto.
2174         * st.c (gfc_free_statement): Handle LOCK and UNLOCK.
2175         * resolve.c (resolve_lock_unlock): New function.
2176         (resolve_code): Call it.
2177         * dump-parse-tree.c (show_code_node): Handle LOCK/UNLOCK.
2178
2179 2011-06-07  Richard Guenther  <rguenther@suse.de>
2180
2181         * f95-lang.c (gfc_init_decl_processing): Do not set
2182         size_type_node or call set_sizetype.
2183
2184 2011-06-05  Tobias Burnus  <burnus@net-b.de>
2185
2186         PR fortran/49255
2187         * trans-expr.c (gfc_conv_procedure_call): Fix -fcheck=pointer
2188         for F2008.
2189
2190 2011-06-05  Andreas Schmidt  <andreas.schmidt.42@gmx.net>
2191         Thomas Koenig  <tkoenig@gcc.gnu.org>
2192
2193         * dump-parse-tree.c (show_symbol):  Don't dump namespace
2194         for ENTRY to avoid infinite recursion.
2195
2196 2011-06-02  Asher Langton  <langton2@llnl.gov>
2197
2198         PR fortran/49268
2199         * trans-decl.c (gfc_trans_deferred_vars): Treat assumed-size Cray
2200         pointees as AS_EXPLICIT.
2201
2202 2011-06-02  Asher Langton  <langton2@llnl.gov>
2203
2204         PR fortran/37039
2205         * decl.c (variable_decl): Merge current_as before copying to cp_as.
2206
2207 2011-06-02  Steven G. Kargl  <kargl@gcc.gnu.org>
2208
2209         PR fortran/49265
2210         * decl.c (gfc_match_modproc):  Allow for a double colon in a module
2211         procedure statement.
2212         * parse.c ( decode_statement): Deal with whitespace around :: in
2213         gfc_match_modproc.
2214
2215 2011-05-31  Tobias Burnus  <burnus@net-b.de>
2216
2217         PR fortran/18918
2218         * intrinsic.c (klass): Add CLASS_ATOMIC.
2219         (add_subroutines): Add atomic_ref/atomic_define.
2220         * intrinsic.texi (ATOMIC_REF, ATOMIC_DEFINE): Document.
2221         * intrinsic.h (gfc_check_atomic_def, gfc_check_atomic_ref,
2222         gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New prototypes.
2223         * gfortran.h (gfc_isym_id): Add GFC_ISYM_ATOMIC_DEF
2224         and GFC_ISYM_ATOMIC_REF.
2225         (gfc_atomic_int_kind, gfc_atomic_logical_kind): New global vars.
2226         * iresolve.c (gfc_resolve_atomic_def, gfc_resolve_atomic_ref): New
2227         functions.
2228         * check.c (gfc_check_atomic, gfc_check_atomic_def,
2229         gfc_check_atomic_ref): New functions.
2230         * iso-fortran-env.def (ISOFORTRANENV_FILE_ATOMIC_INT_KIND,
2231         ISOFORTRANENV_FILE_ATOMIC_LOGICAL_KIND): Change kind value.
2232         * trans-intrinsic.c (conv_intrinsic_atomic_def,
2233         conv_intrinsic_atomic_ref, gfc_conv_intrinsic_subroutine): New
2234         functions.
2235         (conv_intrinsic_move_alloc) Renamed from
2236         gfc_conv_intrinsic_move_alloc - and made static.
2237         * trans.h (gfc_conv_intrinsic_move_alloc): Remove.
2238         (gfc_conv_intrinsic_subroutine) Add prototype.
2239         * trans.c (trans_code): Call gfc_conv_intrinsic_subroutine.
2240         * trans-types (gfc_atomic_int_kind, gfc_atomic_logical_kind): New
2241         global vars.
2242         (gfc_init_kinds): Set them.
2243
2244 2011-05-31  Tobias Burnus  <burnus@net-b.de>
2245
2246         PR fortran/18918
2247         * trans-array.c (gfc_trans_dummy_array_bias): Handle
2248         cobounds of assumed-shape arrays.
2249
2250 2011-05-31  Tobias Burnus  <burnus@net-b.de>
2251
2252         PR fortran/18918
2253         * resolve.c (resolve_fl_variable): Handle static coarrays
2254         with non-constant cobounds.
2255
2256 2011-05-29  Janus Weil  <janus@gcc.gnu.org>
2257
2258         PR fortran/47601
2259         * module.c (mio_component_ref): Handle components of extended types.
2260         * symbol.c (gfc_find_component): Return is sym is NULL.
2261
2262 2011-05-29  Tobias Burnus  <burnus@net-b.de>
2263
2264         PR fortran/18918
2265         * interface.c (compare_parameter): Add check for passing coarray
2266         to allocatable noncoarray dummy.
2267
2268 2011-05-29  Tobias Burnus  <burnus@net-b.de>
2269             Richard Guenther  <rguenther@suse.de>
2270
2271         PR fortran/18918
2272         * trans-types.c (gfc_get_nodesc_array_type): Don't mess with
2273         the type's TREE_TYPE.
2274         * trans-array.c (gfc_conv_array_ref): Use TYPE_MAIN_VARIANT.
2275         * trans.c (gfc_build_array_ref): Ditto.
2276
2277 2011-05-27  Tobias Burnus  <burnus@net-b.de>
2278
2279         PR fortran/18918
2280         * check.c (gfc_check_associated, gfc_check_null): Add coindexed check.
2281         * match.c (gfc_match_nullify): Ditto.
2282         * resolve.c (resolve_deallocate_expr): Ditto.
2283         * trans-types.c (gfc_get_nodesc_array_type): Don't set restricted
2284         for nonpointers.
2285
2286 2011-05-27  Tobias Burnus  <burnus@net-b.de>
2287
2288         PR fortran/48820
2289         * gfortran.h (gfc_isym_id): Add GFC_ISYM_RANK.
2290         * intrinsic.c (add_functions): Add rank intrinsic.
2291         (gfc_check_intrinsic_standard): Handle GFC_STD_F2008_TR.
2292         * intrinsic.h (gfc_simplify_rank, gfc_check_rank): Add prototypes.
2293         * simplify.c (gfc_simplify_rank): New function.
2294         * intrinsic.texi (RANK): Add description for rank intrinsic.
2295         * check.c (gfc_check_rank): New function.
2296
2297 2011-05-26  Paul Thomas  <pault@gcc.gnu.org>
2298             Thomas Koenig  <tkoenig@gcc.gnu.org>
2299
2300         PR fortran/48955
2301         * trans-expr.c (gfc_trans_assignment_1): GFC_REVERSE_NOT_SET
2302         changed to GFC_ENABLE_REVERSE.
2303         * trans-array.c (gfc_init_loopinfo): GFC_CANNOT_REVERSE changed
2304         to GFC_INHIBIT_REVERSE.
2305         * gfortran.h : Enum gfc_reverse is now GFC_ENABLE_REVERSE,
2306         GFC_FORWARD_SET, GFC_REVERSE_SET and GFC_INHIBIT_REVERSE.
2307         * dependency.c (gfc_dep_resolver): Change names for elements of
2308         gfc_reverse as necessary. Change the logic so that forward
2309         dependences are remembered as well as backward ones. When both
2310         have appeared, force a temporary.
2311
2312 2011-05-26  Tobias Burnus  <burnus@net-b.de>
2313
2314         PR fortran/18918
2315         * trans-array.c (gfc_conv_array_ref): Handle pointer coarrays.
2316         * trans-decl.c (has_coarray_vars, caf_init_block,
2317         gfor_fndecl_caf_register): New file-global variables.
2318         (gfc_finish_var_decl): Make sure that coarrays in main are static.
2319         (gfc_build_qualified_array): Generate coarray token variable.
2320         (gfc_get_symbol_decl): Don't use a static initializer for coarrays.
2321         (gfc_build_builtin_function_decls): Set gfor_fndecl_caf_register.
2322         (gfc_trans_deferred_vars, gfc_emit_parameter_debug_info): Skip for
2323         static coarrays.
2324         (generate_local_decl): Check for local coarrays.
2325         (create_main_function): SYNC ALL before calling MAIN.
2326         (generate_coarray_sym_init): Register static coarray.
2327         (generate_coarray_init): Generate CAF registering constructor
2328         function.
2329         (gfc_generate_function_code): Call it, if needed, do not create
2330         cgraph twice.
2331         (gfc_generate_module_vars, gfc_process_block_locals): Call
2332         generate_coarray_init.
2333         * trans-types.c (gfc_get_nodesc_array_type): Generate pointers for
2334         -fcoarray=lib.
2335         * trans.h (gfor_fndecl_caf_register): New variable.
2336         (lang_type): New element caf_token.
2337         (GFC_TYPE_ARRAY_CAF_TOKEN): New macro.
2338
2339 2011-05-24  Joseph Myers  <joseph@codesourcery.com>
2340
2341         * Make-lang.in (GFORTRAN_D_OBJS): Remove prefix.o.
2342         (gfortran$(exeext)): Use libcommon-target.a.
2343
2344 2011-05-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
2345
2346         * frontend-passes.c (cfe_register_funcs):  Also register
2347         character functions if their charlens are known and constant.
2348         Also register allocatable functions.
2349
2350 2011-05-21  Janus Weil  <janus@gcc.gnu.org>
2351
2352         PR fortran/48699
2353         * match.c (select_type_set_tmp): Make the temporary ALLOCATABLE if the
2354         selector is ALLOCATABLE.
2355
2356 2011-05-20  Janus Weil  <janus@gcc.gnu.org>
2357
2358         PR fortran/48706
2359         * module.c (write_dt_extensions): Do not write extended types which
2360         are local to a subroutine.
2361
2362 2011-05-20  Joseph Myers  <joseph@codesourcery.com>
2363
2364         * Make-lang.in (GFORTRAN_D_OBJS): Remove version.o and intl.o.
2365
2366 2011-05-20  Janne Blomqvist  <jb@gcc.gnu.org>
2367
2368         * gfortran.texi (set_fpe): Update documentation.
2369         * invoke.texi (-ffpe-trap): Likewise.
2370         * libgfortran.h (GFC_FPE_PRECISION): Rename to GFC_FPE_INEXACT.
2371         * options.c (gfc_handle_fpe_trap_option): Handle inexact and make
2372         precision an alias for it.
2373
2374 2011-05-19  Tobias Burnus  <burnus@net-b.de>
2375
2376         PR fortran/18918
2377         * trans-types.c (gfc_get_element_type): Handle scalar coarrays.
2378         (gfc_get_nodesc_array_type): Make a variant-type copy for scalar
2379         coarrays.
2380         * trans.c (gfc_build_array_ref): Return original type not variant
2381         copy for scalar coarrays.
2382         * trans-array.c (gfc_conv_array_ref): Ditto.
2383
2384 2011-05-18  Janus Weil  <janus@gcc.gnu.org>
2385
2386         PR fortran/48700
2387         * trans-intrinsic.c (gfc_conv_intrinsic_move_alloc): Deallocate 'TO'
2388         argument to avoid memory leaks.
2389
2390 2011-05-16  Tobias Burnus  <burnus@net-b.de>
2391
2392         * gfortran.texi (_gfortran_set_options): Add GFC_STD_F2008_TR.
2393         (Fortran 2008 status): Multi-image support for coarrays.
2394         (TR 19113 status): New section.
2395
2396 2011-05-15  Tobias Burnus  <burnus@net-b.de>
2397
2398         PR fortran/18918
2399         actual argument is not an array; rank mismatch is diagnosted later.
2400         * trans-decl.c (gfc_get_symbol_decl, gfc_trans_deferred_vars): Handle
2401         scalar coarrays.
2402         * trans-types.c (gfc_get_array_type_bounds): Ditto.
2403
2404 2011-05-15  Joern Rennecke  <amylaar@spamcop.net>
2405
2406         PR middle-end/46500
2407         * trans-types.c: Include "tm.h".
2408         [0] (c_size_t_size): Remove.
2409
2410 2011-05-15  Janne Blomqvist  <jb@gcc.gnu.org>
2411
2412         PR libfortran/48915
2413         * gfortran.texi (_gfortran_set_options): Even though -fbacktrace
2414         is now the default, the library defaults to backtracing disabled.
2415
2416 2011-05-14  Tobias Burnus  <burnus@net-b.de>
2417
2418         * lang.opt (fdump-core): Re-add as ignored option
2419         for backward compatibility.
2420
2421 2011-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
2422
2423         PR libfortran/48915
2424         * gfortran.texi: Update mixed-language programming section
2425         reflecting the removal of the fdump-core option, and that
2426         -fbacktrace is now enabled by default.
2427
2428 2011-05-14  Thomas Koenig  <tkoenig@gcc.gnu.org>
2429
2430         PR fortran/22572
2431         * frontend-passes.c (cfe_register_funcs):  Also register functions
2432         for potential elimination if the rank is > 0, the shape is unknown
2433         and reallocate on assignment is active.
2434         (create_var):  For rank > 0 functions with unknown shape, create
2435         an allocatable temporary.
2436
2437 2011-05-14  Tobias Burnus  <burnus@net-b.de>
2438
2439         PR fortran/18918
2440         * interface.c (compare_parameter): Skip diagnostic if
2441         actual argument is not an array; rank mismatch is diagnosted later.
2442
2443 2011-05-14  Tobias Burnus  <burnus@net-b.de>
2444
2445         * options.c (gfc_init_options, gfc_post_options): Enable
2446         -fstack-arrays by default if -Ofast is used.
2447         * invoke.texi (-fstack-arrays): Document this.
2448
2449 2011-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
2450
2451         PR libfortran/48915
2452         * gfortran.h (gfc_option_t): Remove flag_dump_core.
2453         * gfortran.texi (GFORTRAN_ERROR_DUMPCORE): Remove section.
2454         (GFORTRAN_ERROR_BACKTRACE): Document that it's enabled by default.
2455         * intrinsic.texi (ABORT): Remove explanation of -fdump-core.
2456         * invoke.texi: Remove -fdump-core, document that -fbacktrace is
2457         enabled by default.
2458         * lang.opt: Remove -fdump-core.
2459         * options.c (gfc_init_options): Make backtrace default to enabled,
2460         remove dump_core.
2461         (gfc_handle_option): Remove OPT_fdump-core.
2462         * trans-decl.c: Pass a 0 to preserve ABI.
2463
2464 2011-05-14  Janne Blomqvist  <jb@gcc.gnu.org>
2465
2466         * gfortran.texi: Remove GFORTRAN_USE_STDERR documentation.
2467
2468 2011-05-13  Tobias Burnus  <burnus@net-b.de>
2469
2470         PR fortran/48972
2471         * io.c (resolve_tag_format, resolve_tag): Make sure
2472         that the string is of default kind.
2473         (gfc_resolve_inquire): Also resolve decimal tag.
2474
2475 2011-05-12  Tobias Burnus  <burnus@net-b.de>
2476
2477         PR fortran/48972
2478         * resolve.c (resolve_intrinsic): Don't resolve module
2479         intrinsics multiple times.
2480
2481 2011-05-11  Tobias Burnus  <burnus@net-b.de>
2482
2483         PR fortran/48889
2484         * expr.c (gfc_is_constant_expr): Use e->value.function.esym
2485         instead of e->symtree->n.sym, if available.
2486
2487 2011-05-07  Eric Botcazou  <ebotcazou@adacore.com>
2488
2489         * f95-lang.c (global_bindings_p): Return bool and simplify.
2490
2491 2011-05-07  Tobias Burnus  <burnus@net-b.de>
2492
2493         PR fortran/18918
2494         PR fortran/48919
2495         * trans.h: Move gfc_init_coarray_decl prototype ...
2496         * gfortran.h: ... to here.
2497         * parse.c (translate_all_program_units): Call gfc_init_coarray_decl.
2498         (gfc_parse_file): Update translate_all_program_units call.
2499         * trans-decl.c (gfc_init_coarray_decl): Fix variable declaration,
2500         new argument whether DECL_EXTERNAL should be used.
2501         (create_main_function): Update gfc_init_coarray_decl call.
2502         * trans-intrinsic.c (trans_this_image, trans_image_index,
2503         conv_intrinsic_cobound): Ditto.
2504
2505 2011-05-06  Tobias Burnus  <burnus@net-b.de>
2506
2507         PR fortran/18918
2508         * trans-array.c (gfc_walk_variable_expr): Continue walking
2509         for scalar coarrays.
2510         * trans-intrinsic.c (convert_element_to_coarray_ref): New function.
2511         (trans_this_image, trans_image_index, conv_intrinsic_cobound): Use it.
2512         (trans_this_image): Fix algorithm.
2513         * trans-types.c (gfc_get_element_type, gfc_get_array_descriptor_base,
2514         gfc_sym_type): Handle scalar coarrays.
2515
2516 2011-05-06  Tobias Burnus  <burnus@net-b.de>
2517
2518         PR fortran/48858
2519         PR fortran/48820
2520         * lang.opt (std=f2008tr): New.
2521         * libgfortran.h (GFC_STD_F2008_TR): New macro constant.
2522         * decl.c (verify_c_interop_param): Allow OPTIONAL in BIND(C)
2523         procedures for -std=f2008tr/gnu/legacy.
2524         (gfc_match_import): Set sym to NULL.
2525         * options.c (set_default_std_flags,gfc_handle_option): Handle
2526         -std=f2008tr.
2527         * invoke.texi (-std=): Document -std=f2008tr.
2528
2529 2011-05-05  Nathan Froyd  <froydnj@codesourcery.com>
2530
2531         * trans-decl.c (gfc_trans_entry_master_switch): Call build_case_label.
2532         * trans-io.c (add_case): Likewise.
2533         * trans-stmt.c (gfc_trans_integer_select): Likewise.
2534         (gfc_trans_character_select): Likewise.
2535
2536 2011-05-05  Eric Botcazou  <ebotcazou@adacore.com>
2537
2538         * trans-decl.c (trans_function_start): Do not set
2539         dont_save_pending_sizes_p.
2540
2541 2011-05-04  Nathan Froyd  <froydnj@codesourcery.com>
2542
2543         * trans.h (gfc_chainon_list): Delete.
2544         * trans.c (gfc_chainon_list): Delete.
2545
2546 2011-05-04  Tobias Burnus  <burnus@net-b.de>
2547
2548         PR fortran/48864
2549         * invoke.texi (fno-protect-parens): Document
2550         that -Ofast implies -fno-protect-parens.
2551         * options.c (gfc_init_options, gfc_post_options):
2552         Make -Ofast imply -fno-protect-parens.
2553
2554 2011-05-04  Nathan Froyd  <froydnj@codesourcery.com>
2555
2556         * trans-decl.c (build_library_function_decl_1): Call
2557         build_function_type_vec.  Adjust argument list building accordingly.
2558         * trans-intrinsic.c (gfc_get_intrinsic_lib_fndecl): Likewise.
2559         * trans-types.c (gfc_get_function_type): Likewise.
2560
2561 2011-05-04  Richard Guenther  <rguenther@suse.de>
2562
2563         * trans-array.c (gfc_trans_array_constructor_value): Use
2564         size_int for bounds of range types.
2565         (gfc_trans_array_constructor_value): Use size_type_node
2566         for memcpy argument.
2567         * trans-common.c (build_field): Use gfc_charlen_type_node
2568         for lengths.
2569         * trans-openmp.c (gfc_trans_omp_clauses): Do not pass NULL
2570         as type to build_int_cst.
2571         * trans-const.c (gfc_build_string_const): Use size_int
2572         for bounds of range types.
2573         (gfc_build_wide_string_const): Likewise.
2574         * trans-stmt.c (gfc_trans_label_assign): Use gfc_charlen_type_node
2575         for lengths.
2576         (gfc_trans_character_select): Likewise.
2577         (gfc_trans_character_select): Do not pass NULL
2578         as type to build_int_cst.
2579         (gfc_trans_character_select): Use size_int for bounds of range types.
2580         * trans-io.c (gfc_build_io_library_fndecls): Likewise.
2581         (add_case): Do not pass NULL as type to build_int_cst.
2582         (transfer_expr): Likewise.
2583         (transfer_array_desc): Likewise.
2584         * trans-decl.c (gfc_add_assign_aux_vars): Use gfc_charlen_type_node
2585         for lengths.
2586         (gfc_trans_assign_aux_var): Likewise.
2587         (create_main_function): Use size_int for bounds of range types.
2588         * trans-intrinsic.c (gfc_conv_intrinsic_minmax_char): Do not pass
2589         NULL as type to build_int_cst.
2590         (gfc_conv_intrinsic_spacing): Likewise.
2591         (gfc_conv_intrinsic_rrspacing): Likewise.
2592         (gfc_conv_intrinsic_len): Use gfc_charlen_type_node for lengths.
2593
2594 2011-05-04  Richard Guenther  <rguenther@suse.de>
2595
2596         * trans-types.c (gfc_get_array_type_bounds): Remove zero notrunc
2597         argument to int_const_binop.
2598
2599 2011-05-03  Tobias Burnus  <burnus@net-b.de>
2600
2601         PR fortran/18918
2602         * trans-intrinsic.c (trans_this_image): Implement version with
2603         coarray argument.
2604         (conv_intrinsic_cobound): Simplify code.
2605         (gfc_conv_intrinsic_function): Call trans_this_image for
2606         this_image(coarray) except for -fcoarray=single.
2607
2608 2011-05-02  Steven G. Kargl  <kargl@gcc.gnu.org>
2609
2610         PR fortran/48720
2611         * gfortran.texi: Document the 'Q' exponent-letter extension.
2612         * invoke.texi: Document -Wreal-q-constant.
2613         * lang.opt: Add -Wreal-q-constant option.
2614         * gfortran.h: Add warn_real_q_constant to option struct.
2615         * primary.c (match_real_constant):  Use it.  Accept 'Q' as
2616         exponent-letter for REAL(16) real-literal-constant with a
2617         fallback to REAL(10) or error if REAL(10) is not available.
2618         * options.c (gfc_init_options, set_Wall) Set it.
2619         (gfc_handle_option): Handle new option.
2620
2621 2011-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
2622
2623         * dump-prase-tree.c (show_code_node):  Set the current
2624         namespace to the BLOCK before displaying it; restore
2625         afterwards.
2626
2627 2011-04-30  Tobias Burnus  <burnus@net-b.de>
2628
2629         PR fortran/48821
2630         * decl.c (gfc_match_import): Don't try to find the
2631         symbol if already found.
2632
2633 2011-04-30  Paul Thomas  <pault@gcc.gnu.org>
2634
2635         PR fortran/48746
2636         * trans-expr.c (fcncall_realloc_result): Set the bounds and the
2637         offset so that the lbounds are one.
2638         (gfc_trans_arrayfunc_assign): Add rank to arguments of above.
2639
2640 2011-04-29  Paul Thomas  <pault@gcc.gnu.org>
2641
2642         PR fortran/48462
2643         * trans-expr.c (arrayfunc_assign_needs_temporary): Deal with
2644         automatic reallocation when the lhs is a target.
2645
2646         PR fortran/48746
2647         * trans-expr.c (fcncall_realloc_result): Make sure that the
2648         result dtype field is set before the function call.
2649
2650 2011-04-29  Tobias Burnus  <burnus@net-b.de>
2651
2652         PR fortran/48810
2653         * resolve.c (resolve_typebound_generic_call): Don't check access
2654         flags of the specific function.
2655
2656         PR fortran/48800
2657         * resolve.c (resolve_formal_arglist): Don't change AS_DEFERRED
2658         to AS_ASSUMED_SHAPE for function results.
2659         (resolve_fl_var_and_proc): Print also for function results with
2660         AS_DEFERRED an error, if they are not a pointer or allocatable.
2661         (resolve_types): Make sure arguments of procedures in interface
2662         blocks are resolved.
2663
2664 2011-04-29  Michael Matz  <matz@suse.de>
2665
2666         * options.c (options.c): Set warn_maybe_uninitialized.
2667
2668 2011-04-28  Tobias Burnus  <burnus@net-b.de>
2669
2670         PR fortran/48112
2671         * resolve.c (resolve_fl_var_and_proc): Print diagnostic of
2672         function results only once.
2673         (resolve_symbol): Always resolve function results.
2674
2675         PR fortran/48279
2676         * expr.c (gfc_check_vardef_context): Fix handling of generic
2677         EXPR_FUNCTION.
2678         * interface.c (check_interface0): Reject internal functions
2679         in generic interfaces, unless -std=gnu.
2680
2681 2011-04-27  Tobias Burnus  <burnus@net-b.de>
2682
2683         PR fortran/48788
2684         * resolve.c (resolve_global_procedure): Error recovery -
2685         avoid segfault for (non)character-returning functions.
2686
2687 2011-04-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
2688
2689         * decl.c (gfc_match_end):  Check that the block name starts
2690         with "block@".
2691         * parse.c (gfc_build_block_ns):  Make block names unique by
2692         numbering them.
2693
2694 2011-04-26  Thomas Koenig  <tkoenig@gcc.gnu.org>
2695
2696         * frontend-passes.c (inserted_block):  New variable.
2697         (changed_statement):  Likewise.
2698         (create_var):  Encase statement to be operated on in a BLOCK.
2699         Adjust code insertion for BLOCK.
2700         (cfe_code):  Set inserted_block and changed_statement to NULL.
2701
2702 2011-04-23  Tobias Burnus  <burnus@net-b.de>
2703
2704         PR fortran/18918
2705         * module.c (mio_array_spec): Set as->cotype on reading.
2706         * resolve.c (resolve_allocate_expr): Fix allocating coarray
2707         components.
2708
2709 2011-04-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
2710
2711         PR fortran/48405
2712         * frontend_passes (cfe_register_funcs): Remove workaround for DO
2713         loops.
2714         (gfc_code_walker):  Make sure the pointer to the current
2715         statement doen't change when other statements are inserted.
2716
2717 2011-04-21  Tobias Burnus  <burnus@net-b.de>
2718
2719         PR fortran/18918
2720         * array.c (gfc_match_array_spec): Fix maximal rank(+corank) check.
2721
2722 2011-04-20  Jim Meyering  <meyering@redhat.com>
2723
2724         * expr.c (free_expr0): Remove useless if-before-free.
2725         * gfortranspec.c (lang_specific_pre_link): Likewise.
2726         * interface.c (gfc_extend_expr): Likewise.
2727         * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise.
2728
2729 2011-04-19  Tobias Burnus  <burnus@net-b.de>
2730
2731         PR fortran/48588
2732         PR fortran/48692
2733
2734         * module.c (fix_mio_expr): Commit created symbol.
2735
2736 2011-04-19  Janne Blomqvist  <jb@gcc.gnu.org>
2737
2738         * scanner.c (load_file): Use XCNEWVAR instead of xcalloc.
2739
2740 2011-04-19  Janne Blomqvist  <jb@gcc.gnu.org>
2741
2742         * frontend-passes.c (gfc_run_passes): Use XDELETEVEC instead of
2743         free.
2744
2745 2011-04-19  Janne Blomqvist  <jb@gcc.gnu.org>
2746
2747         * misc.c (gfc_getmem): Remove function.
2748         * gfortran.h: Remove gfc_getmem prototype. Replace gfc_getmem
2749         usage with XCNEW or XCNEWVEC.
2750         * expr.c (gfc_check_assign_symbol): Replace gfc_getmem usage with
2751         XCNEW or XCNEWVEC.
2752         * options.c (gfc_handle_module_path_options)
2753         (gfc_get_option_string): Likewise.
2754         * resolve.c (gfc_resolve_forall): Likewise.
2755         * simplify.c (simplify_transformation_to_array): Likewise.
2756         * target-memory.c (gfc_target_interpret_expr): Likewise.
2757         * trans-common.c (get_segment_info, copy_equiv_list_to_ns)
2758         (get_init_field): Likewise.
2759         * trans-expr.c (gfc_conv_statement_function): Likewise.
2760         * trans-io.c (nml_full_name): Likewise.
2761         * trans-stmt.c (gfc_trans_forall_1): Likewise.
2762         * scanner.c (load_file): Replace gfc_getmem usage with xcalloc.
2763
2764 2011-04-19  Tobias Burnus  <burnus@net-b.de>
2765
2766         PR fortran/48588
2767         * parse.c (resolve_all_program_units): Skip modules.
2768         (translate_all_program_units): Handle modules.
2769         (gfc_parse_file): Defer code generation for modules.
2770
2771 2011-04-19  Martin Jambor  <mjambor@suse.cz>
2772
2773         * trans-decl.c (gfc_generate_function_code): Call cgraph_create_node
2774         instead of cgraph_get_create_node.
2775
2776 2011-04-18  Jim Meyering  <meyering@redhat.com>
2777
2778         remove now-unused definition of gfc_free
2779         * misc.c (gfc_free): Remove function.
2780         * gfortran.h (gfc_free): Remove its prototype.
2781
2782 2011-04-18  Jim Meyering  <meyering@redhat.com>
2783
2784         convert each use of gfc_free (p) to free (p)
2785         Do that by running this command:
2786           perl -pi -e    's/\bgfc_free ?\(/free (/' \
2787             $(git grep -El '\bgfc_free ?\(')
2788         which also corrects the few uses that lacked a space between
2789         the function name and the open parenthesis.
2790         Manually undo the change to the function definition itself
2791         and its prototype.  They'll be removed next.
2792         * array.c (gfc_free_array_spec, gfc_set_array_spec): s/gfc_free/free/
2793         * constructor.c (node_free): Likewise.
2794         * cpp.c (dump_queued_macros): Likewise.
2795         * data.c (gfc_assign_data_value): Likewise.
2796         * decl.c (free_variable, free_value, gfc_free_data): Likewise.
2797         (gfc_free_data_all, match_old_style_init): Likewise.
2798         (gfc_set_constant_character_len, gfc_free_enum_history, NUM_DECL):
2799         Likewise.
2800         (gfc_match_modproc): Likewise.
2801         * dependency.c (check_section_vs_section): Likewise.
2802         * error.c (gfc_pop_error, gfc_free_error): Likewise.
2803         * expr.c (free_expr0, gfc_free_expr, gfc_free_actual_arglist): Likewise.
2804         (gfc_free_ref_list, gfc_replace_expr, gfc_copy_ref): Likewise.
2805         (find_substring_ref, gfc_simplify_expr, gfc_check_assign_symbol):
2806         Likewise.
2807         * frontend-passes.c (gfc_run_passes, cfe_expr_0): Likewise.
2808         (strip_function_call, optimize_comparison): Likewise.
2809         * interface.c (gfc_free_interface, arginfo, check_interface0): Likewise.
2810         (CHECK_OS_COMPARISON, gfc_extend_assign, gfc_free_formal_arglist):
2811         Likewise.
2812         * intrinsic.c (gfc_intrinsic_done_1, gfc_convert_type_warn): Likewise.
2813         (gfc_convert_chartype): Likewise.
2814         * io.c (gfc_free_open, compare_to_allowed_values, gfc_free_close):
2815         Likewise.
2816         (gfc_free_filepos, gfc_free_dt, gfc_free_inquire): Likewise.
2817         * match.c (gfc_free_iterator, gfc_match_associate): Likewise.
2818         (gfc_free_alloc_list, gfc_free_namelist, gfc_free_equiv_until):
2819         Likewise.
2820         (free_case, gfc_free_forall_iterator): Likewise.
2821         * misc.c: Likewise.
2822         * module.c (free_pi_tree, resolve_fixups, free_rename): Likewise.
2823         (free_true_name, peek_atom, mio_allocated_wide_string): Likewise.
2824         (mio_pool_string, mio_internal_string, mio_gmp_integer): Likewise.
2825         (mio_gmp_real, mio_expr, mio_typebound_proc): Likewise.
2826         (mio_full_typebound_tree, skip_list, load_equiv): Likewise.
2827         (free_written_common, gfc_use_module, gfc_free_use_stmts): Likewise.
2828         * openmp.c (gfc_free_omp_clauses): Likewise.
2829         * options.c (gfc_post_options): Likewise.
2830         * parse.c (select_type_pop, parse_omp_structured_block): Likewise.
2831         * primary.c (gfc_free_structure_ctor_component): Likewise.
2832         * resolve.c (resolve_structure_cons, check_host_association): Likewise.
2833         (gfc_resolve_forall, resolve_equivalence): Likewise.
2834         * scanner.c (gfc_scanner_done_1, gfc_release_include_path): Likewise.
2835         (gfc_define_undef_line, preprocessor_line, include_line): Likewise.
2836         (load_file, gfc_read_orig_filename): Likewise.
2837         * simplify.c (simplify_transformation_to_array): Likewise.
2838         (gfc_simplify_ibits, simplify_shift, gfc_simplify_ishftc, STRING):
2839         Likewise.
2840         (gfc_simplify_compiler_options): Likewise.
2841         * st.c (gfc_free_statement, gfc_free_statements): Likewise.
2842         (gfc_free_association_list): Likewise.
2843         * symbol.c (free_components, gfc_free_st_label, free_st_labels):
2844         Likewise.
2845         (gfc_delete_symtree, gfc_free_symbol, gfc_undo_symbols): Likewise.
2846         (free_old_symbol, gfc_commit_symbols, free_tb_tree): Likewise.
2847         (free_common_tree, free_uop_tree, free_sym_tree): Likewise.
2848         (gfc_free_dt_list, gfc_free_equiv_infos, gfc_free_equiv_lists):
2849         Likewise.
2850         (gfc_free_finalizer, gfc_free_charlen, free_entry_list): Likewise.
2851         (gfc_free_namespace): Likewise.
2852         * trans-array.c (gfc_free_ss, gfc_trans_array_bound_check): Likewise.
2853         (gfc_conv_array_ref, gfc_conv_ss_startstride): Likewise.
2854         (gfc_trans_dummy_array_bias, gfc_conv_array_parameter): Likewise.
2855         * trans-common.c (get_init_field, create_common): Likewise.
2856         * trans-const.c (gfc_build_wide_string_const): Likewise.
2857         (gfc_conv_string_init): Likewise.
2858         * trans-decl.c (gfc_generate_function_code): Likewise.
2859         * trans-expr.c (gfc_conv_substring, gfc_free_interface_mapping):
2860         Likewise.
2861         (SCALAR_POINTER, gfc_conv_statement_function): Likewise.
2862         (gfc_trans_subarray_assign): Likewise.
2863         * trans-intrinsic.c (conv_generic_with_optional_char_arg): Likewise.
2864         * trans-io.c (gfc_trans_io_runtime_check, set_string): Likewise.
2865         (transfer_namelist_element, transfer_array_component): Likewise.
2866         * trans-openmp.c (gfc_trans_omp_array_reduction): Likewise.
2867         * trans-stmt.c (cleanup_forall_symtrees, gfc_trans_forall_1): Likewise.
2868         * trans.c (trans_runtime_error_vararg, gfc_restore_backend_locus):
2869         Likewise.
2870
2871 2011-04-15  Jim Meyering  <meyering@redhat.com>
2872
2873         gfortran: remove cpp definition of free, ...
2874         in preparation for the s/gfc_free/free/ transformation.
2875         * gfortran.h (free): Remove macro definition that would otherwise
2876         prevent direct use of the function.
2877
2878 2011-04-18  Tobias Burnus  <burnus@net-b.de>
2879
2880         PR fortran/18918
2881         * array.c (gfc_match_array_ref): Check for too many codimensions.
2882         * check.c (gfc_check_image_index): Check number of elements
2883         in SUB argument.
2884         * simplify.c (gfc_simplify_image_index): Remove unreachable checks.
2885
2886 2011-04-18  Tobias Burnus  <burnus@net-b.de>
2887
2888         PR fortran/18918
2889         * iresolve.c (gfc_resolve_image_index): Set ts.type.
2890         * simplify.c (gfc_simplify_image_index): Don't abort if the bounds
2891         are not known at compile time and handle -fcoarray=lib.
2892         * trans-intrinsics.c (gfc_conv_intrinsic_function): Handle
2893         IMAGE_INDEX.
2894         (conv_intrinsic_cobound): Fix comment typo.
2895         (trans_this_image): New function.
2896         * trans-array.c (gfc_unlikely): Move to trans.c.
2897         * trans.c (gfc_unlikely): Function moved from trans-array.c.
2898         (gfc_trans_runtime_check): Use it.
2899         * trans-io.c (gfc_trans_io_runtime_check): Ditto.
2900         * trans.h (gfc_unlikely): Add prototype.
2901
2902 2011-04-18  Paul Thomas  <pault@gcc.gnu.org>
2903
2904         PR fortran/48462
2905         * trans-expr.c (fcncall_realloc_result): Renamed version of
2906         realloc_lhs_bounds_for_intrinsic_call that does not touch the
2907         descriptor bounds anymore but makes a temporary descriptor to
2908         hold the result.
2909         (gfc_trans_arrayfunc_assign): Modify the reference to above
2910         renamed function.
2911
2912 2011-05-17  Tobias Burnus  <burnus@net-b.de>
2913
2914         PR fortran/48624
2915         * trans-decl.c (gfc_get_extern_function_decl): Fix decl
2916         for external procedures with proc arguments.
2917
2918 2011-04-15  Michael Matz  <matz@suse.de>
2919
2920         * trans-array.c (toplevel): Include gimple.h.
2921         (gfc_trans_allocate_array_storage): Check flag_stack_arrays,
2922         properly expand variable length arrays.
2923         (gfc_trans_auto_array_allocation): If flag_stack_arrays create
2924         variable length decls and associate them with their scope.
2925         * gfortran.h (gfc_option_t): Add flag_stack_arrays member.
2926         * options.c (gfc_init_options): Handle -fstack_arrays option.
2927         * lang.opt (fstack-arrays): Add option.
2928         * invoke.texi (Code Gen Options): Document it.
2929         * Make-lang.in (trans-array.o): Depend on GIMPLE_H.
2930
2931 2011-04-15  Tobias Burnus  <burnus@net-b.de>
2932
2933         PR fortran/18918
2934         * trans-intrinsic.c (conv_intrinsic_cobound): Remove unused
2935         code which is also causing an ICE.
2936
2937 2011-04-14  Nathan Froyd  <froydnj@codesourcery.com>
2938
2939         * f95-lang.c (poplevel): Use BLOCK_CHAIN and block_chainon.
2940
2941 2011-04-12  Nathan Froyd  <froydnj@codesourcery.com>
2942
2943         * f95-lang.c (union lang_tree_node): Check for TS_COMMON before
2944         calling TREE_CHAIN.
2945
2946 2011-04-12  Paul Thomas  <pault@gcc.gnu.org>
2947
2948         PR fortran/48360
2949         PR fortran/48456
2950         * trans-array.c (get_std_lbound): For derived type variables
2951         return array valued component lbound.
2952
2953 2011-04-12  Martin Jambor  <mjambor@suse.cz>
2954
2955         * trans-decl.c (gfc_generate_function_code): Call
2956         cgraph_get_create_node instead of cgraph_node.
2957
2958 2011-04-11  Tobias Burnus  <burnus@net-b.de>
2959
2960         PR fortran/18918
2961         * simplify.c (simplify_bound_dim): Exit for
2962         ucobound's last dimension unless -fcoarray=single.
2963         * trans-array (gfc_conv_descriptor_size_1): Renamed from
2964         gfc_conv_descriptor_size, made static, has now from_dim and
2965         to_dim arguments.
2966         (gfc_conv_descriptor_size): Call gfc_conv_descriptor_size.
2967         (gfc_conv_descriptor_cosize): New function.
2968         * trans-array.h (gfc_conv_descriptor_cosize): New prototype.
2969         * trans-intrinsic.c (conv_intrinsic_cobound): Add input_location
2970         and handle last codim of ucobound for when -fcoarray is not "single".
2971
2972 2011-04-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
2973
2974         PR fortran/48448
2975         * gfortran.h (gfc_option_t):  Add warn_function_elimination and
2976         flag_frontend_optimize.
2977         * lang.opt (Wfunction-elimination):  Add.
2978         (ffrontend-optimize):  Add.
2979         * invoke.texi:  Add documentation for -Wfunction-elimination
2980         and -ffrontend-optimize.  Add -faggressive-function-elimination
2981         to list of code generation options.
2982         * frontend-passes.c (gfc_run_passes):  Run optimizations if
2983         flag_frontend_optimize is set.
2984         (warn_function_elimination):  New function.
2985         (cfe_expr_0):  Call it if requested to do so.
2986         * options.c (gfc_init_options):  Initiate warn_function_elimination
2987         and flag_frontend_optimize.
2988         (gfc_post_options):  Set flag_frontend_optimize if not specified
2989         by user, depending on the optimization level.
2990         (gfc_handle_option):  Handle -Wfunction-elimination and
2991         -ffrontend-optimize.
2992
2993 2011-04-06  Tobias Burnus  <burnus@net-b.de>
2994
2995         PR fortran/18918
2996         * trans-intrinsic.c (gfc_conv_intrinsic_function): Fix
2997         call for this_image.
2998
2999 2011-04-05  Nathan Froyd  <froydnj@codesourcery.com>
3000
3001         * trans-intrinsic.c (gfc_build_intrinsic_lib_fndecls): Use
3002         build_function_type_list instead of build_function_type.  Correct
3003         argument order for func_frexp and func_scalbn.
3004
3005 2011-04-05  Duncan Sands  <baldrick@free.fr>
3006
3007         * f95-lang.c (build_builtin_fntypes): Swap frexp parameter types.
3008
3009 2011-04-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
3010
3011         * frontend-passes: (optimize_lexical_comparison): New function.
3012         (optimize_expr): Call it.
3013         (optimize_comparison): Also handle lexical comparison functions.
3014         Return false instad of -2 for unequal comparison.
3015
3016 2011-04-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
3017
3018         PR fortran/48412
3019         * frontend-passes (cfe_expr_0):  Reverse the order of going
3020         through the loops.
3021
3022 2011-04-04  Tobias Burnus  <burnus@net-b.de>
3023             Mikael Morin  <mikael.morin@sfr.fr>
3024
3025         PR fortran/18918
3026         * check.c (is_coarray): Update - because of DIMEN_THIS_IMAGE.
3027         * expr.c (gfc_is_coindexed): Ditto.
3028         * gfortran.h (gfc_array_ref_dimen_type): Add DIMEN_THIS_IMAGE.
3029         * interface.c (compare_parameter): Use gfc_expr_attr and
3030         gfc_is_coindexed.
3031         * resolve.c (check_dimension, compare_spec_to_ref,
3032         resolve_allocate_expr, check_data_variable): Update for
3033         DIMEN_THIS_IMAGE.
3034         * simplify.c (gfc_simplify_lcobound, gfc_simplify_this_image,
3035         gfc_simplify_ucobound): Allow non-constant bounds.
3036         * trans-array.c (gfc_set_loop_bounds_from_array_spec,
3037         gfc_trans_create_temp_array, gfc_trans_constant_array_constructor,
3038         gfc_set_vector_loop_bounds, gfc_conv_array_index_offset,
3039         gfc_start_scalarized_body, gfc_trans_scalarizing_loops,
3040         gfc_trans_scalarized_loop_boundary, gfc_conv_section_startstride,
3041         gfc_conv_ss_startstride, gfc_conv_loop_setup,
3042         gfc_trans_array_bounds, gfc_conv_expr_descriptor,
3043         gfc_walk_variable_expr): Handle codimen.
3044         * trans-decl.c (gfc_build_qualified_array): Save cobounds.
3045         * trans-intrinsic.c (gfc_conv_intrinsic_bound): Use arg2.
3046         (conv_intrinsic_cobound): New function.
3047         (gfc_conv_intrinsic_function): Call it.
3048         (gfc_walk_intrinsic_function, gfc_add_intrinsic_ss_code): Handle
3049         ucobound, lcobound, this_image.
3050         * fortran/trans-types.c (gfc_build_array_type): Save cobounds.
3051         (gfc_get_dtype): Honour corank.
3052         (gfc_get_nodesc_array_type): Save corank and codimensions.
3053         (gfc_get_array_type_bounds): Save cobound.
3054         * fortran/trans.h (gfc_ss_info,gfc_loopinfo): Add codimen item.
3055         (gfc_array_kind): Add corank item.
3056         (GFC_TYPE_ARRAY_CORANK): New macro.
3057
3058 2011-04-03  Kai Tietz  <ktietz@redhat.com>
3059
3060         PR middle-end/48422
3061         * Make-lang.in (f95-lang.o): Add some missing dependencies.
3062
3063 2011-04-01  Thomas Koenig  <tkoenig@gcc.gnu.org>
3064
3065         PR fortran/48352
3066         * frontend-passes (cfe_register_funcs):  Don't
3067         register functions if they appear as iterators in DO loops.
3068
3069 2011-03-30  Michael Matz  <matz@suse.de>
3070
3071         PR fortran/47516
3072         * trans-expr.c (realloc_lhs_loop_for_fcn_call): Take loop as parameter,
3073         don't use local variable.
3074         (gfc_trans_arrayfunc_assign): Adjust caller.
3075
3076 2011-03-29  Janus Weil  <janus@gcc.gnu.org>
3077
3078         PR fortran/48095
3079         * decl.c (match_procedure_decl,match_ppc_decl): Set flavor of interface.
3080         * module.c (MOD_VERSION): Bump.
3081         (mio_typespec): Read/write 'interface' field.
3082         * primary.c (match_string_constant,match_logical_constant): Remove
3083         unneeded code.
3084         (match_complex_constant): Make sure to clear the typespec.
3085
3086 2011-03-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
3087
3088         * frontend-passes.c (create_var):  Warn about creating an
3089         array temporary if requested.
3090
3091 2011-03-27  Thomas Koenig  <tkoenig@gcc.gnu.org>
3092
3093         PR fortran/47065
3094         * frontend-passes.c (optimize_trim): Also follow references, except
3095         when they are substring references or array references.
3096
3097 2011-03-27  Tobias Burnus  <burnus@net-b.de>
3098
3099         PR fortran/18918
3100         * gfortran.h (gfc_isym_id): Rename GFC_ISYM_NUMIMAGES to
3101         GFC_ISYM_NUM_IMAGES.
3102         (gfc_fcoarray): Add GFC_FCOARRAY_LIB.
3103         * intrinsic.c (add_functions): Update due to GFC_ISYM_NUM_IMAGES
3104         rename.
3105         * invoke.texi (-fcoarray=): Document "lib" argument.
3106         * iresolve.c (gfc_resolve_this_image): Fix THIS IMAGE().
3107         * libgfortran.h (libgfortran_stat_codes): Add comments.
3108         * options.c (gfc_handle_coarray_option): Add -fcoarray=lib.
3109         * simplify.c (gfc_simplify_num_images, gfc_simplify_this_image):
3110         Handle GFC_FCOARRAY_LIB.
3111         * trans.h (gfc_init_coarray_decl): New prototype.
3112         (gfor_fndecl_caf_init, gfor_fndecl_caf_finalize,
3113         gfor_fndecl_caf_critical, gfor_fndecl_caf_end_critical,
3114         gfor_fndecl_caf_sync_all, gfor_fndecl_caf_sync_images,
3115         gfor_fndecl_caf_error_stop, gfor_fndecl_caf_error_stop_str,
3116         gfort_gvar_caf_num_images, gfort_gvar_caf_this_image):
3117         New global variables.
3118         * trans-decl.c: Declare several CAF functions (cf. above).
3119         (gfc_build_builtin_function_decls): Initialize those.
3120         (gfc_init_coarray_decl): New function.
3121         (create_main_function): Call CAF init/finalize functions.
3122         * trans-intrinsic.c (trans_this_image, trans_num_images): New.
3123         (gfc_conv_intrinsic_function): Call those.
3124         * trans-stmt.c (gfc_trans_stop, gfc_trans_sync, gfc_trans_critical):
3125         Add code for GFC_FCOARRAY_LIB.
3126
3127 2011-03-26  Janus Weil  <janus@gcc.gnu.org>
3128
3129         PR fortran/48291
3130         * class.c (get_unique_hashed_string): Adjust maximum allowable length
3131         for unique type string.
3132
3133 2011-03-25  Kai Tietz  <ktietz@redhat.com>
3134
3135         * scanner.c (preprocessor_line): Use filename_cmp
3136         instead of strcmp.
3137
3138 2011-03-25  Tobias Burnus  <burnus@net-b.de>
3139
3140         PR fortran/48174
3141         PR fortran/45304
3142         * trans-types.c (gfc_get_function_type): Don't use varargs if the
3143         procedure is known to have no arguments.
3144
3145 2011-03-21  Thomas Koenig  <tkoenig@gcc.gnu.org>
3146
3147         PR fortran/22572
3148         * gfortran.h (gfc_option_t) : Add
3149         flag_aggressive_function_elimination.
3150         (gfc_dep_compare_functions):  Add prototype.
3151         * lang.opt: Add faggressive-function-elimination.
3152         * invoke.texi: Document -faggressive-function-elimination.
3153         * frontend_passes (expr_array):  New static variable.
3154         (expr_size):  Likewise.
3155         (expr_count):  Likewise.
3156         (current_code):  Likewise.
3157         (current_ns):  Likewise.
3158         (gfc_run_passes):  Allocate and free space for expressions.
3159         (cfe_register_funcs):  New function.
3160         (create_var):  New function.
3161         (cfc_expr_0):  New function.
3162         (cfe_code):  New function.
3163         (optimize_namespace):  Invoke gfc_code_walker with cfe_code
3164         and cfe_expr_0.
3165         * dependency.c (gfc_dep_compare_functions):  New function.
3166         (gfc_dep_compare_expr):  Use it.
3167         * options.c (gfc_init_options):  Handle
3168         flag_aggressive_function_elimination.
3169         (gfc_handle_option):  Likewise.
3170
3171 2011-03-15  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3172
3173         * arith.c (arith_power): Plug memory leak.
3174
3175 2011-03-12  Janus Weil  <janus@gcc.gnu.org>
3176
3177         PR fortran/48059
3178         * trans-expr.c (gfc_apply_interface_mapping_to_expr): Replace base type
3179         for polymorphic arguments.
3180
3181 2011-03-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3182
3183         PR fortran/48054
3184         * intrinsic.texi: Clarify doc of logarithm functions.
3185
3186 2011-03-12  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3187
3188         PR fortran/47552
3189         * trans-intrinsic.c (gfc_conv_intrinsic_ctime): Fix type of
3190         the string length variable.
3191
3192 2011-03-11  Janus Weil  <janus@gcc.gnu.org>
3193
3194         PR fortran/47768
3195         * module.c (ab_attribute,attr_bits): Add AB_PROC_POINTER_COMP.
3196         (mio_symbol_attribute): Handle attribute 'proc_pointer_comp'.
3197
3198 2011-03-06  Paul Thomas  <pault@gcc.gnu.org>
3199             Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3200
3201         PR fortran/47850
3202         * expr.c (gfc_is_constant_expr): Only use gfc_constant_ac if
3203         the expression has an iterator.  Otherwise, iterate through the
3204         array, checking for constant expressions for each element.
3205
3206 2011-03-04  Janne Blomqvist  <jb@gcc.gnu.org>
3207
3208         PR libfortran/47802
3209         * intrinsic.texi: Update CTIME and FDATE documentation.
3210
3211 2011-03-03  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3212
3213         * invoke.texi (Option Summary, Fortran Dialect Options)
3214         (Preprocessing Options, Runtime Options, Code Gen Options):
3215         Fix vertical list spacing by using @itemx for additinoal
3216         items, empty line before @table.  Fix typos.
3217
3218 2011-02-28  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3219
3220         PR fortran/47894
3221         * intrinsic.texi: Fix doc of the VERIFY intrinsic.
3222
3223 2011-02-26  Tobias Burnus  <burnus@net-b.de>
3224
3225         PR fortran/47846
3226         * trans-stmt.c (gfc_trans_allocate): Fix allocation with
3227         type-spec of deferred-length strings.
3228
3229 2011-02-26  Tobias Burnus  <burnus@net-b.de>
3230
3231         PR fortran/47886
3232         * openmp.c (gfc_resolve_omp_directive): Resolve if()
3233         condition of OpenMP's task.
3234
3235 2011-02-26  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
3236
3237         PR fortran/47894
3238         * intrinsic.texi: Fix doc of the VERIFY intrinsic.
3239
3240 2011-02-24  Tobias Burnus  <burnus@net-b.de>
3241
3242         PR fortran/47872
3243         * intrinsic.texi (ALLOCATED, ATAN, BESSEL_JN, BESSEL_YN): Add
3244         multitable for linebreak between different syntax variants.
3245
3246 2011-02-24  Richard Guenther  <rguenther@suse.de>
3247
3248         PR fortran/47839
3249         * f95-lang.c (pushdecl): For externs in non-global scope push
3250         a copy of the decl into the BLOCK.
3251
3252 2011-02-23  Mikael Morin  <mikael@gcc.gnu.org>
3253
3254         PR fortran/40850
3255         * trans.c (gfc_prepend_expr_to_block): New function.
3256         * trans.h (gfc_prepend_expr_to_block): Declare.
3257         * trans-array.c (gfc_conv_array_parameter): Replace
3258         gfc_add_expr_to_block with gfc_prepend_expr_to_block.
3259
3260 2011-02-22  Paul Thomas  <pault@gcc.gnu.org>
3261
3262         PR fortran/45743
3263         * trans-decl.c (gfc_get_extern_function_decl): Don't use the
3264         gsymbol backend_decl if the procedure has a formal argument
3265         that is a procedure.
3266
3267 2011-02-22  Tobias Burnus  <burnus@net-b.de>
3268
3269         PR fortran/41359
3270         * trans-stmt.c (gfc_trans_if_1): Use correct line for
3271         expressions in the if condition.
3272
3273 2011-02-20  Tobias Burnus  <burnus@net-b.de>
3274
3275         PR fortran/47797
3276         * trans-decl.c (gfc_trans_deferred_vars): Use gfc_set_backend_locus and
3277         gfc_restore_backend_locus to have better debug locations.
3278         * trans-array.c (gfc_trans_deferred_array): Ditto.
3279
3280 2011-02-20  Paul Thomas  <pault@gcc.gnu.org>
3281
3282         PR fortran/45077
3283         PR fortran/44945
3284         * trans-types.c (gfc_get_derived_type): Remove code that looks
3285         for decls in gsym and add call to gfc_get_module_backend_decl.
3286         * trans.h : Add prototype for gfc_get_module_backend_decl.
3287         * trans-decl.c (gfc_get_module_backend_decl): New function.
3288         (gfc_get_symbol_decl): Call it.
3289
3290 2011-02-19  Paul Thomas  <pault@gcc.gnu.org>
3291
3292         PR fortran/47348
3293         * trans-array.c (get_array_ctor_all_strlen): Move up in file.
3294         (get_array_ctor_var_strlen): Add block dummy and add call to
3295         get_array_ctor_all_strlen instead of giving up on substrings.
3296         Call gcc_unreachable for default case.
3297         (get_array_ctor_strlen): Add extra argument to in call to
3298         get_array_ctor_var_strlen.
3299
3300 2011-02-18  Janus Weil  <janus@gcc.gnu.org>
3301
3302         PR fortran/47789
3303         * primary.c (gfc_match_structure_constructor): Handle empty parent
3304         types.
3305
3306 2011-02-18  Tobias Burnus
3307
3308         PR fortran/47775
3309         * trans-expr.c (arrayfunc_assign_needs_temporary): Use
3310         esym to check whether the specific procedure returns an
3311         allocatable or pointer.
3312
3313 2011-02-18  Michael Matz  <matz@suse.de>
3314
3315         PR fortran/45586
3316         * gfortran.h (struct gfc_component): Add norestrict_decl member.
3317         * trans.h (struct lang_type): Add nonrestricted_type member.
3318         * trans-expr.c (gfc_conv_component_ref): Search fields with correct
3319         parent type.
3320         * trans-types.c (mirror_fields, gfc_nonrestricted_type): New.
3321         (gfc_sym_type): Use it.
3322
3323 2011-02-18  Janus Weil  <janus@gcc.gnu.org>
3324
3325         PR fortran/47768
3326         * resolve.c (resolve_transfer): Reject variables with procedure pointer
3327         components.
3328
3329 2011-02-18  Janus Weil  <janus@gcc.gnu.org>
3330
3331         PR fortran/47767
3332         * gfortran.h (gfc_check_access): Removed prototype.
3333         (gfc_check_symbol_access): Added prototype.
3334         * module.c (gfc_check_access): Renamed to 'check_access', made static.
3335         (gfc_check_symbol_access): New function, basically a shortcut for
3336         'check_access'.
3337         (write_dt_extensions,write_symbol0,write_generic,write_symtree): Use
3338         'gfc_check_symbol_access'.
3339         (write_operator,write_module): Renamed 'gfc_check_access'.
3340         * resolve.c (resolve_fl_procedure,resolve_fl_derived,
3341         resolve_fl_namelist,resolve_symbol,resolve_fntype): Use
3342         'gfc_check_symbol_access'.
3343
3344 2011-02-16  Janus Weil  <janus@gcc.gnu.org>
3345
3346         PR fortran/47745
3347         * class.c (gfc_build_class_symbol): Set 'class_ok' attribute.
3348         * decl.c (build_sym,attr_decl1): Move setting of 'class_ok' into
3349         'gfc_build_class_symbol'.
3350         (gfc_match_decl_type_spec): Reject unlimited polymorphism.
3351         * interface.c (matching_typebound_op): Check for 'class_ok' attribute.
3352         * match.c (select_type_set_tmp): Move setting of 'class_ok' into
3353         'gfc_build_class_symbol'.
3354         * primary.c (gfc_variable_attr): Check for 'class_ok' attribute.
3355
3356 2011-02-15  Steven G. Kargl  <kargl@gcc.gnu.org>
3357
3358         PR fortran/47633
3359         . simplify.c (gfc_simplify_compiler_version): Fix off-by-one issue.
3360
3361 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
3362
3363         PR fortran/47730
3364         * parse.c (gfc_build_block_ns): Commit 'block@' symbol.
3365
3366 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
3367
3368         PR fortran/47728
3369         * class.c (gfc_build_class_symbol): Give a fatal error on polymorphic
3370         arrays.
3371         * primary.c (gfc_match_varspec): Avoid ICE for invalid class
3372         declaration.
3373
3374 2011-02-14  Janus Weil  <janus@gcc.gnu.org>
3375
3376         PR fortran/47349
3377         * interface.c (get_expr_storage_size): Handle derived-type components.
3378
3379 2011-02-13  Tobias Burnus  <burnus@net-b.de>
3380
3381         PR fortran/47569
3382         * interface.c (compare_parameter): Avoid ICE with
3383         character components.
3384
3385 2011-02-12  Janus Weil  <janus@gcc.gnu.org>
3386
3387         * class.c (gfc_build_class_symbol): Reject polymorphic arrays.
3388         * decl.c (build_sym,build_struct,attr_decl1): Use return value of
3389         'gfc_build_class_symbol'.
3390
3391 2011-02-12  Michael Matz  <matz@suse.de>
3392             Janus Weil  <janus@gcc.gnu.org>
3393             Tobias Burnus  <burnus@net-b.de>
3394
3395         PR fortran/45586
3396         * trans-expr.c (conv_parent_component_references): Avoid unintendent
3397         skipping of parent compounds.
3398
3399 2011-02-11  Tobias Burnus  <burnus@net-b.de>
3400
3401         PR fortran/47550
3402         * resolve.c (resolve_formal_arglist): PURE with VALUE
3403         and no INTENT: Add -std= diagnostics.
3404
3405 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
3406
3407         PR fortran/47352
3408         * resolve.c (resolve_procedure_interface): If interface has a result
3409         variable, copy the typespec and set result pointer to self.
3410
3411 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
3412
3413         PR fortran/47463
3414         * resolve.c (resolve_typebound_subroutine): Remove erroneous line.
3415
3416 2011-02-09  Janus Weil  <janus@gcc.gnu.org>
3417
3418         PR fortran/47637
3419         * trans-decl.c (init_intent_out_dt): Handle CLASS arguments.
3420
3421 2011-02-08  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
3422
3423         * io.c (match_io_element): Do not set dt if not inquire.
3424
3425 2011-02-08  Janus Weil  <janus@gcc.gnu.org>
3426
3427         PR fortran/45290
3428         * expr.c (gfc_check_assign_symbol): Reject pointers as pointer
3429         initialization target.
3430
3431 2011-02-07  Janne Blomqvist  <jb@gcc.gnu.org>
3432             Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3433
3434         * gfortran.texi (Thread-safety): texinfo styling fixes.
3435         * intrinsic.texi: Likewise.
3436
3437 2011-02-06  Janne Blomqvist  <jb@gcc.gnu.org>
3438
3439         * gfortran.texi (Compiler Characteristics): Add reference to
3440         thread-safety section.
3441
3442 2011-02-06  Janne Blomqvist  <jb@gcc.gnu.org>
3443
3444         * gfortran.texi (Thread-safety): New section.
3445         * intrinsic.texi (EXECUTE_COMMAND_LINE): Mention thread-safety.
3446         (GETENV): Likewise.
3447         (GET_ENVIRONMENT_VARIABLE): Likewise.
3448         (SYSTEM): Likewise.
3449
3450 2011-02-06  Paul Thomas  <pault@gcc.gnu.org>
3451
3452         PR fortran/47592
3453         * trans-stmt.c (gfc_trans_allocate): For deferred character
3454         length allocations with SOURCE, store to the values and string
3455         length to avoid calculating twice.  Replace gfc_start_block
3456         with gfc_init_block to avoid unnecessary contexts and to keep
3457         declarations of temporaries where they should be. Tidy up the
3458         code a bit.
3459
3460 2011-02-05  Janne Blomqvist  <jb@gcc.gnu.org>
3461
3462         PR fortran/42434
3463         * intrinsic.texi (SYSTEM_CLOCK): Update documentation.
3464
3465 2011-02-02  Janus Weil  <janus@gcc.gnu.org>
3466             Paul Thomas  <pault@gcc.gnu.org>
3467
3468         PR fortran/47082
3469         * trans-expr.c (gfc_trans_class_init_assign): Add call to
3470         gfc_get_derived_type.
3471         * module.c (read_cleanup): Do not use unique_symtrees for vtabs
3472         or vtypes.
3473
3474 2011-02-02  Janus Weil  <janus@gcc.gnu.org>
3475
3476         PR fortran/47572
3477         * resolve.c (resolve_fl_variable): Handle polymorphic allocatables.
3478
3479 2011-02-01  Janus Weil  <janus@gcc.gnu.org>
3480
3481         PR fortran/47565
3482         * trans-expr.c (gfc_conv_structure): Handle constructors for procedure
3483         pointer components with allocatable result.
3484
3485 2011-01-31  Janus Weil  <janus@gcc.gnu.org>
3486
3487         PR fortran/47455
3488         * trans-expr.c (gfc_conv_procedure_call): Handle procedure pointers
3489         with pointer or allocatable result.
3490
3491 2011-01-31  Paul Thomas  <pault@gcc.gnu.org>
3492
3493         PR fortran/47519
3494         * trans-stmt.c (gfc_trans_allocate): Improve handling of
3495         deferred character lengths with SOURCE.
3496         * iresolve.c (gfc_resolve_repeat): Calculate character
3497         length from source length and ncopies.
3498         * dump-parse-tree.c (show_code_node): Show MOLD and SOURCE
3499         expressions for ALLOCATE.
3500
3501 2011-01-31  Janus Weil  <janus@gcc.gnu.org>
3502
3503         PR fortran/47463
3504         * resolve.c (resolve_typebound_subroutine): Bug fix for the case of
3505         an argument of a typebound assignment being a component.
3506
3507 2011-01-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
3508
3509         * gfortranspec.c (add_arg_libgfortran) [HAVE_LD_STATIC_DYNAMIC] Use
3510         LD_STATIC_OPTION, LD_DYNAMIC_OPTION.
3511
3512 2011-01-31  Tobias Burnus  <burnus@net-b.de>
3513
3514         PR fortran/47042
3515         * resolve.c (resolve_fl_procedure): Reject stmt functions
3516         with pointer/allocatable attribute.
3517
3518 2011-01-31  Tobias Burnus  <burnus@net-b.de>
3519
3520         PR fortran/47042
3521         * interface.c (gfc_procedure_use): Add explicit interface check for
3522         pointer/allocatable functions.
3523
3524 2011-01-30  Paul Thomas  <pault@gcc.gnu.org>
3525
3526         PR fortran/47523
3527         * trans-expr.c (gfc_trans_assignment_1): If the rhs is an op
3528         expr and is assigned to a deferred character length scalar,
3529         make sure that the function is called before reallocation,
3530         so that the length is available. Include procedure pointer
3531         and procedure pointer component rhs as well.
3532
3533         PR fortran/45170
3534         PR fortran/35810
3535         PR fortran/47350
3536         * gfortran.dg/allocatable_function_5.f90: New test not added by
3537         mistake on 2011-01-28.
3538
3539 2011-01-29  Tobias Burnus  <burnus@net-b.de>
3540
3541         PR fortran/47531
3542         * check.c (gfc_check_shape): Support kind argument in SHAPE.
3543         * intrinsic.c (add_functions): Ditto.
3544         * resolve.c (gfc_resolve_shape): Ditto.
3545         * simplify.c (gfc_simplify_shape): Ditto.
3546         * intrinsic.h (gfc_check_shape, gfc_resolve_shape,
3547         gfc_simplify_shape): Update prototypes.
3548         * intrinisc.text (SHAPE): Document kind argument.
3549
3550 2011-01-28  Tobias Burnus  <burnus@net-b.de>
3551
3552         PR fortran/47507
3553         * resolve.c (resolve_formal_arglist): Allow arguments with VALUE
3554         attribute also without INTENT.
3555
3556 2011-01-28  Tobias Burnus  <burnus@net-b.de>
3557
3558         * gfortran.texi (Fortran 2003 status): Mention support for
3559         nonconstant namelist variables.
3560
3561 2011-01-28  Paul Thomas  <pault@gcc.gnu.org>
3562             Tobias Burnus  <burnus@gcc.gnu.org>
3563
3564         PR fortran/45170
3565         PR fortran/35810
3566         PR fortran/47350
3567         * interface.c (compare_actual_formal): An allocatable or pointer
3568         deferred length actual is only allowed if the formal argument
3569         is also deferred length. Clean up whitespace.
3570         * trans-expr.c (gfc_conv_procedure_call): Pass string length for
3571         deferred character length formal arguments by reference. Do the
3572         same for function results.
3573         (gfc_trans_pointer_assignment): Do not do runtime check of lhs
3574         and rhs character lengths, if deferred length lhs.  In this case
3575         set the lhs character length to that of the rhs.
3576         (gfc_conv_string_parameter): Remove assert that string length is
3577         an integer type.
3578         (is_scalar_reallocatable_lhs): New function.
3579         (alloc_scalar_allocatable_for_assignment): New function.
3580         (gfc_trans_assignment_1): Call above new function. If the rhs is
3581         a deferred character length itself, makes ure that the function
3582         is called before reallocation, so that the length is available.
3583         (gfc_trans_asssignment): Remove error about assignment to
3584         deferred length character variables.
3585         * gfortran.texi : Update entry about (re)allocation on
3586         assignment.
3587         * trans-stmt.c (gfc_trans_allocate): Add code to handle deferred
3588         length character variables.
3589         * module.c (mio_typespec): Transfer deferred characteristic.
3590         * trans-types.c (gfc_get_function_type): New code to generate
3591         hidden typelist, so that those character lengths that are
3592         passed by reference get the right type.
3593         * resolve.c (resolve_contained_fntype): Supress error for
3594         deferred character length functions.
3595         (resolve_function, resolve_fl_procedure) The same.
3596         (check_symbols): Remove the error that support for
3597         entity with deferred type parameter is not yet implemented.
3598         (resolve_fl_derived): The same.
3599         match.c (alloc_opt_list): Allow MOLD for deferred length object.
3600         * trans-decl.c (gfc_get_symbol_decl): For deferred character
3601         length dummies, generate a local variable for string length.
3602         (create_function_arglist): Hidden length can be a pointer.
3603         (gfc_trans_deferred_vars): For deferred character length
3604         results and dummies, assign the string length to the local
3605         variable from the hidden argument on entry and the other way
3606         round on exit, as appropriate.
3607
3608 2011-01-27  Tobias Burnus  <burnus@net-b.de>
3609
3610         PR fortran/47474
3611         * trans-decl.c (gfc_generate_function_code): Fix init
3612         of allocatable result variable with allocatable components.
3613
3614 2011-01-27  Tobias Burnus  <burnus@net-b.de>
3615
3616         PR fortran/47472
3617         * options.c (gfc_handle_module_path_options): Save
3618         module path without trailing slash as include path.
3619
3620 2011-01-25  Tobias Burnus  <burnus@net-b.de>
3621
3622         PR fortran/47448
3623         * interface.c (gfc_check_operator_interface): Fix
3624         defined-assignment check.
3625
3626 2011-01-23  Tobias Burnus  <burnus@net-b.de>
3627
3628         PR fortran/47421
3629         * trans-decl.c (gfc_trans_deferred_vars): Do not nullify
3630         scalar allocatable dummy arguments.
3631
3632 2011-01-22  Thomas Koenig  <tkoenig@gcc.gnu.org>
3633
3634         PR fortran/38536
3635         * resolve.c (gfc_iso_c_func_interface):  For C_LOC,
3636         check for array sections followed by component references
3637         which are illegal.  Also check for coindexed arguments.
3638
3639 2011-01-22  Tobias Burnus  <burnus@net-b.de>
3640
3641         PR fortran/47399
3642         * primary.c (gfc_match_varspec): Relax gcc_assert to allow for
3643         PARAMETER TBP.
3644
3645 2011-01-21  Tobias Burnus  <burnus@net-b.de>
3646
3647         PR fortran/47394
3648         * error.c (gfc_error_now, gfc_fatal_error, gfc_error_check):
3649         Use defined instead of magic number exit status codes.
3650         * scanner.c (include_line, gfc_new_file): Ditto.
3651
3652 2011-01-21  Tobias Burnus  <burnus@net-b.de>
3653
3654         PR fortran/47377
3655         * expr.c (gfc_check_pointer_assign): Reject expr data-targets
3656         without pointer attribute.
3657
3658 2011-01-18  Janus Weil  <janus@gcc.gnu.org>
3659
3660         PR fortran/47240
3661         * resolve.c (expression_rank): Fix rank of procedure poiner components.
3662         * trans-expr.c (gfc_conv_procedure_call): Take care of procedure
3663         pointer components as actual arguments.
3664
3665 2011-01-17  Jakub Jelinek  <jakub@redhat.com>
3666
3667         PR fortran/47331
3668         * gfortran.h (struct gfc_omp_saved_state): New type.
3669         (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New prototypes.
3670         * resolve.c (resolve_global_procedure): Call it around gfc_resolve
3671         call.
3672         * openmp.c (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New
3673         functions.
3674
3675 2011-01-17  Tobias Burnus  <burnus@net-b.de>
3676
3677         PR fortran/47327
3678         * invoke.texi (Options to request or suppress errors
3679         and warnings): Fix cross link.
3680
3681 2011-01-15  Tobias Burnus  <burnus@net-b.de>
3682
3683         * gfortran.texi: Update Fortran 2003 Status section.
3684
3685         PR fortran/47177
3686         * invoke.texi: Add missing "-E" to the -dM example.
3687
3688 2011-01-13  Tobias Burnus  <burnus@net-b.de>
3689
3690         PR fortran/47268
3691         * intrinsic.texi (get_command_argument, get_environment_variable):
3692         Mark arguments as optional in the Arguments section.
3693
3694 2011-01-13  Kai Tietz  <kai.tietz@onevision.com>
3695             Tobias Burnus  <burnus@net-b.de>
3696
3697         PR fortran/47260
3698         * trans-decl.c (gfc_get_extern_function_decl,
3699         build_function_decl): Set TREE_PUBLIC/TREE_EXTERNAL before
3700         calling decl_attributes.
3701
3702 2011-01-13  Tobias Burnus  <burnus@net-b.de>
3703             Mikael Morin  <mikael@gcc.gnu.org>
3704
3705         PR fortran/45848
3706         PR fortran/47204
3707         * gfortran.h (gfc_code): Move union ext's case_list into
3708         the struct block.
3709         * dump-parse-tree.c (show_code_node): Adapt by prefixing case_list
3710         by "block.".
3711         * frontend-passes.c (gfc_code_walker): Ditto.
3712         * match.c (gfc_match_goto, gfc_match_call, gfc_match_case,
3713         gfc_match_type_is, gfc_match_class_is): Ditto.
3714         * resolve.c (resolve_select, resolve_select_type): Ditto.
3715         * st.c (gfc_free_statement): Ditto.
3716         * trans-stmt.c (gfc_trans_integer_select, gfc_trans_logical_select,
3717         gfc_trans_character_select): Ditto.
3718         * parse.c (resolve_all_program_units): For error recovery, avoid
3719         segfault is proc_name is NULL.
3720
3721 2011-01-11  Paul Thomas  <pault@gcc.gnu.org>
3722
3723         PR fortran/47051
3724         * trans-array.c (gfc_alloc_allocatable_for_assignment): Change
3725         to be standard compliant by testing for shape rather than size
3726         before skipping reallocation. Improve comments.
3727
3728 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
3729
3730         PR fortran/47224
3731         * resolve.c (resolve_actual_arglist): Remove unneeded and buggy piece
3732         of code.
3733
3734 2011-01-09  Thomas Koenig  <tkoenig@gcc.gnu.org>
3735
3736         PR fortran/38536
3737         * resolve.c (is_scalar_expr_ptr):  For a substring reference,
3738         use gfc_dep_compare_expr to compare start and end expession.
3739         Add FIXME for using gfc_deb_compare_expr elsewhere.
3740
3741 2011-01-09  Janus Weil  <janus@gcc.gnu.org>
3742
3743         PR fortran/46313
3744         * class.c (get_unique_type_string): Make type name start with upper
3745         case letter.
3746
3747 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
3748
3749         PR fortran/46405
3750         * invoke.texi:  Mention -ffree-line-length-none and
3751         -ffixed-line-length-none for preprocessing.
3752
3753 2011-01-08  Paul Thomas  <pault@gcc.gnu.org>
3754
3755         PR fortran/46896
3756         * trans-expr.c (gfc_conv_procedure_call): With a non-copying
3757         procedure argument (eg TRANSPOSE) use a temporary if there is
3758         any chance of aliasing due to host or use association.
3759         (arrayfunc_assign_needs_temporary): Correct logic for function
3760         results and do not use a temporary for implicitly PURE
3761         variables.  Use a temporary for Cray pointees.
3762         * symbol.c (gfc_add_save): Explicit SAVE not compatible with
3763         implicit pureness of containing procedure.
3764         * decl.c (match_old_style_init, gfc_match_data): Where decl
3765         would fail in PURE procedure, set implicit_pure to zero.
3766         * gfortran.h : Add implicit_pure to structure symbol_attr and
3767         add prototype for function gfc_implicit_pure.
3768         * expr.c (gfc_check_pointer_assign, gfc_check_vardef_context):
3769         Where decl would fail in PURE procedure, reset implicit_pure.
3770         * io.c (match_vtag, gfc_match_open, gfc_match_close,
3771         gfc_match_print, gfc_match_inquire, gfc_match_wait): The same.
3772         * match.c (gfc_match_critical, gfc_match_stopcode,
3773         sync_statement, gfc_match_allocate, gfc_match_deallocate): The
3774         same.
3775         * parse.c (decode_omp_directive): The same.
3776         (parse_contained): If not PURE, set implicit pure attribute.
3777         * resolve.c (resolve_formal_arglist, resolve_structure_cons,
3778         resolve_function, resolve_ordinary_assign) : The same.
3779         (gfc_implicit_pure): New function.
3780         * module.c (mio_symbol_attribute): Introduce AB_IMPLICIT_PURE
3781         to ab_attribute enum and use it in this function.
3782
3783 2011-01-08  Thomas Koenig  <tkoenig@gcc.gnu.org>
3784
3785         PR fortran/45777
3786         * symbol.c (gfc_symbols_could_alias):  Strip gfc_ prefix,
3787         make static and move in front of its only caller, to ...
3788         * trans-array.c (symbols_could_alias): ... here.
3789         Pass information about pointer and target status as
3790         arguments.  Allocatable arrays don't alias anything
3791         unless they have the POINTER attribute.
3792         (gfc_could_be_alias):  Keep track of pointer and target
3793         status when following references.  Also check if typespecs
3794         of components match those of other components or symbols.
3795
3796 2011-01-07  Tobias Burnus  <burnus@net-b.de>
3797
3798         PR fortran/41580
3799         * class.c (gfc_build_class_symbol): Mark __vtab as attr.vtab.
3800         * intrinsic.c (add_functions): Use simplify functions for
3801         EXTENDS_TYPE_OF and SAME_TYPE_AS.
3802         * intrinsic.h (gfc_simplify_extends_type_of,
3803         gfc_simplify_same_type_as): New prototypes.
3804         * simplify.c (is_last_ref_vtab, gfc_simplify_extends_type_of,
3805         gfc_simplify_same_type_as): New functions.
3806
3807 2011-01-07  Janus Weil  <janus@gcc.gnu.org>
3808
3809         PR fortran/47189
3810         PR fortran/47194
3811         * gfortran.h (gfc_lval_expr_from_sym): Moved prototype.
3812         * class.c (gfc_class_null_initializer): Initialize _vptr to declared
3813         type.
3814         * expr.c (gfc_lval_expr_from_sym): Moved here from symbol.c.
3815         * resolve.c (resolve_deallocate_expr): _data component will be added
3816         at translation stage.
3817         * symbol.c (gfc_lval_expr_from_sym): Moved to expr.c.
3818         * trans-stmt.c (gfc_trans_deallocate): Reset _vptr to declared type.
3819
3820 2011-01-06  Daniel Franke  <franke.daniel@gmail.com>
3821
3822         PR fortran/33117
3823         PR fortran/46478
3824         * parse.c (parse_interface): Remove check for procedure types.
3825         * interface.c (check_interface0): Verify that procedures are
3826         either all SUBROUTINEs or all FUNCTIONs.
3827
3828 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
3829
3830         PR fortran/47180
3831         * trans-expr.c (gfc_trans_class_assign): Bugfix for r168524 (make sure
3832         'vtab' is initialized).
3833
3834 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
3835
3836         PR fortran/47180
3837         * trans-expr.c (gfc_trans_class_assign): For a polymorphic NULL pointer
3838         assignment, set the _vptr component to the declared type.
3839
3840 2011-01-05  Thomas Koenig  <tkoenig@gcc.gnu.org>
3841
3842         PR fortran/46017
3843         * resolve.c (resolve_allocate_deallocate): Follow references to
3844         check for duplicate occurence of allocation/deallocation objects.
3845
3846 2011-01-05  Janus Weil  <janus@gcc.gnu.org>
3847
3848         PR fortran/47024
3849         * trans-decl.c (gfc_trans_deferred_vars): Initialize the _vpr component
3850         of polymorphic allocatables according to their declared type.
3851
3852 2011-01-04  Janus Weil  <janus@gcc.gnu.org>
3853
3854         PR fortran/46448
3855         * class.c (gfc_find_derived_vtab): Set the module field for the copying
3856         routine to make sure it receives module name mangling.
3857
3858 2011-01-03  Jakub Jelinek  <jakub@redhat.com>
3859
3860         * gfortranspec.c (lang_specific_driver): Update copyright notice
3861         dates.
3862
3863 2011-01-03  Janus Weil  <janus@gcc.gnu.org>
3864
3865         * intrinsic.texi (LEADZ): Fix example.
3866
3867 2011-01-02  Janus Weil  <janus@gcc.gnu.org>
3868
3869         PR fortran/46408
3870         * class.c (gfc_find_derived_vtab): Use EXEC_INIT_ASSIGN for __copy_
3871         routine.
3872
3873 \f
3874 Copyright (C) 2011 Free Software Foundation, Inc.
3875
3876 Copying and distribution of this file, with or without modification,
3877 are permitted in any medium without royalty provided the copyright
3878 notice and this notice are preserved.