OSDN Git Service

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