OSDN Git Service

2014-04-29 Thomas Koenig <tkoenig@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / ChangeLog
1 2014-04-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
2
3         PR fortran/60522
4         * frontend-passes.c (cfe_code):  Do not walk subtrees
5         for WHERE.
6
7 2014-03-20  Tobias Burnus  <burnus@net-b.de>
8
9         PR fortran/60543
10         PR fortran/60283
11         * gfortran.h (gfc_unset_implicit_pure): New prototype.
12         * resolve.c (gfc_unset_implicit_pure): New.
13         (resolve_structure_cons, resolve_function,
14         pure_subroutine, resolve_ordinary_assign): Use it.
15         * decl.c (match_old_style_init, gfc_match_data,
16         match_pointer_init, variable_decl): Ditto.
17         * expr.c (gfc_check_pointer_assign): Ditto.
18         * intrinsic.c (gfc_intrinsic_sub_interface): Ditto.
19         * io.c (match_vtag, gfc_match_open, gfc_match_close,
20         match_filepos, gfc_match_inquire, gfc_match_print,
21         gfc_match_wait, check_io_constraints): Ditto.
22         * match.c (gfc_match_critical, gfc_match_stopcode,
23         lock_unlock_statement, sync_statement, gfc_match_allocate,
24         gfc_match_deallocate): Ditto.
25         * parse.c (decode_omp_directive): Ditto.
26         * symbol.c (gfc_add_save): Ditto.
27
28 2014-03-09  Janus Weil  <janus@gcc.gnu.org>
29
30         Backport from 4.8
31         2014-03-08  Janus Weil  <janus@gcc.gnu.org>
32
33         PR fortran/60450
34         * simplify.c (gfc_simplify_shape): Only clear shape if it was really
35         created successfully.
36
37 2014-03-02  Mikael Morin  <mikael@gcc.gnu.org>
38
39         PR fortran/60341
40         * frontend-passes.c (optimize_comparison): Guard two union accesses
41         with the corresponding tag checks.
42
43 2014-02-22  Mikael Morin  <mikael@gcc.gnu.org>
44
45         PR fortran/59599
46         * trans-intrinsic.c (gfc_conv_intrinsic_ichar): Calculate the
47         number of arguments.
48
49 2014-02-20  Janus Weil  <janus@gcc.gnu.org>
50
51         Backport from mainline
52         2014-02-17  Janus Weil  <janus@gcc.gnu.org>
53
54         PR fortran/55907
55         * resolve.c (build_default_init_expr): Don't initialize character
56         variable if -fno-automatic is given.
57
58 2014-02-08  Mikael Morin  <mikael@gcc.gnu.org>
59
60         PR fortran/57033
61         * primary.c (gfc_convert_to_structure_constructor): Avoid null pointer
62         dereference.
63
64 2014-02-08  Paul Thomas  <pault@gcc.gnu.org>
65
66         PR fortran/59906
67         * trans-array.c (gfc_add_loop_ss_code): In the case of character
68         SS_REFERENCE, use gfc_conv_string_parameter to ensure that a
69         pointer to the string is stored.
70         * trans-expr.c (gfc_conv_expr_reference): Likewise, use
71         gfc_conv_string_parameter to ensure that a pointer to is passed
72         to the elemental function.
73
74 2014-02-03  Janus Weil  <janus@gcc.gnu.org>
75
76         PR fortran/59941
77         * expr.c (replace_comp): Check for isym to avoid ICE.
78
79 2014-01-27  Mikael Morin  <mikael@gcc.gnu.org>
80
81         PR fortran/58007
82         * module.c (skip_list): Don't use default argument value.
83         (load_derived_extensions, read_module): Update callers.
84
85 2014-01-26  Mikael Morin  <mikael@gcc.gnu.org>
86
87         PR fortran/58007
88         * module.c (fp2, find_pointer2): Remove.
89         (mio_component_ref): Don't forcedfully set the containing derived type
90         symbol for loading.  Remove unused argument.
91         (mio_ref): Update caller
92         (skip_list): New argument nest_level.  Initialize level with the new
93         argument.
94         (read_module): Add forced pointer components association for derived
95         type symbols.
96
97 2014-01-11  Janus Weil  <janus@gcc.gnu.org>
98
99         Backport from mainline
100         2013-12-29  Janus Weil  <janus@gcc.gnu.org>
101
102         PR fortran/59612
103         PR fortran/57042
104         * dump-parse-tree.c (show_typespec): Check for charlen.
105         * invoke.texi: Fix documentation of -fdump-fortran-optimized and
106         -fdump-parse-tree.
107
108 2013-11-17  Paul Thomas  <pault@gcc.gnu.org>
109
110         PR fortran/58771
111         * trans-io.c (transfer_expr): If the backend_decl for a derived
112         type is missing, build it with gfc_typenode_for_spec.
113
114 2013-11-02  Janus Weil  <janus@gcc.gnu.org>
115
116         Backport from mainline
117         2013-09-23  Janus Weil  <janus@gcc.gnu.org>
118
119         PR fortran/58355
120         * decl.c (check_extended_derived_type): Prevent segfault, modify error
121         message.
122
123 2013-08-11  Janus Weil  <janus@gcc.gnu.org>
124
125         Backport from trunk:
126         2013-08-09  Janus Weil  <janus@gcc.gnu.org>
127
128         PR fortran/58058
129         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Free the temporary
130         string, if necessary.
131
132 2013-07-08  Tobias Burnus  <burnus@net-b.de>
133
134         PR fortran/57785
135         * simplify.c (compute_dot_product): Complex conjugate for
136         dot_product.
137         (gfc_simplify_dot_product, gfc_simplify_matmul): Update call.
138
139 2013-06-06  Tobias Burnus  <burnus@net-b.de>
140
141         Backport from mainline
142         2012-08-27  Tobias Burnus  <burnus@net-b.de>
143
144         PR fortran/54370
145         * trans-stmt.c (gfc_trans_do_while): Don't change the logical
146         kind for negation of the condition.
147
148 2013-06-01  Janus Weil  <janus@gcc.gnu.org>
149             Tobias Burnus  <burnus@net-b.de>
150
151         PR fortran/57217
152         * interface.c (check_dummy_characteristics): Symmetrize type check.
153
154 2013-05-22  Janne Blomqvist  <jb@gcc.gnu.org>
155
156         * intrinsic.texi (RANDOM_SEED): Improve example.
157
158 2013-05-07  Tobias Burnus  <burnus@net-b.de>
159
160         Backport from mainline
161         2013-05-02  Tobias Burnus  <burnus@net-b.de>
162
163         PR fortran/57142
164         * simplify.c (gfc_simplify_size): Renamed from
165         simplify_size; fix kind=8 handling.
166         (gfc_simplify_size): New function.
167         (gfc_simplify_shape): Add range check.
168         * resolve.c (resolve_function): Fix handling
169         for ISYM_SIZE.
170
171 2013-04-26  Janus Weil  <janus@gcc.gnu.org>
172
173         Backports from trunk:
174
175         PR fortran/56968
176         * expr.c (gfc_check_pointer_assign): Handle generic functions returning
177         procedure pointers.
178
179         PR fortran/53685
180         PR fortran/57022
181         * check.c (gfc_calculate_transfer_sizes): Fix for array-valued SOURCE
182         expressions.
183         * target-memory.h (gfc_element_size): New prototype.
184         * target-memory.c (size_array): Remove.
185         (gfc_element_size): New function.
186         (gfc_target_expr_size): Modified to always return the full size of the
187         expression.
188
189 2013-04-18  Tobias Burnus  <burnus@net-b.de>
190
191         PR fortran/56994
192         * invoke.texi (NEAREST): S argument is not optional.
193
194 2013-04-11  Release Manager
195
196         * GCC 4.7.3 released.
197
198 2013-03-15  Tobias Burnus  <burnus@net-b.de>
199
200         PR fortran/56615
201         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Pack arrays
202         if they are not simply contiguous.
203
204 2013-03-13  Paul Thomas  <pault@gcc.gnu.org>
205
206         PR fortran/56575
207         * expr.c (gfc_default_initializer): Check that a class declared
208         type has any components.
209         * resolve.c (resolve_fl_derived0): On failing the test for C437
210         set the type to BT_UNKNOWN to prevent repeat error messages.
211
212 2013-03-10  Paul Thomas  <pault@gcc.gnu.org>
213
214         PR fortran/55362
215         * check.c (array_check): It is an error if a procedure is
216         passed.
217
218 2013-02-22  Janus Weil  <janus@gcc.gnu.org>
219
220         PR fortran/56385
221         * trans-array.c (structure_alloc_comps): Handle procedure-pointer
222         components with allocatable result.
223
224 2013-02-17  Tobias Burnus  <burnus@net-b.de>
225             Mikael Morin  <mikael@gcc.gnu.org>
226
227         Backport from trunk
228         2013-01-28  Tobias Burnus  <burnus@net-b.de>
229                     Mikael Morin  <mikael@gcc.gnu.org>
230
231         PR fortran/53537
232         * symbol.c (gfc_find_sym_tree): Don't look for the symbol outside an
233         interface block.
234         (gfc_get_ha_symtree): Let gfc_find_sym_tree lookup the parent namespace.
235         * decl.c (gfc_match_data_decl): Ditto.
236         (variable_decl): Remove undeclared type error.
237         (gfc_match_import): Use renamed instead of original name.
238
239 2013-02-15  Tobias Burnus  <burnus@net-b.de>
240             Mikael Morin  <mikael@gcc.gnu.org>
241
242         PR fortran/56318
243         * simplify.c (gfc_simplify_matmul): Fix result shape
244         and matmul result.
245
246 2013-02-02  Thomas Koenig  <tkoenig@gcc.gnu.org>
247
248         Backport from trunk
249         PR fortran/50627
250         PR fortran/56054
251         * decl.c (gfc_match_end):  Remove half-ready namespace
252         from parent if the end of a block is missing.
253         * parse.c (parse_module):  Do not put namespace into
254         gsymbol on error.
255
256 2013-02-01  Jakub Jelinek  <jakub@redhat.com>
257
258         Backported from mainline
259         2013-01-23  Jakub Jelinek  <jakub@redhat.com>
260
261         PR fortran/56052
262         * trans-decl.c (gfc_get_symbol_decl): Set DECL_ARTIFICIAL
263         and DECL_IGNORED_P on select_type_temporary and don't set
264         DECL_BY_REFERENCE.
265
266 2013-01-24  Janus Weil  <janus@gcc.gnu.org>
267
268         PR fortran/56081
269         * resolve.c (resolve_select): Add argument 'select_type', reject
270         non-scalar expressions.
271         (resolve_select_type,resolve_code): Pass new argument to
272         'resolve_select'.
273
274 2013-01-17  Janus Weil  <janus@gcc.gnu.org>
275
276         PR fortran/55983
277         * class.c (find_typebound_proc_uop): Check for f2k_derived instead of
278         asserting it.
279
280 2013-01-13  Janus Weil  <janus@gcc.gnu.org>
281
282         PR fortran/55072
283         * trans-array.c (gfc_conv_array_parameter): No packing was done for
284         full arrays of derived type.
285
286 2013-01-13  Paul Thomas  <pault@gcc.gnu.org>
287
288         PR fortran/55618
289         * trans-expr.c (gfc_conv_procedure_call): Dereference scalar
290         character function arguments to elemental procedures in
291         scalarization loops.
292
293 2013-01-08  Mikael Morin  <mikael@gcc.gnu.org>
294
295         PR fortran/42769
296         PR fortran/45836
297         PR fortran/45900
298         * module.c (read_module): Don't reuse local symtree if the associated
299         symbol isn't exactly the one wanted.  Don't reuse local symtree if it is
300         ambiguous.
301         * resolve.c (resolve_call): Use symtree's name instead of symbol's to
302         lookup the symtree.
303
304 2013-01-07  Tobias Burnus  <burnus@net-b.de>
305             Thomas Koenig  <tkoenig@gcc.gnu.org>
306             Jakub Jelinek  <jakub@redhat.com>
307
308         PR fortran/55852
309         * expr.c (gfc_build_intrinsic_call): Avoid clashes
310         with user's procedures.
311         * gfortran.h (gfc_build_intrinsic_call): Update prototype.
312         (GFC_PREFIX): Define.
313         * simplify.c (gfc_simplify_size): Update call.
314
315 2013-01-07  Steven G. Kargl  <kargl@gcc.gnu.org>
316             Mikael Morin  <mikael@gcc.gnu.org>
317
318         PR fortran/55827
319         * class.c (gfc_fix_class_refs): Adapt ts initialization for the case
320         e->symtree == NULL.
321         * trans-expr.c (gfc_conv_function_expr): Init sym earlier. Use it.
322
323 2012-12-20  Tobias Burnus  <burnus@net-b.de>
324
325         PR fortran/54818
326         * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Ensure that
327         the string length is of type gfc_charlen_type_node.
328
329 2012-11-24  Thomas Koenig  <tkoenig@gcc.gnu.org>
330
331         PR fortran/55314
332         Backport from trunk
333         * resolve.c (resolve_allocate_deallocate):  Compare all
334         subscripts when deciding if to reject a (de)allocate
335         statement.
336
337 2012-11-23  Janus Weil  <janus@gcc.gnu.org>
338
339         PR fortran/55352
340         * trans-decl.c (generate_local_decl): Don't warn for explicitly imported
341         but unused module variables which are in a namelist or common block.
342
343 2012-11-06  Janus Weil  <janus@gcc.gnu.org>
344
345         PR fortran/54917
346         * target-memory.c (gfc_target_expr_size,gfc_target_interpret_expr):
347         Handle BT_CLASS.
348
349 2012-10-14  Janus Weil  <janus@gcc.gnu.org>
350
351         PR fortran/54784
352         * trans-stmt.c (gfc_trans_allocate): Correctly determine the reference
353         to the _data component for polymorphic allocation with SOURCE.
354
355 2012-09-20  Release Manager
356
357         * GCC 4.7.2 released.
358
359 2012-09-13  Tobias Burnus  <burnus@net-b.de>
360
361         PR fortran/54556
362         * resolve.c (resolve_formal_arglist): Allow VALUE arguments
363         with implicit_pure.
364         (gfc_impure_variable): Don't check gfc_pure such that the
365         function also works for gfc_implicit_pure procedures.
366
367 2012-09-12  Tobias Burnus  <burnus@net-b.de>
368
369         PR fortran/54225
370         PR fortran/53306
371         * array.c (match_subscript, gfc_match_array_ref): Fix
372         diagnostic of coarray's '*'.
373
374 2012-09-10  Janus Weil  <janus@gcc.gnu.org>
375
376         PR fortran/54435
377         PR fortran/54443
378         * match.c (gfc_match_select_type): Make sure to only access CLASS_DATA
379         for BT_CLASS.
380
381 2012-09-08  Mikael Morin  <mikael@gcc.gnu.org>
382
383         PR fortran/54208
384         * simplify.c (simplify_bound_dim): Resolve array spec before
385         proceeding with simplification.
386
387 2012-07-06  Mikael Morin  <mikael@gcc.gnu.org>
388
389         PR fortran/53732
390         * trans-array.c (gfc_add_loop_ss_code): Disable self recursive calls
391         handling nested loop(s) if the subscript flag is true.
392
393 2012-06-22  Tobias Burnus  <burnus@net-b.de>
394
395         Backport from mainline
396         2012-06-17  Tobias Burnus  <burnus@net-b.de>
397
398         PR fortran/53691
399         PR fortran/53685
400         * check.c (gfc_calculate_transfer_sizes): Return if
401         SIZE= is not constant or source-size cannot be determined.
402
403 2012-06-14  Tobias Burnus  <burnus@net-b.de>
404
405         Backport from mainline
406         2012-06-04  Tobias Burnus  <burnus@net-b.de>
407
408         PR fortran/50619
409         * resolve.c (build_default_init_expr): Don't initialize
410         ASSOCIATE names.
411
412 2012-06-14  Tobias Burnus  <burnus@net-b.de>
413
414         PR fortran/53597
415         * decl.c (match_attr_spec): Only mark module variables
416         as SAVE_IMPLICIT for Fortran 2008 and later.
417
418 2012-06-14  Release Manager
419
420         * GCC 4.7.1 released.
421
422 2012-06-01  Tobias Burnus  <burnus@net-b.de>
423
424         PR fortran/53521
425         * trans.c (gfc_deallocate_scalar_with_status): Properly
426         handle the case size == 0.
427
428 2012-05-23  Tobias Burnus  <burnus@net-b.de>
429
430         PR fortran/53389
431         * trans-array.c (gfc_add_loop_ss_code): Don't evaluate expression, if
432         ss->is_alloc_lhs is set.
433
434 2012-05-07  Tobias Burnus  <burnus@net-b.de>
435
436         Backport from mainline:
437         2012-05-07  Tobias Burnus  <burnus@net-b.de>
438
439         PR fortran/53255
440         * resolve.c (resolve_typebound_static): Fix handling
441         of overridden specific to generic operator.
442
443 2012-05-05  Tobias Burnus  <burnus@net-b.de>
444
445         Backport from mainline:
446         2012-05-04  Tobias Burnus  <burnus@net-b.de>
447
448         PR fortran/53111
449         * resolve.c (resolve_fl_derived): Fix -std=f95
450         diagnostic for generic vs. DT names.
451
452 2012-05-02  Tobias Burnus  <burnus@net-b.de>
453
454         Backport from mainline
455         2012-04-12  Tobias Burnus  <burnus@net-b.de>
456
457         PR fortran/52864
458         * expr.c (gfc_check_vardef_context): Fix assignment check for
459         pointer components.
460
461 2012-04-30  Thomas Koenig  <tkoenig@gcc.gnu.org>
462
463         PR fortran/53148
464         Backport from trunk
465         * frontend-passes.c (create_var):  If the statement has a label,
466         put the label around the block.
467
468 2012-04-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
469
470         PR fortran/52893
471         Backport from trunk
472         * frontend-passes.c:  Keep track of wether we are in an implicit
473         DO loop; do not do function elimination if we are.
474
475 2012-04-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
476
477         PR fortran/52668
478         Backport from trunk
479         * module.c:  Only mark symbols as use_only if they have been
480         imported via an only list.
481
482 2012-03-22  Tobias Burnus  <burnus@net-b.de>
483
484         PR fortran/52452
485         * resolve.c (resolve_intrinsic): Don't search for a
486         function if we know that it is a subroutine.
487
488 2012-03-22  Release Manager
489
490         * GCC 4.7.0 released.
491
492 2012-03-10  Tobias Burnus  <burnus@net-b.de>
493
494         PR fortran/52469
495         * trans-types.c (gfc_get_function_type): Handle backend_decl
496         of a procedure pointer.
497
498 2012-02-29  Paul Thomas  <pault@gcc.gnu.org>
499
500         PR fortran/52386
501         * trans-expr.c (fcncall_realloc_result): Dereference the
502         descriptor if needed.
503
504 2012-02-22  Tobias Burnus  <burnus@net-b.de>
505
506         PR fortran/52335
507         * io.c (gfc_match_open): Remove bogus F2003 DELIM= check.
508
509 2012-02-18  Tobias Burnus  <burnus@net-b.de>
510
511         PR fortran/52295
512         * interface.c (check_interface0): Internal procs in
513         generic interfaces are allowed in Fortran 2008.
514
515 2012-02-17  Tobias Burnus  <burnus@net-b.de>
516             Roland Stigge  <stigge@antcom.de>
517
518         PR translation/52273
519         * interface.c (compare_actual_formal): Fix typo "at at".
520
521 2012-02-17  Tobias Burnus  <burnus@net-b.de>
522
523         * gfortran.texi (Q exponent-letter): Fix grammar.
524
525 2012-02-17  Tobias Burnus  <burnus@net-b.de>
526
527         * gfortran.texi (Status): Fix typos.
528         * invoke.texi (ffixed-form, fstack-arrays): Spell Fortran with
529         a majuscule.
530
531 2012-02-17  Tobias Burnus  <burnus@net-b.de>
532             Roland Stigge  <stigge@antcom.de>
533
534         PR translation/52232
535         PR translation/52234
536         PR translation/52245
537         PR translation/52246
538         PR translation/52262
539         PR translation/52273
540         * io.c (gfc_match_open): Fix typo.
541         * interface.c (compare_actual_formal): Ditto.
542         * lang.opt (freal-4-real-8, freal-4-real-16, freal-8-real-16): Ditto.
543         * match.c (alloc_opt_list, gfc_match_nullify): Ditto.
544         * check.c (gfc_check_associated, gfc_check_null): Ditto.
545
546 2012-02-12  Mikael Morin  <mikael@gcc.gnu.org>
547
548         PR fortran/50981
549         * trans-stmt.c (gfc_get_proc_ifc_for_call): New function.
550         (gfc_trans_call): Use gfc_get_proc_ifc_for_call.
551
552 2012-02-12  Mikael Morin  <mikael@gcc.gnu.org>
553
554         * trans-array.c (gfc_walk_elemental_function_args,
555         gfc_walk_function_expr): Move call to gfc_get_proc_ifc_for_expr out
556         of gfc_walk_elemental_function_args.
557         * trans-stmt.c (gfc_trans_call): Ditto.
558         * trans-array.h (gfc_get_proc_ifc_for_expr): New prototype.
559         (gfc_walk_elemental_function_args): Update prototype.
560
561 2012-02-12  Mikael Morin  <mikael@gcc.gnu.org>
562
563         * trans-array.c (gfc_get_proc_ifc_for_expr): New function.
564         (gfc_walk_elemental_function_args): Move code to
565         gfc_get_proc_ifc_for_expr and call it.
566
567 2012-02-08  Tobias Burnus  <burnus@net-b.de>
568
569         PR fortran/52151
570         * trans-expr.c (fcncall_realloc_result): Set also the stride.
571
572 2012-02-07  Tobias Burnus  <burnus@net-b.de>
573
574         PR fortran/51514
575         * trans-expr.c (gfc_conv_procedure_call): Add _data component
576         for calls of scalar CLASS actuals to TYPE dummies.
577
578 2012-02-05  Thomas König  <tkoenig@gcc.gnu.org>
579
580         PR fortran/48847
581         * trans-decl.c:  Warn about unused dummy procedure arguments
582         if -Wunused-dummy-argument is specified.  Suppress middle-end
583         warnings about procedure arguments.
584
585 2012-02-05  Paul Thomas  <pault@gcc.gnu.org>
586
587         * trans-array.c (gfc_array_allocate): Zero memory for all class
588         array allocations.
589         * trans-stmt.c (gfc_trans_allocate): Ditto for class scalars.
590
591         PR fortran/52102
592         * trans-stmt.c (gfc_trans_allocate): Before correcting a class
593         array reference, ensure that 'dataref' points to the _data
594         component that is followed by the array reference..
595
596 2012-02-02  Mikael Morin  <mikael@gcc.gnu.org>
597
598         PR fortran/41587
599         PR fortran/46356
600         PR fortran/51754
601         PR fortran/50981
602         * class.c (insert_component_ref, class_data_ref_missing,
603         gfc_fix_class_refs): New functions.
604         * gfortran.h (gfc_fix_class_refs): New prototype.
605         * trans-expr.c (gfc_conv_expr): Remove special case handling and call
606         gfc_fix_class_refs instead.
607
608 2012-02-02  Paul Thomas  <pault@gcc.gnu.org>
609
610         PR fortran/52012
611         * trans-expr.c (fcncall_realloc_result): If variable shape is
612         correct, retain the bounds, whatever they are.
613
614 2012-02-02  Tobias Burnus  <burnus@net-b.de>
615
616         PR fortran/52093
617         * simplify.c (gfc_simplify_size): Handle INTRINSIC_PARENTHESES.
618
619 2012-02-01  Thomas König  <tkoenig@gcc.gnu.org>
620
621         PR fortran/51958
622         * frontend-passes.c (convert_elseif):  New function.
623         (optimize_namespace):  Call it.
624
625 2012-02-01  Tobias Burnus  <burnus@net-b.de>
626
627         PR fortran/52024
628         * module.c (MOD_VERSION): Bump.
629         (mio_typebound_proc): Read/write is_operator from/to the
630         .mod file.
631
632 2012-02-01  Tobias Burnus  <burnus@net-b.de>
633
634         PR fortran/52059
635         * trans-expr.c (gfc_conv_procedure_call): Add array ref
636         only to variables.
637
638 2012-01-31  Tobias Burnus  <burnus@net-b.de>
639
640         PR fortran/52024
641         * gfortran.h (gfc_tbp_generic): Store whether the
642         generic is an operator.
643         * decl.c (gfc_match_generic): Set that flag.
644         * resolve.c (check_generic_tbp_ambiguity): Use it in the
645         gfc_compare_interfaces check.
646
647 2012-01-31  Tobias Burnus  <burnus@net-b.de>
648
649         PR fortran/52029
650         * class.c (gfc_find_derived_vtab): Mark _copy function as pure.
651
652 2012-01-31  Tobias Burnus  <burnus@net-b.de>
653
654         PR fortran/52013
655         * class.c (get_unique_hashed_string): Adapt trim length.
656         (gfc_build_class_symbol) Encode also corank in the container name.
657
658 2012-01-31  Paul Thomas  <pault@gcc.gnu.org>
659
660         PR fortran/52012
661         * trans-expr.c (fcncall_realloc_result): Correct calculation of
662         result offset.
663
664 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
665
666         * module.c (pointer_info): Make true_name and module pointers
667         rather than arrays, order pointers before other fields.
668         (free_pi_tree): free true_name and module as well.
669         (mio_read_string): Rename to read_string.
670         (mio_write_string): Remove.
671         (load_commons): Use read_string.
672         (read_module): Use read_string rather than mio_internal_string.
673         (write_blank_common): Call write_atom directly.
674         (write_symbol): Likewise.
675
676 2012-01-29  Tobias Burnus  <burnus@net-b.de>
677
678         PR fortran/41600
679         * expr.c (gfc_default_initializer): Convert the values if
680         the type does not match.
681
682 2012-01-29  Tobias Burnus  <burnus@net-b.de>
683
684         PR fortran/51972
685         * trans-array.c (structure_alloc_comps): Fix assignment of
686         polymorphic components (polymorphic deep copying).
687
688 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
689
690         PR fortran/51808
691         * decl.c (set_binding_label): Make binding_label argument const.
692         (curr_binding_label): Constify.
693         * gfortran.h (gfc_symbol): Constify binding_label.
694         (gfc_common_head): Likewise.
695         (get_iso_c_sym): Likewise.
696         * match.c (gfc_match_name_C): Constify buffer argument.
697         * match.h (gfc_match_name_C): Likewise.
698         * resolve.c (set_name_and_label): Constify binding_label argument.
699         (gfc_iso_c_sub_interface): Constify binding_label variable.
700         * symbol.c (get_iso_c_sym): Constify binding_label argument.
701
702 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
703
704         PR fortran/51808
705         * decl.c (set_binding_label): Move prototype from match.h to here.
706         (curr_binding_label): Make a pointer rather than static array.
707         (build_sym): Check sym->binding_label pointer rather than array,
708         update set_binding_label call, handle curr_binding_label changes.
709         (set_binding_label): Handle new curr_binding_label, dest_label
710         double ptr, and sym->binding_label.
711         (verify_bind_c_sym): Handle sym->binding_label being a pointer.
712         (set_verify_bind_c_sym): Check sym->binding_label pointer rather
713         than array, update set_binding_label call.
714         (gfc_match_bind_c_stmt): Handle curr_binding_label change.
715         (match_procedure_decl): Update set_binding_label call.
716         (gfc_match_bind_c): Change binding_label to pointer, update
717         gfc_match_name_C call.
718         * gfortran.h (GFC_MAX_BINDING_LABEL_LEN): Remove macro.
719         (gfc_symbol): Make binding_label a pointer.
720         (gfc_common_head): Likewise.
721         * match.c (gfc_match_name_C): Heap allocate bind(C) name.
722         * match.h (gfc_match_name_C): Change prototype argument.
723         (set_binding_label): Move prototype to decl.c.
724         * module.c (struct pointer_info): Make binding_label a pointer.
725         (free_pi_tree): Free unused binding_label.
726         (mio_read_string): New function.
727         (mio_write_string): New function.
728         (load_commons): Redo reading of binding_label.
729         (read_module): Likewise.
730         (write_common_0): Change to write empty string instead of name if
731         no binding_label.
732         (write_blank_common): Write empty string for binding label.
733         (write_symbol): Change to write empty string instead of name if no
734         binding_label.
735         * resolve.c (gfc_iso_c_func_interface): Don't set binding_label.
736         (set_name_and_label): Make binding_label double pointer, use
737         asprintf.
738         (gfc_iso_c_sub_interface): Make binding_label a pointer.
739         (resolve_bind_c_comms): Handle cases if
740         gfc_common_head->binding_label is NULL.
741         (gfc_verify_binding_labels): sym->binding_label is a pointer.
742         * symbol.c (gfc_new_symbol): Rely on XCNEW zero init for
743         binding_label.
744         (gen_special_c_interop_ptr): Don't set binding label.
745         (generate_isocbinding_symbol): Insert binding_label into symbol
746         table.
747         (get_iso_c_sym): Use pointer assignment instead of strcpy.
748         * trans-common.c (gfc_sym_mangled_common_id): Handle
749         com->binding_label being a pointer.
750         * trans-decl.c (gfc_sym_mangled_identifier): Handle
751         sym->binding_label being a pointer.
752         (gfc_sym_mangled_function_id): Likewise.
753
754 2012-01-29  Tobias Burnus  <burnus@net-b.de>
755
756         PR fortran/52038
757         * resolve.c (symbol_as): Remove unused, accidentally
758         added function.
759
760 2012-01-28  Tobias Burnus  <burnus@net-b.de>
761
762         PR fortran/51972
763         * trans-stmt.c (gfc_trans_allocate): Properly check whether
764         we have a BT_CLASS which needs to be memset.
765
766 2012-01-27  Tobias Burnus  <burnus@net-b.de>
767
768         PR fortran/52022
769         * trans-expr.c (gfc_conv_procedure_call): Fix passing
770         of functions, which return allocatables.
771
772 2012-01-27  Tobias Burnus  <burnus@net-b.de>
773
774         PR fortran/52016
775         * resolve.c (resolve_formal_arglist): Fix elemental
776         constraint checks for polymorphic dummies also for
777         pointers.
778
779 2012-01-27  Tobias Burnus  <burnus@net-b.de>
780
781         PR fortran/51970
782         PR fortran/51977
783         * primary.c (gfc_match_varspec. gfc_match_rvalue): Set
784         handle array spec for BT_CLASS.
785         * expr.c (gfc_get_variable_expr, gfc_lval_expr_from_sym)
786         * frontend-passes.c (create_var): Ditto.
787         * resolve.c (resolve_actual_arglist, resolve_assoc_var): Ditto.
788         * trans-decl.c (gfc_trans_deferred_vars): Use class_pointer
789         instead of attr.pointer.
790         (gfc_generate_function_code): Use CLASS_DATA (sym) for BT_CLASS.
791         * trans-intrinsic.c (conv_intrinsic_move_alloc): Move assert.
792         * trans-stmt.c (trans_associate_var): Ask for the descriptor.
793
794 2012-01-27  Tobias Burnus  <burnus@net-b.de>
795
796         PR fortran/51953
797         * match.c (gfc_match_allocate): Allow more than allocate
798         object with SOURCE=.
799
800 2012-01-27  Tobias Burnus  <burnus@net-b.de>
801
802         PR fortran/52016
803         * resolve.c (resolve_formal_arglist): Fix elemental
804         constraint checks for polymorphic dummies.
805
806 2012-01-27  Paul Thomas  <pault@gcc.gnu.org>
807             Tobias Burnus <burnus@gcc.gnu.org>
808
809         PR fortran/48705
810         PR fortran/51870
811         PR fortran/51943
812         PR fortran/51946
813         * trans-array.c (gfc_array_init_size): Add two extra arguments
814         to convey the dynamic element size of a calls object and to
815         return the number of elements that have been allocated.
816         (gfc_array_allocate): Add the same arguments and use them to
817         call gfc_array_init_size.  Before the allocation dereference
818         the data pointer, if necessary. Set the allocated array to zero
819         if the class element size or expr3 are non-null.
820         * trans-expr.c (gfc_conv_class_to_class): Give this function
821         global scope.
822         (get_class_array_ref): New function.
823         (gfc_copy_class_to_class): New function.
824         * trans-array.h : Update prototype for gfc_array_allocate.
825         * trans-stmt.c (gfc_trans_allocate): For non-variable class
826         STATUS expressions extract the class object and the dynamic
827         element size. Use the latter to call gfc_array_allocate and
828         the former for setting the vptr and, via
829         gfc_copy_class_to_clasfc_cs, to copy to the allocated data.
830         * trans.h : Prototypes for gfc_get_class_array_ref,
831         gfc_copy_class_to_class and gfc_conv_class_to_class.
832
833 2012-01-25  Tobias Burnus  <burnus@net-b.de>
834
835         * resolve.c (symbol_as): Check also for attr.class_ok.
836
837 2012-01-25  Tobias Burnus  <burnus@net-b.de>
838
839         PR fortran/51995
840         * class.c (gfc_build_class_symbol): Fix invalid freeing
841         issue with fclass->f2k_derived.
842
843 2012-01-25  Tobias Burnus  <burnus@net-b.de>
844
845         PR fortran/51995
846         * class.c (gfc_build_class_symbol): Ensure that
847         fclass->f2k_derived is set.
848
849 2012-01-25  Tobias Burnus  <burnus@net-b.de>
850
851         PR fortran/51966
852         * resolve.c (resolve_structure_cons): Only create an
853         array constructors for nonscalars.
854
855 2012-01-23  Tobias Burnus  <burnus@net-b.de>
856
857         PR fortran/51948
858         * check.c (variable_check): Fix checking for
859          variables and deeply nested BLOCKs.
860
861 2012-01-21  Tobias Burnus  <burnus@net-b.de>
862             Steven G. Kargl  <kargl@gcc.gnu.org>
863
864         PR fortran/50556
865         * symbol.c (check_conflict): namelist-group-name cannot have the SAVE
866         attribute.
867
868 2012-01-21  Tobias Burnus  <burnus@net-b.de>
869
870         PR fortran/51913
871         * interface.c (compare_parameter): Fix CLASS comparison.
872
873 2012-01-20  Tobias Burnus  <burnus@net-b.de>
874             Janus Weil  <janus@gcc.gnu.org>
875
876         PR fortran/51056
877         * module.c (load_needed, read_module): Don't mark __vtab etc.
878         as use_only.
879
880 2012-01-19  Tobias Burnus  <burnus@net-b.de>
881
882         PR fortran/51904
883         * expr.c (gfc_build_intrinsic_call): Also set the symtree.
884
885 2012-01-18  Paul Thomas  <pault@gcc.gnu.org>
886
887         PR fortran/51634
888         * trans-expr.c (gfc_conv_procedure_call): Deallocate allocatable
889         components of temporary class arguments.
890
891 2012-01-17  Tobias Burnus  <burnus@net-b.de>
892             Janne Blomqvist  <jb@gcc.gnu.org>
893
894         PR fortran/51869
895         * trans-expr.c (alloc_scalar_allocatable_for_assignment): Nullify
896         LHS after allocation, if it has allocatable components.
897         * f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_CALLOC.
898
899 2012-01-16  Mikael Morin  <mikael@gcc.gnu.org>
900             Tobias Burnus  <burnus@net-b.de>
901
902         PR fortran/50981
903         * trans-array.c (gfc_walk_elemental_function_args): Fix
904         passing of deallocated allocatables/pointers as absent argument.
905
906 2012-01-16  Tobias Burnus  <burnus@net-b.de>
907
908         PR fortran/51809
909         * class.c (gfc_find_derived_vtab): Mark __vtab and
910         __def_init as FL_VARIABLE not as FL_PARAMETER.
911         * expr.c (gfc_simplify_expr): Remove special
912         handling of __vtab.
913         * resolve.c (resolve_values): Ditto.
914         * trans-decl.c (gfc_get_symbol_decl): Mark __vtab
915         and __def_init as TREE_READONLY.
916
917 2012-01-16  Zydrunas Gimbutas  <gimbutas@cims.nyu.edu>
918         Andreas Kloeckner  <kloeckner@cims.nyu.edu>
919         Steven G. Kargl  <kargl@gcc.gnu.org>
920
921         PR fortran/48426
922         * gfortran.h (gfc_option_t): Add members flag_*_kind to store kind.
923         * lang.opt: Add options -freal-4-real-8, -freal-4-real-10,
924         -freal-4-real-16, -freal-8-real-4, -freal-8-real-10, -freal-8-real-16
925         and -finteger-4-integer-8. User-desired type conversion information.
926         * decl.c (gfc_match_old_kind_spec,kind_expr): Type conversions
927         in declaration parsing.
928         * trans-types.c (gfc_init_kinds): User-specified type conversion
929         checked for current backend.
930         * primary.c (match_integer_constant,match_real_constant): Implement
931         type conversion in constant parsing.
932         * options.c (gfc_init_options,gfc_handle_option): Translate input
933         options to flags in internal options data structure.
934         * invoke.texi: Document new options.  Re-order options in Options
935         summary section.
936
937 2012-01-16  Paul Thomas  <pault@gcc.gnu.org>
938
939         * trans-array.c (gfc_trans_create_temp_array): In the case of a
940         class array temporary, detect a null 'eltype' on entry and use
941         'initial' to provde the class reference and so, through the
942         vtable, the element size for the dynamic type.
943         * trans-stmt.c (gfc_conv_elemental_dependencies): For class
944         expressions, set 'eltype' to null and pass the values via the
945         'initial' expression.
946
947 2012-01-14  Tobias Burnus  <burnus@net-b.de>
948
949         PR fortran/51800
950         * resolve.c (build_default_init_expr): Also initialize
951         nonconstant-length strings with -finit-character=<n>.
952
953 2011-01-14  Tobias Burnus  <burnus@net-b.de>
954
955         PR fortran/51816
956         * module.c (read_module): Don't make nonexisting
957         intrinsic operators as found.
958         (rename_list_remove_duplicate): New function.
959         (gfc_use_modules): Use it.
960
961 2012-01-13  Paul Thomas  <pault@gcc.gnu.org>
962
963         PR fortran/48351
964         * trans-array.c (structure_alloc_comps): Suppress interative
965         call to self, when current component is deallocated using
966         gfc_trans_dealloc_allocated.
967         * class.c (gfc_build_class_symbol): Copy the 'alloc_comp'
968         attribute from the declared type to the class structure.
969
970 2012-01-13  Tobias Burnus  <burnus@net-b.de>
971
972         PR fortran/51842
973         * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
974         instead of a signed int of size POINTER_SIZE for
975         gfc_index_integer_kind.
976
977 2012-01-12  Tobias Burnus  <burnus@net-b.de>
978
979         PR fortran/36755
980         * intrinsic.texi (CHMOD): Extend a bit and remove statement
981         that /bin/chmod is called.
982
983 2012-01-10  Gerald Pfeifer  <gerald@pfeifer.com>
984
985         * gfortran.texi (Fortran 2003 Status): Fix grammar.
986
987 2012-01-10  Tobias Burnus  <burnus@net-b.de>
988
989         PR fortran/51652
990         * resolve.c (resolve_allocate_expr): For non-deferred char lengths,
991         check whether type-spec matches declaration.
992
993 2012-01-10  Tobias Burnus  <burnus@net-b.de>
994
995         * resolve.c (resolve_ordinary_assign): Improve error wording.
996
997 2012-01-09  Paul Thomas  <pault@gcc.gnu.org>
998
999         PR fortran/51791
1000         * interface.c (matching_typebound_op): Drill down through
1001         possible parentheses to obtain base expression. Do not test for
1002         'class_ok' but, instead for the class structure components.
1003         * resolve.c (resolve_ordinary_assign): Extend error message for
1004         polymorphic assignment to advise checking for specific
1005         subroutine.
1006
1007         PR fortran/51792
1008         * resolve.c (resolve_typebound_function): Restore 'static' to
1009         declaration.
1010
1011 2012-01-09  Mikael Morin  <mikael@gcc.gnu.org>
1012
1013         PR fortran/51758
1014         * trans-array.c (gfc_walk_elemental_function_args):
1015         Skip over NULL() actual arguments.
1016
1017 2012-01-09  Tobias Burnus  <burnus@net-b.de>
1018
1019         * gfortran.texi: Bump copyright year.
1020         (Fortran 2003 Status): Update polymorphism item, add
1021         item for generic interface with DT name.
1022
1023 2012-01-09  Tobias Burnus  <burnus@net-b.de>
1024
1025         PR fortran/51578
1026         * gfortran.h (gfc_use_list):
1027         * match.h (gfc_use_module): Rename to ...
1028         (gfc_use_modules): ... this.
1029         * module.c (use_locus, specified_nonint, specified_int): Remove
1030         global variable.
1031         (module_name): Change type to const char*, used with gfc_get_string.
1032         (module_list): New global variable.
1033         (free_rename): Free argument not global var.
1034         (gfc_match_use): Save match to module_list.
1035         (load_generic_interfaces, read_module): Don't free symtree.
1036         (write_dt_extensions, gfc_dump_module): Fix module-name I/O due to the
1037         type change of module_name.
1038         (write_symbol0, write_generic): Optimize due to the type change.
1039         (import_iso_c_binding_module, use_iso_fortran_env_module): Use
1040         locus of rename->where.
1041         (gfc_use_module): Take module_list as argument.
1042         (gfc_use_modules): New function.
1043         (gfc_module_init_2, gfc_module_done_2): Init module_list, rename_list.
1044         * parse.c (last_was_use_stmt): New global variable.
1045         (use_modules): New function.
1046         (decode_specification_statement, decode_statement): Move USE match up
1047         and call use_modules.
1048         (next_free, next_fixed): Call use_modules.
1049         (accept_statement): Don't call gfc_module_use.
1050
1051 2012-01-06  Tobias Burnus <burnus@net-b.de>
1052
1053         * trans-openmp.c (gfc_omp_clause_dtor, gfc_trans_omp_array_reduction):
1054         Update call to gfc_trans_dealloc_allocated.
1055         * trans.c (gfc_allocate_using_malloc): Fix spacing.
1056         (gfc_allocate_allocatable): For gfc_allocate_using_lib, jump to
1057         label_finish when an error occurs.
1058         (gfc_deallocate_with_status): Call caf_deregister for -fcoarray=lib.
1059         * trans.h (gfc_allocate_allocatable, gfc_deallocate_with_status):
1060         Update prototype.
1061         (gfor_fndecl_caf_deregister): New tree symbol.
1062         * trans-expr.c (gfc_conv_procedure_call): Update
1063         gfc_deallocate_with_status and gfc_trans_dealloc_allocated calls.
1064         * trans-array.c (gfc_array_allocate, gfc_trans_dealloc_allocated,
1065         structure_alloc_comps, gfc_trans_deferred_array): Ditto.
1066         (gfc_array_deallocate): Handle coarrays with -fcoarray=lib.
1067         * trans-array.h (gfc_array_deallocate, gfc_array_allocate,
1068         gfc_trans_dealloc_allocated): Update prototypes.
1069         * trans-stmt.c (gfc_trans_sync): Fix indentation.
1070         (gfc_trans_allocate): Fix errmsg padding and label handling.
1071         (gfc_trans_deallocate): Ditto and handle -fcoarray=lib.
1072         * expr.c (gfc_is_coarray): Fix algorithm for BT_CLASS.
1073         * libgfortran.h (GFC_STAT_STOPPED_IMAGE): Use large value
1074         to avoid other stats accidentally matching this one.
1075         * trans-decl.c (gfor_fndecl_caf_deregister): New global var.
1076         (gfc_build_builtin_function_decls): Fix prototype decl of caf_register
1077         and add decl for caf_deregister.
1078         (gfc_trans_deferred_vars): Handle CAF vars with -fcoarrays=lib.
1079         * trans-intrinsic.c (conv_intrinsic_move_alloc): Update call to
1080         gfc_deallocate_with_status.
1081
1082 2012-01-05  Paul Thomas  <pault@gcc.gnu.org>
1083
1084         PR fortran/PR48946
1085         * resolve.c (resolve_typebound_static): If the typebound
1086         procedure is 'deferred' try to find the correct specific
1087         procedure in the derived type operator space itself.
1088
1089 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
1090
1091         PR fortran/50981
1092         * trans-array.h (gfc_walk_elemental_function_args): New argument.
1093         * trans-intrinsic.c (gfc_walk_intrinsic_function): Update call.
1094         * trans-stmt.c (gfc_trans_call): Ditto.
1095         * trans-array.c (gfc_walk_function_expr): Ditto.
1096         (gfc_walk_elemental_function_args): Get the dummy argument list
1097         if possible.  Check that the dummy and the actual argument are both
1098         optional, and set can_be_null_ref accordingly.
1099
1100 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
1101
1102         PR fortran/50981
1103         * trans.h (struct gfc_ss_info): New field data::scalar::can_be_null_ref
1104         * trans-array.c: If the reference can be NULL, save the reference
1105         instead of the value.
1106         * trans-expr.c (gfc_conv_expr): If we have saved a reference,
1107         dereference it.
1108
1109 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
1110
1111         * trans-expr.c (gfc_conv_expr): Move address taking...
1112         (gfc_conv_expr_reference): ... here.
1113
1114 2012-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
1115
1116         PR fortran/49693
1117         * trans-common.c (create_common): Update copyright years.  Mark
1118         variables as used to avoid warnings about unused variables in
1119         common blocks.
1120
1121 2012-01-03  Hans-Peter Nilsson  <hp@axis.com>
1122
1123         * gfortran.h (struct gfc_expr): Add missing "struct"
1124         qualifier for member base_expr.
1125
1126 2012-01-02  Paul Thomas  <pault@gcc.gnu.org>
1127
1128         PR fortran/51529
1129         * trans-array.c (gfc_array_allocate): Null allocated memory of
1130         newly allocted class arrays.
1131
1132         PR fortran/46262
1133         PR fortran/46328
1134         PR fortran/51052
1135         * interface.c(build_compcall_for_operator): Add a type to the
1136         expression.
1137         * trans-expr.c (conv_base_obj_fcn_val): New function.
1138         (gfc_conv_procedure_call): Use base_expr to detect non-variable
1139         base objects and, ensuring that there is a temporary variable,
1140         build up the typebound call using conv_base_obj_fcn_val.
1141         (gfc_trans_class_assign): Pick out class procedure pointer
1142         assignments and do the assignment with no further prcessing.
1143         (gfc_trans_class_array_init_assign, gfc_trans_class_init_assign
1144         gfc_trans_class_assign): Move to top of file.
1145         * gfortran.h : Add 'base_expr' field to gfc_expr.
1146         * resolve.c (get_declared_from_expr): Add 'types' argument to
1147         switch checking of derived types on or off.
1148         (resolve_typebound_generic_call): Set the new argument.
1149         (resolve_typebound_function, resolve_typebound_subroutine):
1150         Set 'types' argument for get_declared_from_expr appropriately.
1151         Identify base expression, if not a variable, in the argument
1152         list of class valued calls. Assign it to the 'base_expr' field
1153         of the final expression. Strip away all references after the
1154         last class reference.
1155
1156 2012-01-02  Tobias Burnus  <burnus@net-b.de>
1157
1158         PR fortran/51682
1159         * trans-intrinsic.c (trans_this_image, trans_image_index,
1160         trans_num_images, conv_intrinsic_cobound): Fold_convert the
1161         caf_num_images/caf_this_images variables to the correct int kind.
1162
1163 2012-01-01  Jakub Jelinek  <jakub@redhat.com>
1164
1165         * gfortranspec.c (lang_specific_driver): Update copyright notice
1166         dates.
1167 \f
1168 Copyright (C) 2012 Free Software Foundation, Inc.
1169
1170 Copying and distribution of this file, with or without modification,
1171 are permitted in any medium without royalty provided the copyright
1172 notice and this notice are preserved.