re PR fortran/53111 (Derived types cannot be USE-associated again with -std=f95)
[platform/upstream/gcc.git] / gcc / fortran / ChangeLog
1 2012-05-04  Tobias Burnus  <burnus@net-b.de>
2
3         PR fortran/53111
4         * resolve.c (resolve_fl_derived): Fix -std=f95
5         diagnostic for generic vs. DT names.
6
7 2012-05-03  Tobias Burnus  <burnus@net-b.de>
8
9         PR fortran/52864
10         * interface.c (compare_parameter_intent): Remove.
11         (check_intents): Remove call, handle CLASS pointer.
12         (compare_actual_formal): Handle CLASS pointer.
13
14 2012-04-30  Jan Hubicka  <jh@suse.cz>
15
16         * f95-lang.c (gfc_finish): Update comments.
17
18 2012-04-29  Thomas Koenig  <tkoenig@gcc.gnu.org>
19
20         PR fortran/53148
21         * frontend-passes.c (create_var):  If the statement has a label,
22         put the label around the block.
23
24 2012-04-25  Tobias Burnus  <burnus@net-b.de>
25
26         PR fortran/52196
27         * lang.opt (Wrealloc-lhs, Wrealloc-lhs-all): New flags.
28         * gfortran.h (gfc_option_t): Add them.
29         * options.c (gfc_init_options, gfc_post_options,
30         gfc_handle_option): Handle them.
31         * invoke.texi: Document them.
32         * trans-expr.c (realloc_lhs_warning): New function.
33         (gfc_trans_arrayfunc_assign,
34         alloc_scalar_allocatable_for_assignment,
35         gfc_trans_assignment_1): Use it.
36
37 2012-04-18  Steven Bosscher  <steven@gcc.gnu.org>
38
39         * trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR
40         with NULL_TREE type instead of void_type_node.
41         * trans-io.c (io_result): Likewise.
42         * trans-stmt.c (gfc_trans_integer_select,
43         gfc_trans_character_select): Likewise.
44
45 2012-04-16  Tobias Burnus  <burnus@net-b.de>
46
47         PR fortran/52864
48         * expr.c (gfc_check_vardef_context): Fix assignment check for
49         pointer components.
50
51 2012-04-16  Janus Weil  <janus@gcc.gnu.org>
52
53         PR fortran/52968
54         * class.c (gfc_build_class_symbol): Make sure the 'f2k_derived'
55         namespace is present.
56
57 2012-04-15  Janus Weil  <janus@gcc.gnu.org>
58
59         PR fortran/51082
60         * trans-expr.c (gfc_conv_expr_reference): Check if the expression is a
61         simple function call (or a more involved PPC reference).
62
63 2012-04-15  Tobias Burnus  <burnus@net-b.de>
64
65         PR fortran/52916
66         PR fortran/40973
67         * gfortran.h (symbol_attribute): Add public_used.
68         * interface.c (check_sym_interfaces, check_uop_interfaces,
69         gfc_check_interfaces): Set it.
70         * resolve.c (resolve_typebound_procedure): Ditto.
71         * trans-decl.c (build_function_decl): Use it.
72
73 2012-04-11  Tobias Burnus  <burnus@net-b.de>
74
75         PR fortran/52729
76         * resolve.c (resolve_symbol): Fix searching for parent NS decl.
77
78 2012-04-08  Tobias Burnus  <burnus@net-b.de>
79
80         PR fortran/52751
81         * trans-decl.c (gfc_finish_var_decl): Don't set TREE_PUBLIC
82         for PRIVATE module variables without C-binding label.
83
84         PR fortran/40973
85         * trans-decl.c (build_function_decl): Ditto for procedures.
86
87 2012-04-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
88
89         PR fortran/52893
90         * frontend-passes.c:  Keep track of wether we are in an implicit
91         DO loop; do not do function elimination if we are.
92
93 2012-04-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
94
95         PR fortran/52668
96         * module.c:  Only mark symbols as use_only if they have been
97         imported via an only list.
98
99 2012-03-28  Paul Thomas  <pault@gcc.gnu.org>
100         Tobias Burnus  <burnus@gcc.gnu.org>
101
102         PR fortran/52652
103         * match.c (gfc_match_allocate, gfc_match_deallocate): Change
104         "not.. or" to "neither.. nor".
105         * parse.c (decode_specification_statement): Correct error in
106         chpice of matching function for "allocatable".
107
108 2012-03-23  Janne Blomqvist  <jb@gcc.gnu.org>
109
110         * gfortran.h (GFC_MAX_LINE): Remove unused macro.
111
112 2012-03-19  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
113
114         PR fortran/52559
115         * error.c (gfc_widechar_display_length): Consider tabs as
116         one character wide, as they're displayed as spaces.
117         (show_locus): Move tab handling to...
118         (print_wide_char_into_buffer): ... here.
119
120 2012-03-17  Tobias Burnus  <burnus@net-b.de>
121
122         PR fortran/52585
123         * trans-intrinsic.c (gfc_conv_associated): Fix handling of
124         procpointer dummy arguments.
125
126 2012-03-16  Janne Blomqvist  <jb@gcc.gnu.org>
127
128         * trans-intrinsic.c (build_round_expr): Don't use BUILT_IN_IROUND
129         for __float128.
130
131 2012-03-15  Janne Blomqvist  <jb@gcc.gnu.org>
132
133         * f95-lang.c (gfc_init_builtin_functions): Initialize
134         BUILT_IN_IROUND.
135         * mathbuiltins.def: Add IROUND.
136         * trans-intrinsic.c (build_round_expr): Use BUILT_IN_IROUND if
137         type size matches.
138         (gfc_build_intrinsic_lib_fndecls): Build iround functions.
139
140 2012-03-12  Richard Guenther  <rguenther@suse.de>
141
142         * f95-lang.c (builtin_type_for_size): Use gfc_type_for_size.
143
144 2012-03-12  Tobias Burnus  <burnus@net-b.de>
145
146         PR fortran/52542
147         * decl.c (match_procedure_decl): If the interface
148         is bind(C), the procedure is as well.
149
150 2012-03-10  Steven Bosscher  <steven@gcc.gnu.org>
151
152         * convert.c (convert): Fold BOOLEAN_TYPE types to the proper variant.
153
154 2012-03-09  Steven Bosscher  <steven@gcc.gnu.org>
155
156         * Make-lang.in (convert.o): Depend on convert.h.
157         * convert.c: Header and comment cleanups.
158         (gfc_thruthvalue_conversion): Rename static function
159         to truthvalue_conversion.  Do not use 'internal_error' from here,
160         use 'gcc_unreachable' instead.
161         (convert): Do not use 'error' for conversions to void, use
162         'gcc_unreachable' instead.  Likewise for conversions to non-scalar
163         types.  Do not hanlde ENUMERAL_TYPE, the front end never creates them.
164         Clean up #if 0 code.
165
166 2012-03-08  Tobias Burnus  <burnus@net-b.de>
167
168         PR fortran/52469
169         * trans-types.c (gfc_get_function_type): Handle backend_decl
170         of a procedure pointer.
171
172 2012-03-06  Steven Bosscher  <steven@gcc.gnu.org>
173
174         * f95-lang.c (yyerror, yylex): Remove.
175         (clear_binding_stack): Remove, fold into its only user.
176         (LANG_HOOKS_PRINT_IDENTIFIER): Do not re-define.
177         (ridpointers): Remove.
178         (gfc_eh_initialized_p): Make static.
179         (gfc_truthvalue_conversion): Move to convert.c.
180         (gfc_be_parse_file): Clear binding level stack when done.
181         (gfc_print_identifier): Remove.
182         (pushlevel): Remove ignored 'ignore' argument.  Update all callers.
183         (poplevel): Remove unused 'reverse' argument.  Update all callers.
184         (ggc_p): Remove.
185         (gfc_builtin_function): Make static. Do not attempt to make RTL for
186         builtin functions.
187         * convert.c (gfc_truthvalue_conversion): Moved here from f95-lang.c,
188         and made static.
189         * trans.h (pushlevel, poplevel): Adjust prototypes.
190         (gfc_truthvalue_conversion, gfc_builtin_function): Remove prototypes.
191         * trans-openmp.c: Update calls to pushlevel and poplevel.
192         * trans.c: Likewise.
193         * trans-decl.c: Likewise.
194
195 2012-03-04  Mikael Morin  <mikael@gcc.gnu.org>
196
197         PR fortran/50981
198         * gfortran.h (gfc_is_class_container_ref): New prototype.
199         * class.c (gfc_is_class_container_ref): New function.
200         * trans-expr.c (gfc_conv_procedure_call): Add a "_data" component
201         reference to polymorphic actual arguments.
202
203 2012-03-04  Mikael Morin  <mikael@gcc.gnu.org>
204
205         PR fortran/50981
206         * trans-expr.c (gfc_conv_procedure_call): Save se->ss's value. 
207         Handle the case of unallocated arrays passed to elemental procedures.
208
209 2012-03-04  Mikael Morin  <mikael@gcc.gnu.org>
210
211         * trans.h (struct gfc_ss_info): Move can_be_null_ref component from
212         the data::scalar subcomponent to the toplevel.
213         * trans-expr.c (gfc_conv_expr): Update component reference.
214         * trans-array.c (gfc_add_loop_ss_code): Ditto.
215         (gfc_walk_elemental_function_args): Ditto.  Move the conditional setting
216         the field out of the scalar-only block.
217
218 2012-03-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
219
220         PR fortran/36160
221         * error.c (gfc_widechar_display_length, gfc_wide_display_length):
222         New functions.
223         (print_wide_char_into_buffer): Return length written.
224         (show_locus): Fix locus displayed when wide characters are present.
225
226 2012-03-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
227
228         * module.c (gfc_use_module): Improve error message some more.
229
230 2012-03-03  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
231
232         PR fortran/52313
233         * module.c (gfc_use_module): Improve error messages.
234
235 2012-03-03  Tobias Burnus  <burnus@net-b.de>
236
237         PR fortran/48820
238         * resolve.c (resolve_actual_arglist): Properly reset
239         assumed_type_expr_allowed.
240
241 2012-03-03  Tobias Burnus  <burnus@net-b.de>
242
243         * lang.opt (Wc-binding-type): New flag.
244         * options.c (gfc_init_options, gfc_handle_option): Handle it.
245         * invoke.texi (Wc-binding-type): Document it.
246         * gfortran.h (gfc_option_t): Add warn_c_binding_type.
247         * decl.c (verify_bind_c_sym): Handle -Wc-binding-type.
248         * symbol.c (gfc_set_default_type, verify_bind_c_derived_type):
249         Ditto.
250
251 2012-03-03  Tobias Burnus  <burnus@net-b.de>
252
253         PR fortran/48820
254         * decl.c (gfc_match_decl_type_spec): Support type(*).
255         (gfc_verify_c_interop): Allow type(*).
256         * dump-parse-tree.c (show_typespec): Handle type(*).
257         * expr.c (gfc_copy_expr): Ditto.
258         * interface.c (compare_type_rank, compare_parameter,
259         compare_actual_formal, gfc_procedure_use): Ditto.
260         * libgfortran.h (bt): Add BT_ASSUMED.
261         * misc.c (gfc_basic_typename, gfc_typename): Handle type(*).
262         * module.c (bt_types): Ditto.
263         * resolve.c (assumed_type_expr_allowed): New static variable.
264         (resolve_actual_arglist, resolve_variable, resolve_symbol):
265         Handle type(*). 
266         * trans-expr.c (gfc_conv_procedure_call): Ditto.
267         * trans-types.c (gfc_typenode_for_spec, gfc_get_dtype): Ditto.
268
269 2012-03-02  Tobias Burnus  <burnus@net-b.de>
270
271         PR fortran/52325
272         * primary.c (gfc_match_varspec): Add missing ;.
273
274 2012-03-02  Tobias Burnus  <burnus@net-b.de>
275
276         PR fortran/52325
277         * primary.c (gfc_match_varspec): Add diagnostic for % with
278         nonderived types.
279
280 2012-03-02  Tobias Burnus  <burnus@net-b.de>
281
282         PR fortran/52270
283         * expr.c (gfc_check_vardef_context): Fix check for
284         intent-in polymorphic pointer .
285         * interface.c (compare_parameter): Allow passing TYPE to
286         intent-in polymorphic pointer.
287
288 2012-03-02  Tobias Burnus  <burnus@net-b.de>
289
290         PR fortran/52452
291         * resolve.c (resolve_intrinsic): Don't search for a
292         function if we know that it is a subroutine.
293
294 2012-02-29  Paul Thomas  <pault@gcc.gnu.org>
295
296         PR fortran/52386
297         * trans-expr.c (fcncall_realloc_result): Dereference the
298         descriptor if needed.
299
300 2012-02-22  Tobias Burnus  <burnus@net-b.de>
301
302         PR fortran/52335
303         * io.c (gfc_match_open): Remove bogus F2003 DELIM= check.
304
305 2012-02-18  Tobias Burnus  <burnus@net-b.de>
306
307         PR fortran/52295
308         * interface.c (check_interface0): Internal procs in
309         generic interfaces are allowed in Fortran 2008.
310
311 2012-02-17  Tobias Burnus  <burnus@net-b.de>
312             Roland Stigge  <stigge@antcom.de>
313
314         PR translation/52273
315         * interface.c (compare_actual_formal): Fix typo "at at".
316
317 2012-02-17  Tobias Burnus  <burnus@net-b.de>
318
319         * gfortran.texi (Q exponent-letter): Fix grammar.
320
321 2012-02-17  Tobias Burnus  <burnus@net-b.de>
322
323         * gfortran.texi (Status): Fix typos.
324         * invoke.texi (ffixed-form, fstack-arrays): Spell Fortran with
325         a majuscule.
326
327 2012-02-17  Tobias Burnus  <burnus@net-b.de>
328             Roland Stigge  <stigge@antcom.de>
329
330         PR translation/52232
331         PR translation/52234
332         PR translation/52245
333         PR translation/52246
334         PR translation/52262
335         PR translation/52273
336         * io.c (gfc_match_open): Fix typo.
337         * interface.c (compare_actual_formal): Ditto.
338         * lang.opt (freal-4-real-8, freal-4-real-16, freal-8-real-16): Ditto.
339         * match.c (alloc_opt_list, gfc_match_nullify): Ditto.
340         * check.c (gfc_check_associated, gfc_check_null): Ditto.
341
342 2012-02-12  Mikael Morin  <mikael@gcc.gnu.org>
343
344         PR fortran/50981
345         * trans-stmt.c (gfc_get_proc_ifc_for_call): New function.
346         (gfc_trans_call): Use gfc_get_proc_ifc_for_call.
347
348 2012-02-12  Mikael Morin  <mikael@gcc.gnu.org>
349
350         * trans-array.c (gfc_walk_elemental_function_args,
351         gfc_walk_function_expr): Move call to gfc_get_proc_ifc_for_expr out
352         of gfc_walk_elemental_function_args.
353         * trans-stmt.c (gfc_trans_call): Ditto.
354         * trans-array.h (gfc_get_proc_ifc_for_expr): New prototype.
355         (gfc_walk_elemental_function_args): Update prototype.
356
357 2012-02-12  Mikael Morin  <mikael@gcc.gnu.org>
358
359         * trans-array.c (gfc_get_proc_ifc_for_expr): New function.
360         (gfc_walk_elemental_function_args): Move code to
361         gfc_get_proc_ifc_for_expr and call it.
362
363 2012-02-08  Tobias Burnus  <burnus@net-b.de>
364
365         PR fortran/52151
366         * trans-expr.c (fcncall_realloc_result): Set also the stride.
367
368 2012-02-07  Tobias Burnus  <burnus@net-b.de>
369
370         PR fortran/51514
371         * trans-expr.c (gfc_conv_procedure_call): Add _data component
372         for calls of scalar CLASS actuals to TYPE dummies.
373
374 2012-02-05  Thomas König  <tkoenig@gcc.gnu.org>
375
376         PR fortran/48847
377         * trans-decl.c:  Warn about unused dummy procedure arguments
378         if -Wunused-dummy-argument is specified.  Suppress middle-end
379         warnings about procedure arguments.
380
381 2012-02-05  Paul Thomas  <pault@gcc.gnu.org>
382
383         * trans-array.c (gfc_array_allocate): Zero memory for all class
384         array allocations.
385         * trans-stmt.c (gfc_trans_allocate): Ditto for class scalars.
386
387         PR fortran/52102
388         * trans-stmt.c (gfc_trans_allocate): Before correcting a class
389         array reference, ensure that 'dataref' points to the _data
390         component that is followed by the array reference..
391
392 2012-02-02  Mikael Morin  <mikael@gcc.gnu.org>
393
394         PR fortran/41587
395         PR fortran/46356
396         PR fortran/51754
397         PR fortran/50981
398         * class.c (insert_component_ref, class_data_ref_missing,
399         gfc_fix_class_refs): New functions.
400         * gfortran.h (gfc_fix_class_refs): New prototype.
401         * trans-expr.c (gfc_conv_expr): Remove special case handling and call
402         gfc_fix_class_refs instead.
403
404 2012-02-02  Paul Thomas  <pault@gcc.gnu.org>
405
406         PR fortran/52012
407         * trans-expr.c (fcncall_realloc_result): If variable shape is
408         correct, retain the bounds, whatever they are.
409
410 2012-02-02  Tobias Burnus  <burnus@net-b.de>
411
412         PR fortran/52093
413         * simplify.c (gfc_simplify_size): Handle INTRINSIC_PARENTHESES.
414
415 2012-02-01  Thomas König  <tkoenig@gcc.gnu.org>
416
417         PR fortran/51958
418         * frontend-passes.c (convert_elseif):  New function.
419         (optimize_namespace):  Call it.
420
421 2012-02-01  Tobias Burnus  <burnus@net-b.de>
422
423         PR fortran/52024
424         * module.c (MOD_VERSION): Bump.
425         (mio_typebound_proc): Read/write is_operator from/to the
426         .mod file.
427
428 2012-02-01  Tobias Burnus  <burnus@net-b.de>
429
430         PR fortran/52059
431         * trans-expr.c (gfc_conv_procedure_call): Add array ref
432         only to variables.
433
434 2012-01-31  Tobias Burnus  <burnus@net-b.de>
435
436         PR fortran/52024
437         * gfortran.h (gfc_tbp_generic): Store whether the
438         generic is an operator.
439         * decl.c (gfc_match_generic): Set that flag.
440         * resolve.c (check_generic_tbp_ambiguity): Use it in the
441         gfc_compare_interfaces check.
442
443 2012-01-31  Tobias Burnus  <burnus@net-b.de>
444
445         PR fortran/52029
446         * class.c (gfc_find_derived_vtab): Mark _copy function as pure.
447
448 2012-01-31  Tobias Burnus  <burnus@net-b.de>
449
450         PR fortran/52013
451         * class.c (get_unique_hashed_string): Adapt trim length.
452         (gfc_build_class_symbol) Encode also corank in the container name.
453
454 2012-01-31  Paul Thomas  <pault@gcc.gnu.org>
455
456         PR fortran/52012
457         * trans-expr.c (fcncall_realloc_result): Correct calculation of
458         result offset.
459
460 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
461
462         * module.c (pointer_info): Make true_name and module pointers
463         rather than arrays, order pointers before other fields.
464         (free_pi_tree): free true_name and module as well.
465         (mio_read_string): Rename to read_string.
466         (mio_write_string): Remove.
467         (load_commons): Use read_string.
468         (read_module): Use read_string rather than mio_internal_string.
469         (write_blank_common): Call write_atom directly.
470         (write_symbol): Likewise.
471
472 2012-01-29  Tobias Burnus  <burnus@net-b.de>
473
474         PR fortran/41600
475         * expr.c (gfc_default_initializer): Convert the values if
476         the type does not match.
477
478 2012-01-29  Tobias Burnus  <burnus@net-b.de>
479
480         PR fortran/51972
481         * trans-array.c (structure_alloc_comps): Fix assignment of
482         polymorphic components (polymorphic deep copying).
483
484 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
485
486         PR fortran/51808
487         * decl.c (set_binding_label): Make binding_label argument const.
488         (curr_binding_label): Constify.
489         * gfortran.h (gfc_symbol): Constify binding_label.
490         (gfc_common_head): Likewise.
491         (get_iso_c_sym): Likewise.
492         * match.c (gfc_match_name_C): Constify buffer argument.
493         * match.h (gfc_match_name_C): Likewise.
494         * resolve.c (set_name_and_label): Constify binding_label argument.
495         (gfc_iso_c_sub_interface): Constify binding_label variable.
496         * symbol.c (get_iso_c_sym): Constify binding_label argument.
497
498 2012-01-29  Janne Blomqvist  <jb@gcc.gnu.org>
499
500         PR fortran/51808
501         * decl.c (set_binding_label): Move prototype from match.h to here.
502         (curr_binding_label): Make a pointer rather than static array.
503         (build_sym): Check sym->binding_label pointer rather than array,
504         update set_binding_label call, handle curr_binding_label changes.
505         (set_binding_label): Handle new curr_binding_label, dest_label
506         double ptr, and sym->binding_label.
507         (verify_bind_c_sym): Handle sym->binding_label being a pointer.
508         (set_verify_bind_c_sym): Check sym->binding_label pointer rather
509         than array, update set_binding_label call.
510         (gfc_match_bind_c_stmt): Handle curr_binding_label change.
511         (match_procedure_decl): Update set_binding_label call.
512         (gfc_match_bind_c): Change binding_label to pointer, update
513         gfc_match_name_C call.
514         * gfortran.h (GFC_MAX_BINDING_LABEL_LEN): Remove macro.
515         (gfc_symbol): Make binding_label a pointer.
516         (gfc_common_head): Likewise.
517         * match.c (gfc_match_name_C): Heap allocate bind(C) name.
518         * match.h (gfc_match_name_C): Change prototype argument.
519         (set_binding_label): Move prototype to decl.c.
520         * module.c (struct pointer_info): Make binding_label a pointer.
521         (free_pi_tree): Free unused binding_label.
522         (mio_read_string): New function.
523         (mio_write_string): New function.
524         (load_commons): Redo reading of binding_label.
525         (read_module): Likewise.
526         (write_common_0): Change to write empty string instead of name if
527         no binding_label.
528         (write_blank_common): Write empty string for binding label.
529         (write_symbol): Change to write empty string instead of name if no
530         binding_label.
531         * resolve.c (gfc_iso_c_func_interface): Don't set binding_label.
532         (set_name_and_label): Make binding_label double pointer, use
533         asprintf.
534         (gfc_iso_c_sub_interface): Make binding_label a pointer.
535         (resolve_bind_c_comms): Handle cases if
536         gfc_common_head->binding_label is NULL.
537         (gfc_verify_binding_labels): sym->binding_label is a pointer.
538         * symbol.c (gfc_new_symbol): Rely on XCNEW zero init for
539         binding_label.
540         (gen_special_c_interop_ptr): Don't set binding label.
541         (generate_isocbinding_symbol): Insert binding_label into symbol
542         table.
543         (get_iso_c_sym): Use pointer assignment instead of strcpy.
544         * trans-common.c (gfc_sym_mangled_common_id): Handle
545         com->binding_label being a pointer.
546         * trans-decl.c (gfc_sym_mangled_identifier): Handle
547         sym->binding_label being a pointer.
548         (gfc_sym_mangled_function_id): Likewise.
549
550 2012-01-29  Tobias Burnus  <burnus@net-b.de>
551
552         PR fortran/52038
553         * resolve.c (symbol_as): Remove unused, accidentally
554         added function.
555
556 2012-01-28  Tobias Burnus  <burnus@net-b.de>
557
558         PR fortran/51972
559         * trans-stmt.c (gfc_trans_allocate): Properly check whether
560         we have a BT_CLASS which needs to be memset.
561
562 2012-01-27  Tobias Burnus  <burnus@net-b.de>
563
564         PR fortran/52022
565         * trans-expr.c (gfc_conv_procedure_call): Fix passing
566         of functions, which return allocatables.
567
568 2012-01-27  Tobias Burnus  <burnus@net-b.de>
569
570         PR fortran/52016
571         * resolve.c (resolve_formal_arglist): Fix elemental
572         constraint checks for polymorphic dummies also for
573         pointers.
574
575 2012-01-27  Tobias Burnus  <burnus@net-b.de>
576
577         PR fortran/51970
578         PR fortran/51977
579         * primary.c (gfc_match_varspec. gfc_match_rvalue): Set
580         handle array spec for BT_CLASS.
581         * expr.c (gfc_get_variable_expr, gfc_lval_expr_from_sym)
582         * frontend-passes.c (create_var): Ditto.
583         * resolve.c (resolve_actual_arglist, resolve_assoc_var): Ditto.
584         * trans-decl.c (gfc_trans_deferred_vars): Use class_pointer
585         instead of attr.pointer.
586         (gfc_generate_function_code): Use CLASS_DATA (sym) for BT_CLASS.
587         * trans-intrinsic.c (conv_intrinsic_move_alloc): Move assert.
588         * trans-stmt.c (trans_associate_var): Ask for the descriptor.
589
590 2012-01-27  Tobias Burnus  <burnus@net-b.de>
591
592         PR fortran/51953
593         * match.c (gfc_match_allocate): Allow more than allocate
594         object with SOURCE=.
595
596 2012-01-27  Tobias Burnus  <burnus@net-b.de>
597
598         PR fortran/52016
599         * resolve.c (resolve_formal_arglist): Fix elemental
600         constraint checks for polymorphic dummies.
601
602 2012-01-27  Paul Thomas  <pault@gcc.gnu.org>
603             Tobias Burnus <burnus@gcc.gnu.org>
604
605         PR fortran/48705
606         PR fortran/51870
607         PR fortran/51943
608         PR fortran/51946
609         * trans-array.c (gfc_array_init_size): Add two extra arguments
610         to convey the dynamic element size of a calls object and to
611         return the number of elements that have been allocated.
612         (gfc_array_allocate): Add the same arguments and use them to
613         call gfc_array_init_size.  Before the allocation dereference
614         the data pointer, if necessary. Set the allocated array to zero
615         if the class element size or expr3 are non-null.
616         * trans-expr.c (gfc_conv_class_to_class): Give this function
617         global scope.
618         (get_class_array_ref): New function.
619         (gfc_copy_class_to_class): New function.
620         * trans-array.h : Update prototype for gfc_array_allocate.
621         * trans-stmt.c (gfc_trans_allocate): For non-variable class
622         STATUS expressions extract the class object and the dynamic
623         element size. Use the latter to call gfc_array_allocate and
624         the former for setting the vptr and, via
625         gfc_copy_class_to_clasfc_cs, to copy to the allocated data.
626         * trans.h : Prototypes for gfc_get_class_array_ref,
627         gfc_copy_class_to_class and gfc_conv_class_to_class.
628
629 2012-01-25  Tobias Burnus  <burnus@net-b.de>
630
631         * resolve.c (symbol_as): Check also for attr.class_ok.
632
633 2012-01-25  Tobias Burnus  <burnus@net-b.de>
634
635         PR fortran/51995
636         * class.c (gfc_build_class_symbol): Fix invalid freeing
637         issue with fclass->f2k_derived.
638
639 2012-01-25  Tobias Burnus  <burnus@net-b.de>
640
641         PR fortran/51995
642         * class.c (gfc_build_class_symbol): Ensure that
643         fclass->f2k_derived is set.
644
645 2012-01-25  Tobias Burnus  <burnus@net-b.de>
646
647         PR fortran/51966
648         * resolve.c (resolve_structure_cons): Only create an
649         array constructors for nonscalars.
650
651 2012-01-23  Tobias Burnus  <burnus@net-b.de>
652
653         PR fortran/51948
654         * check.c (variable_check): Fix checking for
655          variables and deeply nested BLOCKs.
656
657 2012-01-21  Tobias Burnus  <burnus@net-b.de>
658             Steven G. Kargl  <kargl@gcc.gnu.org>
659
660         PR fortran/50556
661         * symbol.c (check_conflict): namelist-group-name cannot have the SAVE
662         attribute.
663
664 2012-01-21  Tobias Burnus  <burnus@net-b.de>
665
666         PR fortran/51913
667         * interface.c (compare_parameter): Fix CLASS comparison.
668
669 2012-01-20  Tobias Burnus  <burnus@net-b.de>
670             Janus Weil  <janus@gcc.gnu.org>
671
672         PR fortran/51056
673         * module.c (load_needed, read_module): Don't mark __vtab etc.
674         as use_only.
675
676 2012-01-19  Tobias Burnus  <burnus@net-b.de>
677
678         PR fortran/51904
679         * expr.c (gfc_build_intrinsic_call): Also set the symtree.
680
681 2012-01-18  Paul Thomas  <pault@gcc.gnu.org>
682
683         PR fortran/51634
684         * trans-expr.c (gfc_conv_procedure_call): Deallocate allocatable
685         components of temporary class arguments.
686
687 2012-01-17  Tobias Burnus  <burnus@net-b.de>
688             Janne Blomqvist  <jb@gcc.gnu.org>
689
690         PR fortran/51869
691         * trans-expr.c (alloc_scalar_allocatable_for_assignment): Nullify
692         LHS after allocation, if it has allocatable components.
693         * f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_CALLOC.
694
695 2012-01-16  Mikael Morin  <mikael@gcc.gnu.org>
696             Tobias Burnus  <burnus@net-b.de>
697
698         PR fortran/50981
699         * trans-array.c (gfc_walk_elemental_function_args): Fix
700         passing of deallocated allocatables/pointers as absent argument. 
701
702 2012-01-16  Tobias Burnus  <burnus@net-b.de>
703
704         PR fortran/51809
705         * class.c (gfc_find_derived_vtab): Mark __vtab and
706         __def_init as FL_VARIABLE not as FL_PARAMETER.
707         * expr.c (gfc_simplify_expr): Remove special
708         handling of __vtab.
709         * resolve.c (resolve_values): Ditto.
710         * trans-decl.c (gfc_get_symbol_decl): Mark __vtab
711         and __def_init as TREE_READONLY.
712
713 2012-01-16  Zydrunas Gimbutas  <gimbutas@cims.nyu.edu>
714         Andreas Kloeckner  <kloeckner@cims.nyu.edu>
715         Steven G. Kargl  <kargl@gcc.gnu.org>
716
717         PR fortran/48426
718         * gfortran.h (gfc_option_t): Add members flag_*_kind to store kind.
719         * lang.opt: Add options -freal-4-real-8, -freal-4-real-10,
720         -freal-4-real-16, -freal-8-real-4, -freal-8-real-10, -freal-8-real-16
721         and -finteger-4-integer-8. User-desired type conversion information.
722         * decl.c (gfc_match_old_kind_spec,kind_expr): Type conversions
723         in declaration parsing.
724         * trans-types.c (gfc_init_kinds): User-specified type conversion
725         checked for current backend.
726         * primary.c (match_integer_constant,match_real_constant): Implement
727         type conversion in constant parsing.
728         * options.c (gfc_init_options,gfc_handle_option): Translate input
729         options to flags in internal options data structure.
730         * invoke.texi: Document new options.  Re-order options in Options
731         summary section.
732
733 2012-01-16  Paul Thomas  <pault@gcc.gnu.org>
734
735         * trans-array.c (gfc_trans_create_temp_array): In the case of a
736         class array temporary, detect a null 'eltype' on entry and use 
737         'initial' to provde the class reference and so, through the
738         vtable, the element size for the dynamic type.
739         * trans-stmt.c (gfc_conv_elemental_dependencies): For class
740         expressions, set 'eltype' to null and pass the values via the
741         'initial' expression.
742
743 2012-01-14  Tobias Burnus  <burnus@net-b.de>
744
745         PR fortran/51800
746         * resolve.c (build_default_init_expr): Also initialize
747         nonconstant-length strings with -finit-character=<n>.
748
749 2011-01-14  Tobias Burnus  <burnus@net-b.de>
750
751         PR fortran/51816
752         * module.c (read_module): Don't make nonexisting
753         intrinsic operators as found.
754         (rename_list_remove_duplicate): New function.
755         (gfc_use_modules): Use it.
756
757 2012-01-13  Paul Thomas  <pault@gcc.gnu.org>
758
759         PR fortran/48351
760         * trans-array.c (structure_alloc_comps): Suppress interative
761         call to self, when current component is deallocated using
762         gfc_trans_dealloc_allocated.
763         * class.c (gfc_build_class_symbol): Copy the 'alloc_comp'
764         attribute from the declared type to the class structure.
765
766 2012-01-13  Tobias Burnus  <burnus@net-b.de>
767
768         PR fortran/51842
769         * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
770         instead of a signed int of size POINTER_SIZE for
771         gfc_index_integer_kind.
772
773 2012-01-12  Tobias Burnus  <burnus@net-b.de>
774
775         PR fortran/36755
776         * intrinsic.texi (CHMOD): Extend a bit and remove statement
777         that /bin/chmod is called.
778
779 2012-01-10  Gerald Pfeifer  <gerald@pfeifer.com>
780
781         * gfortran.texi (Fortran 2003 Status): Fix grammar.
782
783 2012-01-10  Tobias Burnus  <burnus@net-b.de>
784
785         PR fortran/51652
786         * resolve.c (resolve_allocate_expr): For non-deferred char lengths,
787         check whether type-spec matches declaration.
788
789 2012-01-10  Tobias Burnus  <burnus@net-b.de>
790
791         * resolve.c (resolve_ordinary_assign): Improve error wording.
792
793 2012-01-09  Paul Thomas  <pault@gcc.gnu.org>
794
795         PR fortran/51791
796         * interface.c (matching_typebound_op): Drill down through
797         possible parentheses to obtain base expression. Do not test for
798         'class_ok' but, instead for the class structure components.
799         * resolve.c (resolve_ordinary_assign): Extend error message for
800         polymorphic assignment to advise checking for specific
801         subroutine.
802
803         PR fortran/51792
804         * resolve.c (resolve_typebound_function): Restore 'static' to
805         declaration.
806
807 2012-01-09  Mikael Morin  <mikael@gcc.gnu.org>
808
809         PR fortran/51758
810         * trans-array.c (gfc_walk_elemental_function_args):
811         Skip over NULL() actual arguments.
812
813 2012-01-09  Tobias Burnus  <burnus@net-b.de>
814
815         * gfortran.texi: Bump copyright year.
816         (Fortran 2003 Status): Update polymorphism item, add
817         item for generic interface with DT name.
818
819 2012-01-09  Tobias Burnus  <burnus@net-b.de>
820
821         PR fortran/51578
822         * gfortran.h (gfc_use_list):
823         * match.h (gfc_use_module): Rename to ...
824         (gfc_use_modules): ... this.
825         * module.c (use_locus, specified_nonint, specified_int): Remove
826         global variable.
827         (module_name): Change type to const char*, used with gfc_get_string.
828         (module_list): New global variable.
829         (free_rename): Free argument not global var.
830         (gfc_match_use): Save match to module_list.
831         (load_generic_interfaces, read_module): Don't free symtree.
832         (write_dt_extensions, gfc_dump_module): Fix module-name I/O due to the
833         type change of module_name.
834         (write_symbol0, write_generic): Optimize due to the type change.
835         (import_iso_c_binding_module, use_iso_fortran_env_module): Use
836         locus of rename->where.
837         (gfc_use_module): Take module_list as argument.
838         (gfc_use_modules): New function.
839         (gfc_module_init_2, gfc_module_done_2): Init module_list, rename_list.
840         * parse.c (last_was_use_stmt): New global variable.
841         (use_modules): New function.
842         (decode_specification_statement, decode_statement): Move USE match up
843         and call use_modules.
844         (next_free, next_fixed): Call use_modules.
845         (accept_statement): Don't call gfc_module_use.
846
847 2012-01-06  Tobias Burnus <burnus@net-b.de>
848
849         * trans-openmp.c (gfc_omp_clause_dtor, gfc_trans_omp_array_reduction):
850         Update call to gfc_trans_dealloc_allocated.
851         * trans.c (gfc_allocate_using_malloc): Fix spacing.
852         (gfc_allocate_allocatable): For gfc_allocate_using_lib, jump to
853         label_finish when an error occurs.
854         (gfc_deallocate_with_status): Call caf_deregister for -fcoarray=lib.
855         * trans.h (gfc_allocate_allocatable, gfc_deallocate_with_status):
856         Update prototype.
857         (gfor_fndecl_caf_deregister): New tree symbol.
858         * trans-expr.c (gfc_conv_procedure_call): Update
859         gfc_deallocate_with_status and gfc_trans_dealloc_allocated calls.
860         * trans-array.c (gfc_array_allocate, gfc_trans_dealloc_allocated,
861         structure_alloc_comps, gfc_trans_deferred_array): Ditto.
862         (gfc_array_deallocate): Handle coarrays with -fcoarray=lib.
863         * trans-array.h (gfc_array_deallocate, gfc_array_allocate,
864         gfc_trans_dealloc_allocated): Update prototypes.
865         * trans-stmt.c (gfc_trans_sync): Fix indentation.
866         (gfc_trans_allocate): Fix errmsg padding and label handling.
867         (gfc_trans_deallocate): Ditto and handle -fcoarray=lib.
868         * expr.c (gfc_is_coarray): Fix algorithm for BT_CLASS.
869         * libgfortran.h (GFC_STAT_STOPPED_IMAGE): Use large value
870         to avoid other stats accidentally matching this one.
871         * trans-decl.c (gfor_fndecl_caf_deregister): New global var.
872         (gfc_build_builtin_function_decls): Fix prototype decl of caf_register
873         and add decl for caf_deregister.
874         (gfc_trans_deferred_vars): Handle CAF vars with -fcoarrays=lib.
875         * trans-intrinsic.c (conv_intrinsic_move_alloc): Update call to
876         gfc_deallocate_with_status.
877
878 2012-01-05  Paul Thomas  <pault@gcc.gnu.org>
879
880         PR fortran/PR48946
881         * resolve.c (resolve_typebound_static): If the typebound
882         procedure is 'deferred' try to find the correct specific
883         procedure in the derived type operator space itself.
884
885 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
886
887         PR fortran/50981
888         * trans-array.h (gfc_walk_elemental_function_args): New argument.
889         * trans-intrinsic.c (gfc_walk_intrinsic_function): Update call.
890         * trans-stmt.c (gfc_trans_call): Ditto.
891         * trans-array.c (gfc_walk_function_expr): Ditto.
892         (gfc_walk_elemental_function_args): Get the dummy argument list
893         if possible.  Check that the dummy and the actual argument are both
894         optional, and set can_be_null_ref accordingly.
895
896 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
897
898         PR fortran/50981
899         * trans.h (struct gfc_ss_info): New field data::scalar::can_be_null_ref
900         * trans-array.c: If the reference can be NULL, save the reference
901         instead of the value.
902         * trans-expr.c (gfc_conv_expr): If we have saved a reference,
903         dereference it.
904
905 2012-01-04  Mikael Morin  <mikael@gcc.gnu.org>
906
907         * trans-expr.c (gfc_conv_expr): Move address taking...
908         (gfc_conv_expr_reference): ... here.
909
910 2012-01-04  Thomas Koenig  <tkoenig@gcc.gnu.org>
911
912         PR fortran/49693
913         * trans-common.c (create_common): Update copyright years.  Mark
914         variables as used to avoid warnings about unused variables in
915         common blocks.
916
917 2012-01-03  Hans-Peter Nilsson  <hp@axis.com>
918
919         * gfortran.h (struct gfc_expr): Add missing "struct"
920         qualifier for member base_expr.
921
922 2012-01-02  Paul Thomas  <pault@gcc.gnu.org>
923
924         PR fortran/51529
925         * trans-array.c (gfc_array_allocate): Null allocated memory of
926         newly allocted class arrays.
927
928         PR fortran/46262
929         PR fortran/46328
930         PR fortran/51052
931         * interface.c(build_compcall_for_operator): Add a type to the
932         expression.
933         * trans-expr.c (conv_base_obj_fcn_val): New function.
934         (gfc_conv_procedure_call): Use base_expr to detect non-variable
935         base objects and, ensuring that there is a temporary variable,
936         build up the typebound call using conv_base_obj_fcn_val.
937         (gfc_trans_class_assign): Pick out class procedure pointer
938         assignments and do the assignment with no further prcessing.
939         (gfc_trans_class_array_init_assign, gfc_trans_class_init_assign
940         gfc_trans_class_assign): Move to top of file.
941         * gfortran.h : Add 'base_expr' field to gfc_expr.
942         * resolve.c (get_declared_from_expr): Add 'types' argument to
943         switch checking of derived types on or off.
944         (resolve_typebound_generic_call): Set the new argument.
945         (resolve_typebound_function, resolve_typebound_subroutine):
946         Set 'types' argument for get_declared_from_expr appropriately.
947         Identify base expression, if not a variable, in the argument
948         list of class valued calls. Assign it to the 'base_expr' field
949         of the final expression. Strip away all references after the
950         last class reference.
951
952 2012-01-02  Tobias Burnus  <burnus@net-b.de>
953
954         PR fortran/51682
955         * trans-intrinsic.c (trans_this_image, trans_image_index,
956         trans_num_images, conv_intrinsic_cobound): Fold_convert the
957         caf_num_images/caf_this_images variables to the correct int kind.
958
959 2012-01-01  Jakub Jelinek  <jakub@redhat.com>
960
961         * gfortranspec.c (lang_specific_driver): Update copyright notice
962         dates.
963 \f
964 Copyright (C) 2012 Free Software Foundation, Inc.
965
966 Copying and distribution of this file, with or without modification,
967 are permitted in any medium without royalty provided the copyright
968 notice and this notice are preserved.