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