re PR fortran/54033 (gfortran: Passing file as include directory - add diagnostic...
[gcc.git] / gcc / fortran / ChangeLog
1 2012-08-01 Thomas König <tkoenig@gcc.gnu.org>
2
3 PR fortran/54033
4 * scanner.c (add_path_to_list): Emit warning if an error occurs
5 for an include path, if it is not present or if it is not a
6 directory. Do not add the path in these cases.
7
8 2012-07-31 Janus Weil <janus@gcc.gnu.org>
9
10 PR fortran/42418
11 * decl.c (match_procedure_interface): Move some checks to
12 'resolve_procedure_interface'. Set flavor if appropriate.
13 * expr.c (gfc_check_pointer_assign): Cleanup of 'gfc_is_intrinsic'.
14 * intrinsic.c (gfc_is_intrinsic): Additional checks for attributes which
15 identify a procedure as being non-intrinsic.
16 * resolve.c (resolve_procedure_interface): Checks moved here from
17 'match_procedure_interface'. Minor cleanup.
18 (resolve_formal_arglist,resolve_symbol): Cleanup of
19 'resolve_procedure_interface'
20 (resolve_actual_arglist,is_external_proc): Cleanup of
21 'gfc_is_intrinsic'.
22
23 2012-07-31 Janus Weil <janus@gcc.gnu.org>
24
25 PR fortran/54134
26 * dependency.c (gfc_dep_compare_expr): Check if arguments are NULL.
27
28 2012-07-31 Tobias Burnus <burnus@net-b.de>
29
30 * interface.c (gfc_procedure_use): Return gfc_try instead of void.
31 * gfortran.h (gfc_procedure_use): Update prototype.
32 * resolve.c (gfc_iso_c_func_interface): Allow noninteroperable
33 procedures for c_funloc for TS29113.
34 * (gfc_iso_c_sub_interface): Ditto for c_f_procpointer. Add
35 diagnostic for c_ptr vs. c_funptr for c_f_(proc)pointer.
36
37 2012-07-30 Janus Weil <janus@gcc.gnu.org>
38
39 PR fortran/51081
40 * gfortran.h (gfc_resolve_intrinsic): Add prototype.
41 * expr.c (gfc_check_pointer_assign): Set INTRINSIC attribute if needed.
42 Check for invalid intrinsics.
43 * primary.c (gfc_match_rvalue): Check for intrinsics came too early.
44 Set procedure flavor if appropriate.
45 * resolve.c (resolve_intrinsic): Renamed to gfc_resolve_intrinsic.
46 (resolve_procedure_interface,resolve_procedure_expression,
47 resolve_function,resolve_fl_derived0,resolve_symbol): Ditto.
48
49 2012-07-26 Mikael Morin <mikael@gcc.gnu.org>
50
51 PR fortran/44354
52 * trans-array.c (gfc_trans_array_constructor_value):
53 Evaluate the iteration bounds before the inner variable shadows
54 the outer.
55
56 2012-07-26 Mikael Morin <mikael@gcc.gnu.org>
57
58 PR fortran/44354
59 * array.c (sought_symbol): New variable.
60 (expr_is_sought_symbol_ref, find_symbol_in_expr): New functions.
61 (resolve_array_list): Check for references to the induction
62 variable in the iteration bounds and issue a diagnostic if some
63 are found.
64
65 2012-07-26 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
66 Tobias Burnus <burnus@net-b.de>
67
68 * module.c (mio_array_spec): Don't read as->lower for
69 assumed-rank arrays.
70
71 2012-07-25 Tobias Burnus <burnus@net-b.de>
72
73 * trans-types.c (gfc_real16_is_float128): Fix spelling
74 in a comment.
75 * trans.h (struct gfc_array_info): Ditto.
76 * gfortran.h (gfc_expr): Ditto.
77 * simplify.c (gfc_count): Ditto.
78 * trans-expr.c (gfc_copy_class_to_class,
79 conv_parent_component_references,
80 gfc_trans_pointer_assignment): Ditto.
81 * expr.c (check_pointer_assign): Fix diagnostic spelling.
82 * interface.c (compare_parameter): Ditto.
83 * parse.c (use_modules, parse_associate): Ditto.
84 * decl.c (match_char_length): Fix spelling of the
85 an function argument.
86
87 2012-07-21 Tobias Burnus <burnus@net-b.de>
88
89 * iso-c-binding.def (C_PTRDIFF_T): New TS29113 parameter.
90 * intrinsic.texi (ISO_C_BINDING): Document it.
91
92 2012-07-21 Tobias Burnus <burnus@net-b.de>
93
94 PR fortran/48820
95 * trans-intrinsic.c (gfc_conv_intrinsic_bound): Support
96 lbound/ubound with dim= for assumed-rank arrays.
97 * array.c (gfc_set_array_spec): Reject coarrays with
98 assumed shape.
99 * decl.c (merge_array_spec): Ditto. Return gfc_try.
100 (match_attr_spec, match_attr_spec): Update call.
101
102 2012-07-21 Tobias Burnus <burnus@net-b.de>
103
104 * resolve.c (resolve_formal_arglist): Put variable
105 declaration before the first assignment.
106
107 2012-07-21 Tobias Burnus <burnus@net-b.de>
108
109 * trans-expr.c (gfc_conv_derived_to_class): Fix argument passed
110 to class_array_data_assign.
111
112 2012-07-20 Tobias Burnus <burnus@net-b.de>
113
114 * decl.c (gfc_verify_c_interop_param): Allow assumed-shape
115 with -std=f2008ts.
116
117 2012-07-20 Tobias Burnus <burnus@net-b.de>
118
119 PR fortran/48820
120 * array.c (match_array_element_spec, gfc_match_array_spec,
121 spec_size, gfc_array_dimen_size): Add support for
122 assumed-rank arrays.
123 * check.c (dim_rank_check): Ditto.
124 * class.c (gfc_add_component_ref): Ditto.
125 (gfc_build_class_symbol): Regard assumed-rank arrays
126 as having GFC_MAX_DIMENSIONS. And build extra class
127 container for a scalar pointer class.
128 * decl.c (merge_array_spec): Add assert.
129 * dump-parse-tree.c (show_array_spec): Add support for
130 assumed-rank arrays.
131 * expr.c (gfc_is_simply_contiguous): Ditto.
132 * gfortran.h (array_type): Ditto.
133 (gfc_array_spec, gfc_expr): Add comment to "rank" field.
134 * interface.c (compare_type_rank, argument_rank_mismatch,
135 compare_parameter, gfc_procedure_use): Ditto.
136 (compare_actual_formal): Fix NULL() to optional-dummy
137 handling for polymorphic dummies.
138 * module.c (mio_typespec): Add support for
139 assumed-rank arrays.
140 * resolve.c (resolve_formal_arglist, resolve_actual_arglist,
141 resolve_elemental_actual, resolve_global_procedure,
142 expression_shape, resolve_variable, update_ppc_arglist,
143 check_typebound_baseobject, gfc_resolve_expr,
144 resolve_fl_var_and_proc, gfc_resolve_finalizers,
145 resolve_typebound_procedure, resolve_symbol): Ditto.
146 (assumed_type_expr_allowed): Remove static variable.
147 (actual_arg, first_actual_arg): New static variables.
148 * simplify.c (simplify_bound, gfc_simplify_range): Add
149 support for assumed-rank arrays.
150 * trans-array.c (gfc_conv_array_parameter): Ditto.
151 (gfc_get_descriptor_dimension): New function, which returns
152 the descriptor.
153 (gfc_conv_descriptor_dimension): Use it.
154 (gfc_conv_descriptor_stride_get, gfc_conv_array_parameter):
155 Handle GFC_ARRAY_ASSUMED_RANK_CONT and AS_ASSUMED_RANK.
156 * trans-array.h (gfc_get_descriptor_dimension): New prototype.
157 * trans-decl. (gfc_build_dummy_array_decl,
158 gfc_trans_deferred_vars, add_argument_checking): Add
159 support for assumed-rank arrays.
160 * trans-expr.c (gfc_conv_expr_present, gfc_conv_variable,
161 gfc_conv_procedure_call): Ditto.
162 (get_scalar_to_descriptor_type, class_array_data_assign,
163 conv_scalar_to_descriptor): New static functions.
164 (gfc_conv_derived_to_class, gfc_conv_class_to_class): Use
165 them.
166 * trans-intrinsic.c (get_rank_from_desc): New function.
167 (gfc_conv_intrinsic_rank, gfc_conv_associated): Use it.
168 * trans-types.c (gfc_array_descriptor_base_caf,
169 gfc_array_descriptor_base): Make space for scalar array.
170 (gfc_is_nodesc_array, gfc_is_nodesc_array,
171 gfc_build_array_type, gfc_get_array_descriptor_base): Add
172 support for assumed-rank arrays.
173 * trans.h (gfc_array_kind): Add GFC_ARRAY_ASSUMED_RANK and
174 GFC_ARRAY_ASSUMED_RANK_CONT.
175
176 2012-07-19 Tobias Burnus <burnus@net-b.de>
177
178 * trans-expr.c (gfc_conv_procedure_call): Fix handling
179 of polymorphic arguments.
180 * resolve.c (resolve_formal_arglist): Ditto, mark polymorphic
181 assumed-shape arrays as such.
182
183 2012-07-19 Tobias Burnus <burnus@net-b.de>
184
185 * interface.c (compare_parameter, compare_actual_formal): Fix
186 handling of polymorphic arguments.
187
188 2012-07-17 Janus Weil <janus@gcc.gnu.org>
189
190 PR fortran/51081
191 * error.c (gfc_notify_std): Automatically print the relevant Fortran
192 standard version.
193 * arith.c (arith_power): Remove explicit standard reference string.
194 * array.c (gfc_match_array_spec, gfc_match_array_constructor): Ditto.
195 * check.c (gfc_check_a_p, gfc_check_besn, gfc_check_count,
196 gfc_check_float, gfc_check_fn_rc2008, gfc_check_iand,
197 gfc_check_ichar_iachar, gfc_check_ieor, gfc_check_index, gfc_check_ior,
198 gfc_check_lbound, gfc_check_len_lentrim, check_rest, gfc_check_min_max,
199 gfc_check_null, gfc_check_scan, gfc_check_selected_real_kind,
200 gfc_check_shape, gfc_check_size, gfc_check_sngl, gfc_check_ubound,
201 gfc_check_verify): Ditto.
202 * data.c (gfc_assign_data_value): Ditto.
203 * decl.c (var_element, char_len_param_value, match_char_length,
204 gfc_verify_c_interop_param, match_pointer_init, variable_decl,
205 gfc_match_decl_type_spec, gfc_match_import, match_attr_spec,
206 gfc_match_prefix, gfc_match_suffix, match_ppc_decl,
207 match_procedure_in_interface, gfc_match_procedure,gfc_match_entry,
208 gfc_match_subroutine, gfc_match_end, gfc_match_codimension,
209 gfc_match_protected, gfc_match_value, gfc_match_volatile,
210 gfc_match_asynchronous, gfc_match_modproc, gfc_get_type_attr_spec,
211 gfc_match_enum, match_procedure_in_type): Ditto.
212 * expr.c (check_elemental, gfc_check_assign, gfc_check_pointer_assign):
213 Ditto.
214 * interface.c (gfc_match_abstract_interface, check_interface0): Ditto.
215 * intrinsic.c (gfc_intrinsic_func_interface): Ditto.
216 * io.c (format_lex, resolve_tag_format, resolve_tag,
217 compare_to_allowed_values, gfc_match_open, gfc_match_rewind,
218 gfc_resolve_dt, gfc_match_wait): Ditto.
219 * match.c (match_arithmetic_if, gfc_match_if, gfc_match_critical,
220 gfc_match_do, match_exit_cycle, gfc_match_pause, gfc_match_stop,
221 gfc_match_lock, sync_statement, gfc_match_assign, gfc_match_goto,
222 gfc_match_allocate, gfc_match_return, gfc_match_st_function): Ditto.
223 * module.c (gfc_match_use, gfc_use_module): Ditto.
224 * parse.c (parse_derived_contains, parse_block_construct,
225 parse_associate, parse_contained): Ditto.
226 * primary.c (match_hollerith_constant, match_boz_constant,
227 match_real_constant, match_sym_complex_part, match_arg_list_function,
228 build_actual_constructor, gfc_convert_to_structure_constructor): Ditto.
229 * resolve.c (resolve_formal_arglist, resolve_entries,
230 resolve_common_blocks, resolve_actual_arglist, gfc_resolve_index_1,
231 gfc_resolve_iterator_expr, resolve_ordinary_assign,
232 resolve_fl_var_and_proc, resolve_fl_variable_derived,
233 resolve_fl_procedure, resolve_fl_derived0, resolve_fl_derived,
234 resolve_fl_namelist, resolve_symbol, resolve_fntype): Ditto.
235 * symbol.c (check_conflict, conflict, gfc_add_is_bind_c,
236 gfc_add_extension, gfc_check_symbol_typed): Ditto.
237
238 2012-07-17 Tobias Burnus <burnus@net-b.de>
239
240 PR fortran/53985
241 * decl.c (gfc_verify_c_interop_param): Make warning conditional
242 on -Wc-binding-type works and improve the wording.
243
244 2012-07-17 Tobias Burnus <burnus@net-b.de>
245
246 PR fortran/52101
247 * decl.c (match_char_length): Extra argument, show obsolenscent
248 warning only if *length is used after the typename.
249 (variable_decl, gfc_match_char_spec): Update call
250
251 2012-07-17 Tobias Burnus <burnus@net-b.de>
252 Steven G. Kargl <kargl@gcc.gnu.org>
253
254 PR fortran/49265
255 * decl.c (match_procedure_in_interface): Support "::" for
256 Fortran 2008 and later.
257
258 2012-07-16 Thomas König <tkoenig@gcc.gnu.org>
259
260 PR fortran/53824
261 * resolve.c (resolve_allocate_deallocate): If both
262 start indices are NULL, skip the test for equality.
263
264 2012-07-16 Steven Bosscher <steven@gcc.gnu.org>
265
266 * f95-lang.c: Include dumpfile.h instead of tree-dump.h.
267 * Make-lang.in: Fix dependencies.
268
269 2012-07-16 Janus Weil <janus@gcc.gnu.org>
270
271 PR fortran/53956
272 * gfortran.h (gfc_copy_formal_args,gfc_copy_formal_args_ppc): Modified
273 prototypes.
274 * symbol.c (gfc_copy_formal_args): New argument 'if_src'. Copy if_source
275 of dummy procedures.
276 (gfc_copy_formal_args_ppc): Ditto.
277 * resolve.c (resolve_procedure_interface): Pass IFSRC_DECL to
278 gfc_copy_formal_args.
279 (resolve_fl_derived0): Pass IFSRC_DECL to gfc_copy_formal_args_ppc.
280
281 2012-07-12 Tobias Burnus <burnus@net-b.de>
282
283 * trans-expr.c (conv_isocbinding_procedure): Generate c_f_pointer code
284 inline.
285
286 2012-07-11 Steven Bosscher <steven@gcc.gnu.org>
287
288 * trans.c: Do not include defaults.h.
289 * trans-intrinsic.c: Likewise.
290
291 2012-07-08 Steven Bosscher <steven@gcc.gnu.org>
292
293 * gfortran.h: Do not include coretypes.h here.
294 Make it an error to include this before coretypes.h
295 * openmp.c: Include coretypes.h.
296 * interface.c: Likewise.
297 * intrinsic.c: Likewise.
298 * symbol.c: Likewise.
299 * class.c: Likewise.
300 * decl.c: Likewise.
301 * matchexp.c: Likewise.
302 * dump-parse-tree.c: Likewise.
303 * array.c: Likewise.
304 * constructor.c: Likewise.
305 * error.c: Likewise.
306 * data.c: Likewise.
307 * expr.c: Likewise.
308 * module.c: Likewise.
309 * scanner.c: Likewise.
310 * bbt.c: Likewise.
311 * io.c: Likewise.
312 * frontend-passes.c: Likewise.
313 * resolve.c: Likewise.
314 * st.c: Likewise.
315 * target-memory.c: Likewise.
316 * match.c: Likewise.
317 * arith.c: Likewise.
318 * parse.c: Likewise.
319 * check.c: Likewise.
320 * dependency.c: Likewise.
321 * primary.c: Likewise.
322 * misc.c: Likewise.
323 * simplify.c: Likewise.
324
325 2012-07-05 Mikael Morin <mikael@gcc.gnu.org>
326
327 PR fortran/53732
328 * trans-array.c (gfc_add_loop_ss_code): Disable self recursive calls
329 handling nested loop(s) if the subscript flag is true.
330
331 2012-07-05 Uros Bizjak <ubizjak@gmail.com>
332
333 PR fortran/53449
334 * parse.c (gfc_parse_file): Initialize errors_before.
335
336 2012-06-27 Janus Weil <janus@gcc.gnu.org>
337
338 PR fortran/41951
339 PR fortran/49591
340 * interface.c (check_new_interface): Rename, add 'loc' argument,
341 make non-static.
342 (gfc_add_interface): Rename 'check_new_interface'
343 * gfortran.h (gfc_check_new_interface): Add prototype.
344 * resolve.c (resolve_typebound_intrinsic_op): Add typebound operator
345 targets to non-typebound operator list.
346
347 2012-06-22 Janus Weil <janus@gcc.gnu.org>
348
349 PR fortran/47710
350 PR fortran/53328
351 * interface.c (count_types_test, generic_correspondence,
352 gfc_compare_interfaces): Ignore PASS arguments.
353 (check_interface1, compare_parameter): Pass NULL arguments to
354 gfc_compare_interfaces.
355 * gfortran.h (gfc_compare_interfaces): Modified prototype.
356 * expr.c (gfc_check_pointer_assign): Pass NULL arguments to
357 gfc_compare_interfaces.
358 * resolve.c (resolve_structure_cons): Ditto.
359 (check_generic_tbp_ambiguity): Determine PASS arguments and pass them
360 to gfc_compare_interfaces.
361
362 2012-06-21 Janne Blomqvist <jb@gcc.gnu.org>
363
364 PR fortran/39654
365 * iresolve.c (gfc_resolve_ftell): Fix result kind and use new
366 library function.
367
368 2012-06-18 Tobias Burnus <burnus@net-b.de>
369
370 * intrinsic.h (gfc_resolve_rank): New prototype.
371 * intrinsic.c (add_functions): Use gfc_resolve_rank.
372 * iresolve.c (add_functions): New function.
373 * trans-intrinsic.c (gfc_conv_intrinsic_rank): New function.
374 (gfc_conv_intrinsic_function): Call it.
375
376 2012-06-18 Tobias Burnus <burnus@net-b.de>
377
378 PR fortran/53692
379 * trans-array.c (set_loop_bounds): Don't scalarize via absent
380 optional arrays.
381 * resolve.c (resolve_elemental_actual): Don't stop resolving after printing
382 a warning.
383
384 2012-06-18 Tobias Burnus <burnus@net-b.de>
385
386 PR fortran/53526
387 * trans-intrinsic.c (conv_intrinsic_move_alloc): Handle coarrays.
388
389 2012-06-18 Tobias Burnus <burnus@net-b.de>
390
391 PR fortran/53526
392 * check.c (gfc_check_move_alloc): Reject coindexed actual arguments
393 and those with different corank.
394
395 2012-06-17 Tobias Burnus <burnus@net-b.de>
396
397 PR fortran/53691
398 PR fortran/53685
399 * check.c (gfc_calculate_transfer_sizes): Return if
400 SIZE= is not constant or source-size cannot be determined.
401
402 2012-06-16 Tobias Burnus <burnus@net-b.de>
403
404 PR fortran/53642
405 PR fortran/45170
406 * frontend-passes.c (optimize_assignment): Don't remove RHS's
407 trim when assigning to a deferred-length string.
408 * trans-expr.c (gfc_trans_assignment_1): Ensure that the RHS string
409 length is evaluated before the deferred-length LHS is reallocated.
410
411 2012-06-13 Tobias Burnus <burnus@net-b.de>
412
413 PR fortran/53643
414 * trans-decl.c (init_intent_out_dt): Fix for polymorphic arrays.
415 * trans-array.c (structure_alloc_comps): Don't loop for
416 scalar coarrays.
417
418 2012-06-13 Tobias Burnus <burnus@net-b.de>
419
420 PR fortran/53597
421 * decl.c (match_attr_spec): Only mark module variables
422 as SAVE_IMPLICIT for Fortran 2008 and later.
423
424 2012-06-08 Janus Weil <janus@gcc.gnu.org>
425
426 PR fortran/52552
427 * match.c (gfc_match_allocate): Modify order of checks. Change wording
428 of error message. Remove FIXME note.
429 * resolve.c (resolve_allocate_expr): Add a comment.
430
431 2012-06-07 Thomas König <tkoenig@gcc.gnu.org>
432
433 PR fortran/52861
434 * frontend-passes.c (optimize_assignment): Don't set the
435 length of an empty string for deferred-length character
436 variables.
437
438 2012-06-07 Thomas König <tkoenig@gcc.gnu.org>
439
440 PR fortran/52861
441 * frontend-passes.c (empty_string): Add prototype.
442 (optimize_assignment): Set the length of an empty string
443 constant to zero.
444
445 2012-06-04 Tobias Burnus <burnus@net-b.de>
446
447 PR fortran/50619
448 * resolve.c (build_default_init_expr): Don't initialize
449 ASSOCIATE names.
450
451 2012-06-03 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
452 Tobias Burnus <burnus@net-b.de>
453
454 PR fortran/48831
455 * gfortran.h (gfc_check_init_expr): Add prototype declaration
456 of function.
457 * check.c (kind_check): Change if condition to use
458 to gfc_check_init_expr.
459 * expr.c (check_init_expr): Remove forward declaration
460 and static keyword. Change name in gfc_check_init_expr.
461 (scalarize_intrinsic_call, check_init_expr_arguments,
462 check_inquiry, check_conversion, gfc_reduce_init_expr): Update
463 call to gfc_check_init_expr.
464
465 2012-05-31 Steven Bosscher <steven@gcc.gnu.org>
466
467 * trans-common.c: Do not include output.h.
468 * trans-decl.c: Likewise.
469
470 2012-05-31 Tobias Burnus <burnus@net-b.de>
471
472 PR fortran/53521
473 * trans.c (gfc_deallocate_scalar_with_status): Properly
474 handle the case size == 0.
475
476 2012-05-30 Tobias Burnus <burnus@net-b.de>
477
478 PR c/53502
479 * decl.c (match_attr_spec): Remove "typedef".
480
481 2012-05-30 Tobias Burnus <burnus@net-b.de>
482
483 * decl.c: Fix comment typos.
484 * expr.c: Ditto.
485 * frontend-passes.c: Ditto.
486 * match.c: Ditto.
487 * resolve.c: Ditto.
488 * trans-array.c: Ditto.
489 * trans-common.c: Ditto.
490 * trans-intrinsic.c: Ditto.
491 * trans-types.c: Ditto.
492
493 2012-05-23 Tobias Burnus <burnus@net-b.de>
494
495 PR fortran/51055
496 PR fortran/45170
497 * match.c (gfc_match_allocate): Set length_from_typespec
498 for characters.
499 * resolve.c (resolve_charlen): If set, don't check whether
500 the len is a specification expression.
501
502 2012-05-22 Tobias Burnus <burnus@net-b.de>
503
504 PR fortran/53389
505 * trans-array.c (gfc_add_loop_ss_code): Don't evaluate expression, if
506 ss->is_alloc_lhs is set.
507
508 2012-05-22 Dodji Seketeli <dodji@redhat.com>
509
510 PR c++/53322
511 * f95-lang.c (gfc_init_builtin_functions): Remove the unused
512 typedef builtin_type.
513
514 2012-05-14 Janne Blomqvist <jb@gcc.gnu.org>
515
516 PR fortran/52428
517 * gfortran.texi: Update _gfortran_set_options documentation.
518 * invoke.texi: Remove runtime behavior description of
519 -fno-range-check.
520 * trans-decl.c (create_main_function): Don't pass the range-check
521 setting to the library.
522
523 2012-05-14 Tobias Burnus <burnus@net-b.de>
524
525 PR fortran/49110
526 PR fortran/51055
527 PR fortran/53329
528 * trans-expr.c (gfc_trans_assignment_1): Fix allocation
529 handling for assignment of function results to allocatable
530 deferred-length strings.
531 * trans-decl.c (gfc_create_string_length): For deferred-length
532 module variables, include module name in the assembler name.
533 (gfc_get_symbol_decl): Don't override the assembler name.
534
535 2012-05-14 Manuel López-Ibáñez <manu@gcc.gnu.org>
536
537 PR 53063
538 * options.c (gfc_handle_option): Call lang-specific generated function.
539
540 2012-05-13 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
541 Tobias Burnus <burnus@net-b.de>
542
543 PR fortran/52158
544 PR fortran/45170
545 PR fortran/49430
546 * resolve.c (resolve_fl_derived0): Deferred character length
547 procedure components are supported.
548 * trans-expr.c (gfc_conv_procedure_call): Handle TBP with
549 deferred-length results.
550 (gfc_string_to_single_character): Add a new check to prevent
551 NULL read.
552 (gfc_conv_procedure_call): Remove unuseful checks on
553 symbol's attributes. Add new checks to prevent NULL read on
554 string length.
555
556 2012-05-12 Tobias Burnus <burnus@net-b.de>
557
558 PR fortran/49110
559 PR fortran/52843
560 * resolve.c (resolve_fl_procedure): Don't regard
561 character(len=:) as character(*) in the diagnostic.
562
563 2012-05-11 Thomas Koenig <tkoenig@gcc.gnu.org>
564
565 PR fortran/52537
566 * frontend-passes.c (optimize_op): Change
567 old-style comparison operators to new-style, simplify
568 switch as a result.
569 (empty_string): New function.
570 (get_len_trim_call): New function.
571 (optimize_comparison): If comparing to an empty string,
572 use comparison of len_trim to zero.
573 Use new-style comparison operators only.
574 (optimize_trim): Use get_len_trim_call.
575
576 2012-05-11 Manuel López-Ibáñez <manu@gcc.gnu.org>
577
578 PR 53063
579 * options.c: Include diagnostics.h instead of
580 diagnostics-core.h.
581 (set_Wall): Do not see warn_unused here.
582 (gfc_handle_option): Set it here using handle_generated_option.
583
584 2012-05-08 Jan Hubicka <jh@suse.cz>
585
586 * trans-common.c (create_common): Do not fake TREE_ASM_WRITTEN.
587 * trans-decl.c (gfc_finish_cray_pointee): Likewise.
588
589 2012-05-07 Tobias Burnus <burnus@net-b.de>
590
591 PR fortran/53255
592 * resolve.c (resolve_typebound_static): Fix handling
593 of overridden specific to generic operator.
594
595 2012-05-06 Tobias Burnus <burnus@net-b.de>
596
597 PR fortran/41587
598 * decl.c (build_struct): Don't ignore FAILED status.
599
600 2012-05-05 Paul Thomas <pault@gcc.gnu.org>
601
602 PR fortran/41600
603 * trans-array.c (build_array_ref): New static function.
604 (gfc_conv_array_ref, gfc_get_dataptr_offset): Call it.
605 * trans-expr.c (gfc_get_vptr_from_expr): New function.
606 (gfc_conv_derived_to_class): Add a new argument for a caller
607 supplied vptr and use it if it is not NULL.
608 (gfc_conv_procedure_call): Add NULL to call to above.
609 symbol.c (gfc_is_associate_pointer): Return true if symbol is
610 a class object.
611 * trans-stmt.c (trans_associate_var): Handle class associate-
612 names.
613 * expr.c (gfc_get_variable_expr): Supply the array-spec if
614 possible.
615 * trans-types.c (gfc_typenode_for_spec): Set GFC_CLASS_TYPE_P
616 for class types.
617 * trans.h : Add prototypes for gfc_get_vptr_from_expr and
618 gfc_conv_derived_to_class. Define GFC_CLASS_TYPE_P.
619 * resolve.c (resolve_variable): For class arrays, ensure that
620 the target expression has all the necessary _data references.
621 (resolve_assoc_var): Throw a "not yet implemented" error for
622 class array selectors that need a temporary.
623 * match.c (copy_ts_from_selector_to_associate,
624 select_derived_set_tmp, select_class_set_tmp): New functions.
625 (select_type_set_tmp): Call one of last two new functions.
626 (gfc_match_select_type): Copy_ts_from_selector_to_associate is
627 called if associate-name is typed.
628
629 PR fortran/53191
630 * resolve.c (resolve_ref): C614 applied to class expressions.
631
632 2012-05-05 Janne Blomqvist <jb@gcc.gnu.org>
633
634 PR fortran/49010
635 PR fortran/24518
636 * intrinsic.texi (MOD, MODULO): Mention sign and magnitude of result.
637 * simplify.c (gfc_simplify_mod): Use mpfr_fmod.
638 (gfc_simplify_modulo): Likewise, use copysign to fix the result if
639 zero.
640 * trans-intrinsic.c (gfc_conv_intrinsic_mod): Remove fallback as
641 builtin_fmod is always available. For modulo, call copysign to fix
642 the result when signed zeros are enabled.
643
644 2012-05-05 Janne Blomqvist <jb@gcc.gnu.org>
645
646 * gfortran.texi (GFORTRAN_TMPDIR): Rename to TMPDIR, explain
647 algorithm for choosing temp directory.
648
649 2012-05-04 Tobias Burnus <burnus@net-b.de>
650
651 PR fortran/53175
652 * resolve.c (resolve_variable): Set public_used
653 if a private module variable is used in a (public)
654 specification expression.
655 * trans-decl.c (gfc_finish_var_decl): Mark those
656 TREE_PUBLIC.
657
658 2012-05-04 Tobias Burnus <burnus@net-b.de>
659
660 PR fortran/53111
661 * resolve.c (resolve_fl_derived): Fix -std=f95
662 diagnostic for generic vs. DT names.
663
664 2012-05-03 Tobias Burnus <burnus@net-b.de>
665
666 PR fortran/52864
667 * interface.c (compare_parameter_intent): Remove.
668 (check_intents): Remove call, handle CLASS pointer.
669 (compare_actual_formal): Handle CLASS pointer.
670
671 2012-04-30 Jan Hubicka <jh@suse.cz>
672
673 * f95-lang.c (gfc_finish): Update comments.
674
675 2012-04-29 Thomas Koenig <tkoenig@gcc.gnu.org>
676
677 PR fortran/53148
678 * frontend-passes.c (create_var): If the statement has a label,
679 put the label around the block.
680
681 2012-04-25 Tobias Burnus <burnus@net-b.de>
682
683 PR fortran/52196
684 * lang.opt (Wrealloc-lhs, Wrealloc-lhs-all): New flags.
685 * gfortran.h (gfc_option_t): Add them.
686 * options.c (gfc_init_options, gfc_post_options,
687 gfc_handle_option): Handle them.
688 * invoke.texi: Document them.
689 * trans-expr.c (realloc_lhs_warning): New function.
690 (gfc_trans_arrayfunc_assign,
691 alloc_scalar_allocatable_for_assignment,
692 gfc_trans_assignment_1): Use it.
693
694 2012-04-18 Steven Bosscher <steven@gcc.gnu.org>
695
696 * trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR
697 with NULL_TREE type instead of void_type_node.
698 * trans-io.c (io_result): Likewise.
699 * trans-stmt.c (gfc_trans_integer_select,
700 gfc_trans_character_select): Likewise.
701
702 2012-04-16 Tobias Burnus <burnus@net-b.de>
703
704 PR fortran/52864
705 * expr.c (gfc_check_vardef_context): Fix assignment check for
706 pointer components.
707
708 2012-04-16 Janus Weil <janus@gcc.gnu.org>
709
710 PR fortran/52968
711 * class.c (gfc_build_class_symbol): Make sure the 'f2k_derived'
712 namespace is present.
713
714 2012-04-15 Janus Weil <janus@gcc.gnu.org>
715
716 PR fortran/51082
717 * trans-expr.c (gfc_conv_expr_reference): Check if the expression is a
718 simple function call (or a more involved PPC reference).
719
720 2012-04-15 Tobias Burnus <burnus@net-b.de>
721
722 PR fortran/52916
723 PR fortran/40973
724 * gfortran.h (symbol_attribute): Add public_used.
725 * interface.c (check_sym_interfaces, check_uop_interfaces,
726 gfc_check_interfaces): Set it.
727 * resolve.c (resolve_typebound_procedure): Ditto.
728 * trans-decl.c (build_function_decl): Use it.
729
730 2012-04-11 Tobias Burnus <burnus@net-b.de>
731
732 PR fortran/52729
733 * resolve.c (resolve_symbol): Fix searching for parent NS decl.
734
735 2012-04-08 Tobias Burnus <burnus@net-b.de>
736
737 PR fortran/52751
738 * trans-decl.c (gfc_finish_var_decl): Don't set TREE_PUBLIC
739 for PRIVATE module variables without C-binding label.
740
741 PR fortran/40973
742 * trans-decl.c (build_function_decl): Ditto for procedures.
743
744 2012-04-07 Thomas Koenig <tkoenig@gcc.gnu.org>
745
746 PR fortran/52893
747 * frontend-passes.c: Keep track of wether we are in an implicit
748 DO loop; do not do function elimination if we are.
749
750 2012-04-06 Thomas Koenig <tkoenig@gcc.gnu.org>
751
752 PR fortran/52668
753 * module.c: Only mark symbols as use_only if they have been
754 imported via an only list.
755
756 2012-03-28 Paul Thomas <pault@gcc.gnu.org>
757 Tobias Burnus <burnus@gcc.gnu.org>
758
759 PR fortran/52652
760 * match.c (gfc_match_allocate, gfc_match_deallocate): Change
761 "not.. or" to "neither.. nor".
762 * parse.c (decode_specification_statement): Correct error in
763 chpice of matching function for "allocatable".
764
765 2012-03-23 Janne Blomqvist <jb@gcc.gnu.org>
766
767 * gfortran.h (GFC_MAX_LINE): Remove unused macro.
768
769 2012-03-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
770
771 PR fortran/52559
772 * error.c (gfc_widechar_display_length): Consider tabs as
773 one character wide, as they're displayed as spaces.
774 (show_locus): Move tab handling to...
775 (print_wide_char_into_buffer): ... here.
776
777 2012-03-17 Tobias Burnus <burnus@net-b.de>
778
779 PR fortran/52585
780 * trans-intrinsic.c (gfc_conv_associated): Fix handling of
781 procpointer dummy arguments.
782
783 2012-03-16 Janne Blomqvist <jb@gcc.gnu.org>
784
785 * trans-intrinsic.c (build_round_expr): Don't use BUILT_IN_IROUND
786 for __float128.
787
788 2012-03-15 Janne Blomqvist <jb@gcc.gnu.org>
789
790 * f95-lang.c (gfc_init_builtin_functions): Initialize
791 BUILT_IN_IROUND.
792 * mathbuiltins.def: Add IROUND.
793 * trans-intrinsic.c (build_round_expr): Use BUILT_IN_IROUND if
794 type size matches.
795 (gfc_build_intrinsic_lib_fndecls): Build iround functions.
796
797 2012-03-12 Richard Guenther <rguenther@suse.de>
798
799 * f95-lang.c (builtin_type_for_size): Use gfc_type_for_size.
800
801 2012-03-12 Tobias Burnus <burnus@net-b.de>
802
803 PR fortran/52542
804 * decl.c (match_procedure_decl): If the interface
805 is bind(C), the procedure is as well.
806
807 2012-03-10 Steven Bosscher <steven@gcc.gnu.org>
808
809 * convert.c (convert): Fold BOOLEAN_TYPE types to the proper variant.
810
811 2012-03-09 Steven Bosscher <steven@gcc.gnu.org>
812
813 * Make-lang.in (convert.o): Depend on convert.h.
814 * convert.c: Header and comment cleanups.
815 (gfc_thruthvalue_conversion): Rename static function
816 to truthvalue_conversion. Do not use 'internal_error' from here,
817 use 'gcc_unreachable' instead.
818 (convert): Do not use 'error' for conversions to void, use
819 'gcc_unreachable' instead. Likewise for conversions to non-scalar
820 types. Do not hanlde ENUMERAL_TYPE, the front end never creates them.
821 Clean up #if 0 code.
822
823 2012-03-08 Tobias Burnus <burnus@net-b.de>
824
825 PR fortran/52469
826 * trans-types.c (gfc_get_function_type): Handle backend_decl
827 of a procedure pointer.
828
829 2012-03-06 Steven Bosscher <steven@gcc.gnu.org>
830
831 * f95-lang.c (yyerror, yylex): Remove.
832 (clear_binding_stack): Remove, fold into its only user.
833 (LANG_HOOKS_PRINT_IDENTIFIER): Do not re-define.
834 (ridpointers): Remove.
835 (gfc_eh_initialized_p): Make static.
836 (gfc_truthvalue_conversion): Move to convert.c.
837 (gfc_be_parse_file): Clear binding level stack when done.
838 (gfc_print_identifier): Remove.
839 (pushlevel): Remove ignored 'ignore' argument. Update all callers.
840 (poplevel): Remove unused 'reverse' argument. Update all callers.
841 (ggc_p): Remove.
842 (gfc_builtin_function): Make static. Do not attempt to make RTL for
843 builtin functions.
844 * convert.c (gfc_truthvalue_conversion): Moved here from f95-lang.c,
845 and made static.
846 * trans.h (pushlevel, poplevel): Adjust prototypes.
847 (gfc_truthvalue_conversion, gfc_builtin_function): Remove prototypes.
848 * trans-openmp.c: Update calls to pushlevel and poplevel.
849 * trans.c: Likewise.
850 * trans-decl.c: Likewise.
851
852 2012-03-04 Mikael Morin <mikael@gcc.gnu.org>
853
854 PR fortran/50981
855 * gfortran.h (gfc_is_class_container_ref): New prototype.
856 * class.c (gfc_is_class_container_ref): New function.
857 * trans-expr.c (gfc_conv_procedure_call): Add a "_data" component
858 reference to polymorphic actual arguments.
859
860 2012-03-04 Mikael Morin <mikael@gcc.gnu.org>
861
862 PR fortran/50981
863 * trans-expr.c (gfc_conv_procedure_call): Save se->ss's value.
864 Handle the case of unallocated arrays passed to elemental procedures.
865
866 2012-03-04 Mikael Morin <mikael@gcc.gnu.org>
867
868 * trans.h (struct gfc_ss_info): Move can_be_null_ref component from
869 the data::scalar subcomponent to the toplevel.
870 * trans-expr.c (gfc_conv_expr): Update component reference.
871 * trans-array.c (gfc_add_loop_ss_code): Ditto.
872 (gfc_walk_elemental_function_args): Ditto. Move the conditional setting
873 the field out of the scalar-only block.
874
875 2012-03-04 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
876
877 PR fortran/36160
878 * error.c (gfc_widechar_display_length, gfc_wide_display_length):
879 New functions.
880 (print_wide_char_into_buffer): Return length written.
881 (show_locus): Fix locus displayed when wide characters are present.
882
883 2012-03-04 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
884
885 * module.c (gfc_use_module): Improve error message some more.
886
887 2012-03-03 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
888
889 PR fortran/52313
890 * module.c (gfc_use_module): Improve error messages.
891
892 2012-03-03 Tobias Burnus <burnus@net-b.de>
893
894 PR fortran/48820
895 * resolve.c (resolve_actual_arglist): Properly reset
896 assumed_type_expr_allowed.
897
898 2012-03-03 Tobias Burnus <burnus@net-b.de>
899
900 * lang.opt (Wc-binding-type): New flag.
901 * options.c (gfc_init_options, gfc_handle_option): Handle it.
902 * invoke.texi (Wc-binding-type): Document it.
903 * gfortran.h (gfc_option_t): Add warn_c_binding_type.
904 * decl.c (verify_bind_c_sym): Handle -Wc-binding-type.
905 * symbol.c (gfc_set_default_type, verify_bind_c_derived_type):
906 Ditto.
907
908 2012-03-03 Tobias Burnus <burnus@net-b.de>
909
910 PR fortran/48820
911 * decl.c (gfc_match_decl_type_spec): Support type(*).
912 (gfc_verify_c_interop): Allow type(*).
913 * dump-parse-tree.c (show_typespec): Handle type(*).
914 * expr.c (gfc_copy_expr): Ditto.
915 * interface.c (compare_type_rank, compare_parameter,
916 compare_actual_formal, gfc_procedure_use): Ditto.
917 * libgfortran.h (bt): Add BT_ASSUMED.
918 * misc.c (gfc_basic_typename, gfc_typename): Handle type(*).
919 * module.c (bt_types): Ditto.
920 * resolve.c (assumed_type_expr_allowed): New static variable.
921 (resolve_actual_arglist, resolve_variable, resolve_symbol):
922 Handle type(*).
923 * trans-expr.c (gfc_conv_procedure_call): Ditto.
924 * trans-types.c (gfc_typenode_for_spec, gfc_get_dtype): Ditto.
925
926 2012-03-02 Tobias Burnus <burnus@net-b.de>
927
928 PR fortran/52325
929 * primary.c (gfc_match_varspec): Add missing ;.
930
931 2012-03-02 Tobias Burnus <burnus@net-b.de>
932
933 PR fortran/52325
934 * primary.c (gfc_match_varspec): Add diagnostic for % with
935 nonderived types.
936
937 2012-03-02 Tobias Burnus <burnus@net-b.de>
938
939 PR fortran/52270
940 * expr.c (gfc_check_vardef_context): Fix check for
941 intent-in polymorphic pointer .
942 * interface.c (compare_parameter): Allow passing TYPE to
943 intent-in polymorphic pointer.
944
945 2012-03-02 Tobias Burnus <burnus@net-b.de>
946
947 PR fortran/52452
948 * resolve.c (resolve_intrinsic): Don't search for a
949 function if we know that it is a subroutine.
950
951 2012-02-29 Paul Thomas <pault@gcc.gnu.org>
952
953 PR fortran/52386
954 * trans-expr.c (fcncall_realloc_result): Dereference the
955 descriptor if needed.
956
957 2012-02-22 Tobias Burnus <burnus@net-b.de>
958
959 PR fortran/52335
960 * io.c (gfc_match_open): Remove bogus F2003 DELIM= check.
961
962 2012-02-18 Tobias Burnus <burnus@net-b.de>
963
964 PR fortran/52295
965 * interface.c (check_interface0): Internal procs in
966 generic interfaces are allowed in Fortran 2008.
967
968 2012-02-17 Tobias Burnus <burnus@net-b.de>
969 Roland Stigge <stigge@antcom.de>
970
971 PR translation/52273
972 * interface.c (compare_actual_formal): Fix typo "at at".
973
974 2012-02-17 Tobias Burnus <burnus@net-b.de>
975
976 * gfortran.texi (Q exponent-letter): Fix grammar.
977
978 2012-02-17 Tobias Burnus <burnus@net-b.de>
979
980 * gfortran.texi (Status): Fix typos.
981 * invoke.texi (ffixed-form, fstack-arrays): Spell Fortran with
982 a majuscule.
983
984 2012-02-17 Tobias Burnus <burnus@net-b.de>
985 Roland Stigge <stigge@antcom.de>
986
987 PR translation/52232
988 PR translation/52234
989 PR translation/52245
990 PR translation/52246
991 PR translation/52262
992 PR translation/52273
993 * io.c (gfc_match_open): Fix typo.
994 * interface.c (compare_actual_formal): Ditto.
995 * lang.opt (freal-4-real-8, freal-4-real-16, freal-8-real-16): Ditto.
996 * match.c (alloc_opt_list, gfc_match_nullify): Ditto.
997 * check.c (gfc_check_associated, gfc_check_null): Ditto.
998
999 2012-02-12 Mikael Morin <mikael@gcc.gnu.org>
1000
1001 PR fortran/50981
1002 * trans-stmt.c (gfc_get_proc_ifc_for_call): New function.
1003 (gfc_trans_call): Use gfc_get_proc_ifc_for_call.
1004
1005 2012-02-12 Mikael Morin <mikael@gcc.gnu.org>
1006
1007 * trans-array.c (gfc_walk_elemental_function_args,
1008 gfc_walk_function_expr): Move call to gfc_get_proc_ifc_for_expr out
1009 of gfc_walk_elemental_function_args.
1010 * trans-stmt.c (gfc_trans_call): Ditto.
1011 * trans-array.h (gfc_get_proc_ifc_for_expr): New prototype.
1012 (gfc_walk_elemental_function_args): Update prototype.
1013
1014 2012-02-12 Mikael Morin <mikael@gcc.gnu.org>
1015
1016 * trans-array.c (gfc_get_proc_ifc_for_expr): New function.
1017 (gfc_walk_elemental_function_args): Move code to
1018 gfc_get_proc_ifc_for_expr and call it.
1019
1020 2012-02-08 Tobias Burnus <burnus@net-b.de>
1021
1022 PR fortran/52151
1023 * trans-expr.c (fcncall_realloc_result): Set also the stride.
1024
1025 2012-02-07 Tobias Burnus <burnus@net-b.de>
1026
1027 PR fortran/51514
1028 * trans-expr.c (gfc_conv_procedure_call): Add _data component
1029 for calls of scalar CLASS actuals to TYPE dummies.
1030
1031 2012-02-05 Thomas König <tkoenig@gcc.gnu.org>
1032
1033 PR fortran/48847
1034 * trans-decl.c: Warn about unused dummy procedure arguments
1035 if -Wunused-dummy-argument is specified. Suppress middle-end
1036 warnings about procedure arguments.
1037
1038 2012-02-05 Paul Thomas <pault@gcc.gnu.org>
1039
1040 * trans-array.c (gfc_array_allocate): Zero memory for all class
1041 array allocations.
1042 * trans-stmt.c (gfc_trans_allocate): Ditto for class scalars.
1043
1044 PR fortran/52102
1045 * trans-stmt.c (gfc_trans_allocate): Before correcting a class
1046 array reference, ensure that 'dataref' points to the _data
1047 component that is followed by the array reference..
1048
1049 2012-02-02 Mikael Morin <mikael@gcc.gnu.org>
1050
1051 PR fortran/41587
1052 PR fortran/46356
1053 PR fortran/51754
1054 PR fortran/50981
1055 * class.c (insert_component_ref, class_data_ref_missing,
1056 gfc_fix_class_refs): New functions.
1057 * gfortran.h (gfc_fix_class_refs): New prototype.
1058 * trans-expr.c (gfc_conv_expr): Remove special case handling and call
1059 gfc_fix_class_refs instead.
1060
1061 2012-02-02 Paul Thomas <pault@gcc.gnu.org>
1062
1063 PR fortran/52012
1064 * trans-expr.c (fcncall_realloc_result): If variable shape is
1065 correct, retain the bounds, whatever they are.
1066
1067 2012-02-02 Tobias Burnus <burnus@net-b.de>
1068
1069 PR fortran/52093
1070 * simplify.c (gfc_simplify_size): Handle INTRINSIC_PARENTHESES.
1071
1072 2012-02-01 Thomas König <tkoenig@gcc.gnu.org>
1073
1074 PR fortran/51958
1075 * frontend-passes.c (convert_elseif): New function.
1076 (optimize_namespace): Call it.
1077
1078 2012-02-01 Tobias Burnus <burnus@net-b.de>
1079
1080 PR fortran/52024
1081 * module.c (MOD_VERSION): Bump.
1082 (mio_typebound_proc): Read/write is_operator from/to the
1083 .mod file.
1084
1085 2012-02-01 Tobias Burnus <burnus@net-b.de>
1086
1087 PR fortran/52059
1088 * trans-expr.c (gfc_conv_procedure_call): Add array ref
1089 only to variables.
1090
1091 2012-01-31 Tobias Burnus <burnus@net-b.de>
1092
1093 PR fortran/52024
1094 * gfortran.h (gfc_tbp_generic): Store whether the
1095 generic is an operator.
1096 * decl.c (gfc_match_generic): Set that flag.
1097 * resolve.c (check_generic_tbp_ambiguity): Use it in the
1098 gfc_compare_interfaces check.
1099
1100 2012-01-31 Tobias Burnus <burnus@net-b.de>
1101
1102 PR fortran/52029
1103 * class.c (gfc_find_derived_vtab): Mark _copy function as pure.
1104
1105 2012-01-31 Tobias Burnus <burnus@net-b.de>
1106
1107 PR fortran/52013
1108 * class.c (get_unique_hashed_string): Adapt trim length.
1109 (gfc_build_class_symbol) Encode also corank in the container name.
1110
1111 2012-01-31 Paul Thomas <pault@gcc.gnu.org>
1112
1113 PR fortran/52012
1114 * trans-expr.c (fcncall_realloc_result): Correct calculation of
1115 result offset.
1116
1117 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
1118
1119 * module.c (pointer_info): Make true_name and module pointers
1120 rather than arrays, order pointers before other fields.
1121 (free_pi_tree): free true_name and module as well.
1122 (mio_read_string): Rename to read_string.
1123 (mio_write_string): Remove.
1124 (load_commons): Use read_string.
1125 (read_module): Use read_string rather than mio_internal_string.
1126 (write_blank_common): Call write_atom directly.
1127 (write_symbol): Likewise.
1128
1129 2012-01-29 Tobias Burnus <burnus@net-b.de>
1130
1131 PR fortran/41600
1132 * expr.c (gfc_default_initializer): Convert the values if
1133 the type does not match.
1134
1135 2012-01-29 Tobias Burnus <burnus@net-b.de>
1136
1137 PR fortran/51972
1138 * trans-array.c (structure_alloc_comps): Fix assignment of
1139 polymorphic components (polymorphic deep copying).
1140
1141 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
1142
1143 PR fortran/51808
1144 * decl.c (set_binding_label): Make binding_label argument const.
1145 (curr_binding_label): Constify.
1146 * gfortran.h (gfc_symbol): Constify binding_label.
1147 (gfc_common_head): Likewise.
1148 (get_iso_c_sym): Likewise.
1149 * match.c (gfc_match_name_C): Constify buffer argument.
1150 * match.h (gfc_match_name_C): Likewise.
1151 * resolve.c (set_name_and_label): Constify binding_label argument.
1152 (gfc_iso_c_sub_interface): Constify binding_label variable.
1153 * symbol.c (get_iso_c_sym): Constify binding_label argument.
1154
1155 2012-01-29 Janne Blomqvist <jb@gcc.gnu.org>
1156
1157 PR fortran/51808
1158 * decl.c (set_binding_label): Move prototype from match.h to here.
1159 (curr_binding_label): Make a pointer rather than static array.
1160 (build_sym): Check sym->binding_label pointer rather than array,
1161 update set_binding_label call, handle curr_binding_label changes.
1162 (set_binding_label): Handle new curr_binding_label, dest_label
1163 double ptr, and sym->binding_label.
1164 (verify_bind_c_sym): Handle sym->binding_label being a pointer.
1165 (set_verify_bind_c_sym): Check sym->binding_label pointer rather
1166 than array, update set_binding_label call.
1167 (gfc_match_bind_c_stmt): Handle curr_binding_label change.
1168 (match_procedure_decl): Update set_binding_label call.
1169 (gfc_match_bind_c): Change binding_label to pointer, update
1170 gfc_match_name_C call.
1171 * gfortran.h (GFC_MAX_BINDING_LABEL_LEN): Remove macro.
1172 (gfc_symbol): Make binding_label a pointer.
1173 (gfc_common_head): Likewise.
1174 * match.c (gfc_match_name_C): Heap allocate bind(C) name.
1175 * match.h (gfc_match_name_C): Change prototype argument.
1176 (set_binding_label): Move prototype to decl.c.
1177 * module.c (struct pointer_info): Make binding_label a pointer.
1178 (free_pi_tree): Free unused binding_label.
1179 (mio_read_string): New function.
1180 (mio_write_string): New function.
1181 (load_commons): Redo reading of binding_label.
1182 (read_module): Likewise.
1183 (write_common_0): Change to write empty string instead of name if
1184 no binding_label.
1185 (write_blank_common): Write empty string for binding label.
1186 (write_symbol): Change to write empty string instead of name if no
1187 binding_label.
1188 * resolve.c (gfc_iso_c_func_interface): Don't set binding_label.
1189 (set_name_and_label): Make binding_label double pointer, use
1190 asprintf.
1191 (gfc_iso_c_sub_interface): Make binding_label a pointer.
1192 (resolve_bind_c_comms): Handle cases if
1193 gfc_common_head->binding_label is NULL.
1194 (gfc_verify_binding_labels): sym->binding_label is a pointer.
1195 * symbol.c (gfc_new_symbol): Rely on XCNEW zero init for
1196 binding_label.
1197 (gen_special_c_interop_ptr): Don't set binding label.
1198 (generate_isocbinding_symbol): Insert binding_label into symbol
1199 table.
1200 (get_iso_c_sym): Use pointer assignment instead of strcpy.
1201 * trans-common.c (gfc_sym_mangled_common_id): Handle
1202 com->binding_label being a pointer.
1203 * trans-decl.c (gfc_sym_mangled_identifier): Handle
1204 sym->binding_label being a pointer.
1205 (gfc_sym_mangled_function_id): Likewise.
1206
1207 2012-01-29 Tobias Burnus <burnus@net-b.de>
1208
1209 PR fortran/52038
1210 * resolve.c (symbol_as): Remove unused, accidentally
1211 added function.
1212
1213 2012-01-28 Tobias Burnus <burnus@net-b.de>
1214
1215 PR fortran/51972
1216 * trans-stmt.c (gfc_trans_allocate): Properly check whether
1217 we have a BT_CLASS which needs to be memset.
1218
1219 2012-01-27 Tobias Burnus <burnus@net-b.de>
1220
1221 PR fortran/52022
1222 * trans-expr.c (gfc_conv_procedure_call): Fix passing
1223 of functions, which return allocatables.
1224
1225 2012-01-27 Tobias Burnus <burnus@net-b.de>
1226
1227 PR fortran/52016
1228 * resolve.c (resolve_formal_arglist): Fix elemental
1229 constraint checks for polymorphic dummies also for
1230 pointers.
1231
1232 2012-01-27 Tobias Burnus <burnus@net-b.de>
1233
1234 PR fortran/51970
1235 PR fortran/51977
1236 * primary.c (gfc_match_varspec. gfc_match_rvalue): Set
1237 handle array spec for BT_CLASS.
1238 * expr.c (gfc_get_variable_expr, gfc_lval_expr_from_sym)
1239 * frontend-passes.c (create_var): Ditto.
1240 * resolve.c (resolve_actual_arglist, resolve_assoc_var): Ditto.
1241 * trans-decl.c (gfc_trans_deferred_vars): Use class_pointer
1242 instead of attr.pointer.
1243 (gfc_generate_function_code): Use CLASS_DATA (sym) for BT_CLASS.
1244 * trans-intrinsic.c (conv_intrinsic_move_alloc): Move assert.
1245 * trans-stmt.c (trans_associate_var): Ask for the descriptor.
1246
1247 2012-01-27 Tobias Burnus <burnus@net-b.de>
1248
1249 PR fortran/51953
1250 * match.c (gfc_match_allocate): Allow more than allocate
1251 object with SOURCE=.
1252
1253 2012-01-27 Tobias Burnus <burnus@net-b.de>
1254
1255 PR fortran/52016
1256 * resolve.c (resolve_formal_arglist): Fix elemental
1257 constraint checks for polymorphic dummies.
1258
1259 2012-01-27 Paul Thomas <pault@gcc.gnu.org>
1260 Tobias Burnus <burnus@gcc.gnu.org>
1261
1262 PR fortran/48705
1263 PR fortran/51870
1264 PR fortran/51943
1265 PR fortran/51946
1266 * trans-array.c (gfc_array_init_size): Add two extra arguments
1267 to convey the dynamic element size of a calls object and to
1268 return the number of elements that have been allocated.
1269 (gfc_array_allocate): Add the same arguments and use them to
1270 call gfc_array_init_size. Before the allocation dereference
1271 the data pointer, if necessary. Set the allocated array to zero
1272 if the class element size or expr3 are non-null.
1273 * trans-expr.c (gfc_conv_class_to_class): Give this function
1274 global scope.
1275 (get_class_array_ref): New function.
1276 (gfc_copy_class_to_class): New function.
1277 * trans-array.h : Update prototype for gfc_array_allocate.
1278 * trans-stmt.c (gfc_trans_allocate): For non-variable class
1279 STATUS expressions extract the class object and the dynamic
1280 element size. Use the latter to call gfc_array_allocate and
1281 the former for setting the vptr and, via
1282 gfc_copy_class_to_clasfc_cs, to copy to the allocated data.
1283 * trans.h : Prototypes for gfc_get_class_array_ref,
1284 gfc_copy_class_to_class and gfc_conv_class_to_class.
1285
1286 2012-01-25 Tobias Burnus <burnus@net-b.de>
1287
1288 * resolve.c (symbol_as): Check also for attr.class_ok.
1289
1290 2012-01-25 Tobias Burnus <burnus@net-b.de>
1291
1292 PR fortran/51995
1293 * class.c (gfc_build_class_symbol): Fix invalid freeing
1294 issue with fclass->f2k_derived.
1295
1296 2012-01-25 Tobias Burnus <burnus@net-b.de>
1297
1298 PR fortran/51995
1299 * class.c (gfc_build_class_symbol): Ensure that
1300 fclass->f2k_derived is set.
1301
1302 2012-01-25 Tobias Burnus <burnus@net-b.de>
1303
1304 PR fortran/51966
1305 * resolve.c (resolve_structure_cons): Only create an
1306 array constructors for nonscalars.
1307
1308 2012-01-23 Tobias Burnus <burnus@net-b.de>
1309
1310 PR fortran/51948
1311 * check.c (variable_check): Fix checking for
1312 variables and deeply nested BLOCKs.
1313
1314 2012-01-21 Tobias Burnus <burnus@net-b.de>
1315 Steven G. Kargl <kargl@gcc.gnu.org>
1316
1317 PR fortran/50556
1318 * symbol.c (check_conflict): namelist-group-name cannot have the SAVE
1319 attribute.
1320
1321 2012-01-21 Tobias Burnus <burnus@net-b.de>
1322
1323 PR fortran/51913
1324 * interface.c (compare_parameter): Fix CLASS comparison.
1325
1326 2012-01-20 Tobias Burnus <burnus@net-b.de>
1327 Janus Weil <janus@gcc.gnu.org>
1328
1329 PR fortran/51056
1330 * module.c (load_needed, read_module): Don't mark __vtab etc.
1331 as use_only.
1332
1333 2012-01-19 Tobias Burnus <burnus@net-b.de>
1334
1335 PR fortran/51904
1336 * expr.c (gfc_build_intrinsic_call): Also set the symtree.
1337
1338 2012-01-18 Paul Thomas <pault@gcc.gnu.org>
1339
1340 PR fortran/51634
1341 * trans-expr.c (gfc_conv_procedure_call): Deallocate allocatable
1342 components of temporary class arguments.
1343
1344 2012-01-17 Tobias Burnus <burnus@net-b.de>
1345 Janne Blomqvist <jb@gcc.gnu.org>
1346
1347 PR fortran/51869
1348 * trans-expr.c (alloc_scalar_allocatable_for_assignment): Nullify
1349 LHS after allocation, if it has allocatable components.
1350 * f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_CALLOC.
1351
1352 2012-01-16 Mikael Morin <mikael@gcc.gnu.org>
1353 Tobias Burnus <burnus@net-b.de>
1354
1355 PR fortran/50981
1356 * trans-array.c (gfc_walk_elemental_function_args): Fix
1357 passing of deallocated allocatables/pointers as absent argument.
1358
1359 2012-01-16 Tobias Burnus <burnus@net-b.de>
1360
1361 PR fortran/51809
1362 * class.c (gfc_find_derived_vtab): Mark __vtab and
1363 __def_init as FL_VARIABLE not as FL_PARAMETER.
1364 * expr.c (gfc_simplify_expr): Remove special
1365 handling of __vtab.
1366 * resolve.c (resolve_values): Ditto.
1367 * trans-decl.c (gfc_get_symbol_decl): Mark __vtab
1368 and __def_init as TREE_READONLY.
1369
1370 2012-01-16 Zydrunas Gimbutas <gimbutas@cims.nyu.edu>
1371 Andreas Kloeckner <kloeckner@cims.nyu.edu>
1372 Steven G. Kargl <kargl@gcc.gnu.org>
1373
1374 PR fortran/48426
1375 * gfortran.h (gfc_option_t): Add members flag_*_kind to store kind.
1376 * lang.opt: Add options -freal-4-real-8, -freal-4-real-10,
1377 -freal-4-real-16, -freal-8-real-4, -freal-8-real-10, -freal-8-real-16
1378 and -finteger-4-integer-8. User-desired type conversion information.
1379 * decl.c (gfc_match_old_kind_spec,kind_expr): Type conversions
1380 in declaration parsing.
1381 * trans-types.c (gfc_init_kinds): User-specified type conversion
1382 checked for current backend.
1383 * primary.c (match_integer_constant,match_real_constant): Implement
1384 type conversion in constant parsing.
1385 * options.c (gfc_init_options,gfc_handle_option): Translate input
1386 options to flags in internal options data structure.
1387 * invoke.texi: Document new options. Re-order options in Options
1388 summary section.
1389
1390 2012-01-16 Paul Thomas <pault@gcc.gnu.org>
1391
1392 * trans-array.c (gfc_trans_create_temp_array): In the case of a
1393 class array temporary, detect a null 'eltype' on entry and use
1394 'initial' to provde the class reference and so, through the
1395 vtable, the element size for the dynamic type.
1396 * trans-stmt.c (gfc_conv_elemental_dependencies): For class
1397 expressions, set 'eltype' to null and pass the values via the
1398 'initial' expression.
1399
1400 2012-01-14 Tobias Burnus <burnus@net-b.de>
1401
1402 PR fortran/51800
1403 * resolve.c (build_default_init_expr): Also initialize
1404 nonconstant-length strings with -finit-character=<n>.
1405
1406 2011-01-14 Tobias Burnus <burnus@net-b.de>
1407
1408 PR fortran/51816
1409 * module.c (read_module): Don't make nonexisting
1410 intrinsic operators as found.
1411 (rename_list_remove_duplicate): New function.
1412 (gfc_use_modules): Use it.
1413
1414 2012-01-13 Paul Thomas <pault@gcc.gnu.org>
1415
1416 PR fortran/48351
1417 * trans-array.c (structure_alloc_comps): Suppress interative
1418 call to self, when current component is deallocated using
1419 gfc_trans_dealloc_allocated.
1420 * class.c (gfc_build_class_symbol): Copy the 'alloc_comp'
1421 attribute from the declared type to the class structure.
1422
1423 2012-01-13 Tobias Burnus <burnus@net-b.de>
1424
1425 PR fortran/51842
1426 * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
1427 instead of a signed int of size POINTER_SIZE for
1428 gfc_index_integer_kind.
1429
1430 2012-01-12 Tobias Burnus <burnus@net-b.de>
1431
1432 PR fortran/36755
1433 * intrinsic.texi (CHMOD): Extend a bit and remove statement
1434 that /bin/chmod is called.
1435
1436 2012-01-10 Gerald Pfeifer <gerald@pfeifer.com>
1437
1438 * gfortran.texi (Fortran 2003 Status): Fix grammar.
1439
1440 2012-01-10 Tobias Burnus <burnus@net-b.de>
1441
1442 PR fortran/51652
1443 * resolve.c (resolve_allocate_expr): For non-deferred char lengths,
1444 check whether type-spec matches declaration.
1445
1446 2012-01-10 Tobias Burnus <burnus@net-b.de>
1447
1448 * resolve.c (resolve_ordinary_assign): Improve error wording.
1449
1450 2012-01-09 Paul Thomas <pault@gcc.gnu.org>
1451
1452 PR fortran/51791
1453 * interface.c (matching_typebound_op): Drill down through
1454 possible parentheses to obtain base expression. Do not test for
1455 'class_ok' but, instead for the class structure components.
1456 * resolve.c (resolve_ordinary_assign): Extend error message for
1457 polymorphic assignment to advise checking for specific
1458 subroutine.
1459
1460 PR fortran/51792
1461 * resolve.c (resolve_typebound_function): Restore 'static' to
1462 declaration.
1463
1464 2012-01-09 Mikael Morin <mikael@gcc.gnu.org>
1465
1466 PR fortran/51758
1467 * trans-array.c (gfc_walk_elemental_function_args):
1468 Skip over NULL() actual arguments.
1469
1470 2012-01-09 Tobias Burnus <burnus@net-b.de>
1471
1472 * gfortran.texi: Bump copyright year.
1473 (Fortran 2003 Status): Update polymorphism item, add
1474 item for generic interface with DT name.
1475
1476 2012-01-09 Tobias Burnus <burnus@net-b.de>
1477
1478 PR fortran/51578
1479 * gfortran.h (gfc_use_list):
1480 * match.h (gfc_use_module): Rename to ...
1481 (gfc_use_modules): ... this.
1482 * module.c (use_locus, specified_nonint, specified_int): Remove
1483 global variable.
1484 (module_name): Change type to const char*, used with gfc_get_string.
1485 (module_list): New global variable.
1486 (free_rename): Free argument not global var.
1487 (gfc_match_use): Save match to module_list.
1488 (load_generic_interfaces, read_module): Don't free symtree.
1489 (write_dt_extensions, gfc_dump_module): Fix module-name I/O due to the
1490 type change of module_name.
1491 (write_symbol0, write_generic): Optimize due to the type change.
1492 (import_iso_c_binding_module, use_iso_fortran_env_module): Use
1493 locus of rename->where.
1494 (gfc_use_module): Take module_list as argument.
1495 (gfc_use_modules): New function.
1496 (gfc_module_init_2, gfc_module_done_2): Init module_list, rename_list.
1497 * parse.c (last_was_use_stmt): New global variable.
1498 (use_modules): New function.
1499 (decode_specification_statement, decode_statement): Move USE match up
1500 and call use_modules.
1501 (next_free, next_fixed): Call use_modules.
1502 (accept_statement): Don't call gfc_module_use.
1503
1504 2012-01-06 Tobias Burnus <burnus@net-b.de>
1505
1506 * trans-openmp.c (gfc_omp_clause_dtor, gfc_trans_omp_array_reduction):
1507 Update call to gfc_trans_dealloc_allocated.
1508 * trans.c (gfc_allocate_using_malloc): Fix spacing.
1509 (gfc_allocate_allocatable): For gfc_allocate_using_lib, jump to
1510 label_finish when an error occurs.
1511 (gfc_deallocate_with_status): Call caf_deregister for -fcoarray=lib.
1512 * trans.h (gfc_allocate_allocatable, gfc_deallocate_with_status):
1513 Update prototype.
1514 (gfor_fndecl_caf_deregister): New tree symbol.
1515 * trans-expr.c (gfc_conv_procedure_call): Update
1516 gfc_deallocate_with_status and gfc_trans_dealloc_allocated calls.
1517 * trans-array.c (gfc_array_allocate, gfc_trans_dealloc_allocated,
1518 structure_alloc_comps, gfc_trans_deferred_array): Ditto.
1519 (gfc_array_deallocate): Handle coarrays with -fcoarray=lib.
1520 * trans-array.h (gfc_array_deallocate, gfc_array_allocate,
1521 gfc_trans_dealloc_allocated): Update prototypes.
1522 * trans-stmt.c (gfc_trans_sync): Fix indentation.
1523 (gfc_trans_allocate): Fix errmsg padding and label handling.
1524 (gfc_trans_deallocate): Ditto and handle -fcoarray=lib.
1525 * expr.c (gfc_is_coarray): Fix algorithm for BT_CLASS.
1526 * libgfortran.h (GFC_STAT_STOPPED_IMAGE): Use large value
1527 to avoid other stats accidentally matching this one.
1528 * trans-decl.c (gfor_fndecl_caf_deregister): New global var.
1529 (gfc_build_builtin_function_decls): Fix prototype decl of caf_register
1530 and add decl for caf_deregister.
1531 (gfc_trans_deferred_vars): Handle CAF vars with -fcoarrays=lib.
1532 * trans-intrinsic.c (conv_intrinsic_move_alloc): Update call to
1533 gfc_deallocate_with_status.
1534
1535 2012-01-05 Paul Thomas <pault@gcc.gnu.org>
1536
1537 PR fortran/PR48946
1538 * resolve.c (resolve_typebound_static): If the typebound
1539 procedure is 'deferred' try to find the correct specific
1540 procedure in the derived type operator space itself.
1541
1542 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
1543
1544 PR fortran/50981
1545 * trans-array.h (gfc_walk_elemental_function_args): New argument.
1546 * trans-intrinsic.c (gfc_walk_intrinsic_function): Update call.
1547 * trans-stmt.c (gfc_trans_call): Ditto.
1548 * trans-array.c (gfc_walk_function_expr): Ditto.
1549 (gfc_walk_elemental_function_args): Get the dummy argument list
1550 if possible. Check that the dummy and the actual argument are both
1551 optional, and set can_be_null_ref accordingly.
1552
1553 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
1554
1555 PR fortran/50981
1556 * trans.h (struct gfc_ss_info): New field data::scalar::can_be_null_ref
1557 * trans-array.c: If the reference can be NULL, save the reference
1558 instead of the value.
1559 * trans-expr.c (gfc_conv_expr): If we have saved a reference,
1560 dereference it.
1561
1562 2012-01-04 Mikael Morin <mikael@gcc.gnu.org>
1563
1564 * trans-expr.c (gfc_conv_expr): Move address taking...
1565 (gfc_conv_expr_reference): ... here.
1566
1567 2012-01-04 Thomas Koenig <tkoenig@gcc.gnu.org>
1568
1569 PR fortran/49693
1570 * trans-common.c (create_common): Update copyright years. Mark
1571 variables as used to avoid warnings about unused variables in
1572 common blocks.
1573
1574 2012-01-03 Hans-Peter Nilsson <hp@axis.com>
1575
1576 * gfortran.h (struct gfc_expr): Add missing "struct"
1577 qualifier for member base_expr.
1578
1579 2012-01-02 Paul Thomas <pault@gcc.gnu.org>
1580
1581 PR fortran/51529
1582 * trans-array.c (gfc_array_allocate): Null allocated memory of
1583 newly allocted class arrays.
1584
1585 PR fortran/46262
1586 PR fortran/46328
1587 PR fortran/51052
1588 * interface.c(build_compcall_for_operator): Add a type to the
1589 expression.
1590 * trans-expr.c (conv_base_obj_fcn_val): New function.
1591 (gfc_conv_procedure_call): Use base_expr to detect non-variable
1592 base objects and, ensuring that there is a temporary variable,
1593 build up the typebound call using conv_base_obj_fcn_val.
1594 (gfc_trans_class_assign): Pick out class procedure pointer
1595 assignments and do the assignment with no further prcessing.
1596 (gfc_trans_class_array_init_assign, gfc_trans_class_init_assign
1597 gfc_trans_class_assign): Move to top of file.
1598 * gfortran.h : Add 'base_expr' field to gfc_expr.
1599 * resolve.c (get_declared_from_expr): Add 'types' argument to
1600 switch checking of derived types on or off.
1601 (resolve_typebound_generic_call): Set the new argument.
1602 (resolve_typebound_function, resolve_typebound_subroutine):
1603 Set 'types' argument for get_declared_from_expr appropriately.
1604 Identify base expression, if not a variable, in the argument
1605 list of class valued calls. Assign it to the 'base_expr' field
1606 of the final expression. Strip away all references after the
1607 last class reference.
1608
1609 2012-01-02 Tobias Burnus <burnus@net-b.de>
1610
1611 PR fortran/51682
1612 * trans-intrinsic.c (trans_this_image, trans_image_index,
1613 trans_num_images, conv_intrinsic_cobound): Fold_convert the
1614 caf_num_images/caf_this_images variables to the correct int kind.
1615
1616 2012-01-01 Jakub Jelinek <jakub@redhat.com>
1617
1618 * gfortranspec.c (lang_specific_driver): Update copyright notice
1619 dates.
1620 \f
1621 Copyright (C) 2012 Free Software Foundation, Inc.
1622
1623 Copying and distribution of this file, with or without modification,
1624 are permitted in any medium without royalty provided the copyright
1625 notice and this notice are preserved.