re PR fortran/37336 ([F03] Finish derived-type finalization)
[gcc.git] / gcc / fortran / ChangeLog
1 2013-05-28 Tobias Burnus <burnus@net-b.de>
2
3 PR fortran/37336
4 * resolve.c (gfc_resolve_finalizers): Remove not implemented error.
5
6 2013-05-28 Tobias Burnus <burnus@net-b.de>
7
8 * trans-expr.c (gfc_conv_procedure_call): Deallocate
9 polymorphic arrays for allocatable intent(out) dummies.
10 (gfc_reset_vptr): New function, moved from trans-stmt.c
11 and extended.
12 * trans-stmt.c (reset_vptr): Remove.
13 (gfc_trans_deallocate): Update calls.
14 * trans.h (gfc_reset_vptr): New prototype.
15
16 2013-05-28 Dominique d'Humieres <dominiq@lps.ens.fr>
17
18 PR fortran/57435
19 * module.c (check_for_ambiguous): Avoid null pointer deref.
20
21 2013-05-28 Janus Weil <janus@gcc.gnu.org>
22 Tobias Burnus <burnus@net-b.de>
23
24 PR fortran/57217
25 * interface.c (check_dummy_characteristics): Symmetrize type check.
26
27 2013-05-27 Bud Davis <jmdavis@link.com>
28
29 PR fortran/50405
30 * resolve.c (resolve_formal_arglist): Detect error when an argument
31 has the same name as the function.
32
33 2013-05-27 Tobias Burnus <burnus@net-b.de>
34
35 * expr.c (gfc_build_intrinsic_call): Make symbol as attr.artificial.
36 * intrinsic.c (gfc_is_intrinsic): Disable std check for those.
37
38 2013-05-22 Tobias Burnus <burnus@net-b.de>
39
40 * resolve.c (get_temp_from_expr): Change mangling to
41 start always with a _.
42
43 2013-05-22 Tobias Burnus <burnus@net-b.de>
44
45 * resolve.c (get_temp_from_expr): Fix temp var mangling.
46
47 2013-05-22 Tobias Burnus <burnus@net-b.de>
48
49 PR fortran/57364
50 * resolve.c (get_temp_from_expr): Commit created sym.
51
52 2013-05-22 Tobias Burnus <burnus@net-b.de>
53
54 PR fortran/57338
55 * intrinsic.c (do_check): Move some checks to ...
56 (do_ts29113_check): ... this new function.
57 (check_specific, gfc_intrinsic_sub_interface): Call it.
58
59 2013-05-22 Janne Blomqvist <jb@gcc.gnu.org>
60
61 * intrinsic.texi (RANDOM_SEED): Improve example.
62
63 2013-05-21 Tobias Burnus <burnus@net-b.de>
64
65 PR fortran/57035
66 * intrinsic.c (do_check): Add constraint check for
67 NO_ARG_CHECK, assumed rank and assumed type.
68 * gfortran.texi (NO_ARG_CHECK): Minor wording change,
69 allow PRESENT intrinsic.
70
71 2013-05-20 Tobias Burnus <burnus@net-b.de>
72
73 PR fortran/48858
74 PR fortran/55465
75 * decl.c (add_global_entry): Add sym_name.
76 * parse.c (add_global_procedure): Ditto.
77 * resolve.c (resolve_bind_c_derived_types): Handle multiple decl for
78 a procedure.
79 (resolve_global_procedure): Handle gsym->ns pointing to a module.
80 * trans-decl.c (gfc_get_extern_function_decl): Ditto.
81
82 2013-05-20 Tobias Burnus <burnus@net-b.de>
83
84 PR fortran/48858
85 * decl.c (add_global_entry): Use nonbinding name
86 only for F2003 or if no binding label exists.
87 (gfc_match_entry): Update calls.
88 * parse.c (gfc_global_used): Improve error message.
89 (add_global_procedure): Use nonbinding name
90 only for F2003 or if no binding label exists.
91 (gfc_parse_file): Update call.
92 * resolve.c (resolve_global_procedure): Use binding
93 name when available.
94 * trans-decl.c (gfc_get_extern_function_decl): Ditto.
95
96 2013-05-20 Tobias Burnus <burnus@net-b.de>
97
98 PR fortran/48858
99 * decl.c (gfc_match_bind_c_stmt): Add gfc_notify_std.
100 * match.c (gfc_match_common): Don't add commons to gsym.
101 * resolve.c (resolve_common_blocks): Add to gsym and
102 add checks.
103 (resolve_bind_c_comms): Remove.
104 (resolve_types): Remove call to the latter.
105 * trans-common.c (gfc_common_ns): Remove static var.
106 (gfc_map_of_all_commons): Add static var.
107 (build_common_decl): Correctly handle binding label.
108
109 2013-05-16 Jason Merrill <jason@redhat.com>
110
111 * Make-lang.in (f951$(exeext)): Use link mutex.
112
113 2013-05-05 Tobias Burnus <burnus@net-b.de>
114
115 * resolve.c (conformable_arrays): Avoid segfault
116 when ar.start[i] == NULL.
117
118 2013-05-05 Tobias Burnus <burnus@net-b.de>
119
120 PR fortran/57141
121 * decl.c (gfc_match_null): Permit use-associated
122 NULL intrinsic.
123
124 2013-05-04 Tobias Burnus <burnus@net-b.de>
125
126 * decl.c (gfc_verify_c_interop_param): Permit allocatable
127 and pointer with -std=f2008ts.
128
129 2013-05-02 Tobias Burnus <burnus@net-b.de>
130
131 PR fortran/57142
132 * simplify.c (gfc_simplify_size): Renamed from
133 simplify_size; fix kind=8 handling.
134 (gfc_simplify_size): New function.
135 (gfc_simplify_shape): Add range check.
136 * resolve.c (resolve_function): Fix handling
137 for ISYM_SIZE.
138
139 2013-05-01 Thomas Koenig <tkoenig@gcc.gnu.org>
140
141 * frontend-passes.c (optimize_power): Fix typo
142 in comment.
143
144 2013-04-30 Thomas Koenig <tkoenig@gcc.gnu.org>
145
146 PR fortran/57071
147 * frontend-passes.c (optimize_power): Simplify
148 1**k to 1.
149
150 2013-04-28 Tobias Burnus <burnus@net-b.de>
151
152 PR fortran/57114
153 * intrinsic.texi (RANK): Correct syntax description and
154 expected result.
155
156 2013-04-28 Tobias Burnus <burnus@net-b.de>
157
158 PR fortran/57093
159 * trans-types.c (gfc_get_element_type): Fix handling
160 of scalar coarrays of type character.
161 * intrinsic.texi (PACK): Add missing ")".
162
163 2013-04-28 Thomas Koenig <tkoenig@gcc.gnu.org>
164
165 PR fortran/57071
166 * frontend-passes (optimize_power): New function.
167 (optimize_op): Use it.
168
169 2013-04-25 Janne Blomqvist <jb@gcc.gnu.org>
170
171 PR bootstrap/57028
172 * Make-lang.in (f951): Link in ZLIB.
173 (CFLAGS-fortran/module.o): Add zlib include directory.
174
175 2013-04-22 Janus Weil <janus@gcc.gnu.org>
176
177 PR fortran/53685
178 PR fortran/57022
179 * check.c (gfc_calculate_transfer_sizes): Fix for array-valued SOURCE
180 expressions.
181 * simplify.c (gfc_simplify_sizeof,gfc_simplify_storage_size): Get rid
182 of special treatment for EXPR_ARRAY.
183 * target-memory.h (gfc_element_size): New prototype.
184 * target-memory.c (size_array): Remove.
185 (gfc_element_size): New function.
186 (gfc_target_expr_size): Modified to always return the full size of the
187 expression.
188
189 2013-04-20 Tobias Burnus <burnus@net-b.de>
190
191 PR fortran/56907
192 * trans-intrinsic.c (conv_isocbinding_function): Don't pack array
193 passed to C_LOC
194
195 2013-04-19 Thomas Koenig <tkoenig@gcc.gnu.org>
196 Mikael Morin <mikael@gcc.gnu.org>
197
198 PR fortran/56872
199 * frontend-passes.c (copy_walk_reduction_arg): Change argument type
200 to gfc_constructor. If it has an iterator, wrap the copy of its
201 expression in an array constructor with that iterator. Don't special
202 case function expressions.
203 (callback_reduction): Update caller. Don't return early if there is
204 an iterator.
205
206 2013-04-18 Tobias Burnus <burnus@net-b.de>
207
208 * expr.c (find_array_element): Don't copy expr.
209 * data.c (create_character_initializer): Free expr.
210 * frontend-passes.c (combine_array_constructor): Ditto.
211 * match.c (match_typebound_call, gfc_match_select_type): Ditto.
212 * resolve.c (resolve_typebound_function): Free gfc_ref.
213
214 2013-04-18 Tobias Burnus <burnus@net-b.de>
215
216 PR fortran/56994
217 * invoke.texi (NEAREST): S argument is not optional.
218
219 2013-04-17 Janus Weil <janus@gcc.gnu.org>
220
221 PR fortran/56814
222 * interface.c (check_result_characteristics): Get result from interface
223 if present.
224
225 2013-04-17 Janne Blomqvist <jb@gcc.gnu.org>
226
227 PR fortran/40958
228 * scanner.h: New file.
229 * Make-lang.in: Dependencies on scanner.h.
230 * scanner.c (gfc_directorylist): Move to scanner.h.
231 * module.c: Don't include md5.h, include scanner.h and zlib.h.
232 (MOD_VERSION): Add comment about backwards compatibility.
233 (module_fp): Change type to gzFile.
234 (ctx): Remove.
235 (gzopen_included_file_1): New function.
236 (gzopen_included_file): New function.
237 (gzopen_intrinsic_module): New function.
238 (write_char): Use gzputc.
239 (read_crc32_from_module_file): New function.
240 (read_md5_from_module_file): Remove.
241 (gfc_dump_module): Use gz* functions instead of stdio, check gzip
242 crc32 instead of md5.
243 (read_module_to_tmpbuf): Use gz* functions instead of stdio.
244 (gfc_use_module): Use gz* functions.
245
246 2013-04-16 Tobias Burnus <burnus@net-b.de>
247
248 PR fortran/39505
249 * decl.c (ext_attr_list): Add EXT_ATTR_NO_ARG_CHECK.
250 * gfortran.h (ext_attr_id_t): Ditto.
251 * gfortran.texi (GNU Fortran Compiler Directives):
252 Document it.
253 * interface.c (compare_type_rank): Ignore rank for NO_ARG_CHECK.
254 (compare_parameter): Ditto - and regard as unlimited polymorphic.
255 * resolve.c (resolve_symbol, resolve_variable): Add same constraint
256 checks as for TYPE(*); turn dummy to TYPE(*),dimension(*).
257 (gfc_explicit_interface_required): Require explicit interface
258 for NO_ARG_CHECK.
259
260 2013-04-16 Janus Weil <janus@gcc.gnu.org>
261
262 PR fortran/56968
263 * expr.c (gfc_check_pointer_assign): Handle generic functions returning
264 procedure pointers.
265
266 2013-04-16 Tobias Burnus <burnus@net-b.de>
267
268 PR fortran/56969
269 * intrinsic.c (gfc_intrinsic_func_interface): Don't set
270 module name to "(intrinsic)" for intrinsics from intrinsic
271 modules.
272
273 2013-04-15 Tobias Burnus <burnus@net-b.de>
274
275 * intrinsic.texi (SYSTEM_CLOCK): Recommend kind=8.
276
277 2013-04-15 Janne Blomqvist <jb@gcc.gnu.org>
278
279 PR fortran/56919
280 * intrinsics.texi (SYSTEM_CLOCK): Update documentation.
281
282 2013-04-15 Tobias Burnus <burnus@net-b.de>
283
284 * class.c (gfc_find_intrinsic_vtab): Removed unused var.
285 * dependency.c (check_data_pointer_types): Fix check.
286 * frontend-passes.c (check_data_pointer_types): Remove
287 superfluous statement.
288 * parse.c (decode_omp_directive): Add missing break.
289 * resolve.c (resolve_typebound_subroutine: Free variable.
290 * trans-decl.c (create_function_arglist): Correct condition.
291
292 2013-04-14 Mikael Morin <mikael@gcc.gnu.org>
293
294 PR fortran/56816
295 * match.c (gfc_match_select_type): Add syntax error. Move namespace
296 allocation and cleanup...
297 * parse.c (decode_statement): ... here.
298
299 2013-04-13 Janus Weil <janus@gcc.gnu.org>
300
301 PR fortran/55959
302 * expr.c (gfc_simplify_expr): Branch is not unreachable.
303
304 2013-04-12 Janus Weil <janus@gcc.gnu.org>
305
306 PR fortran/56266
307 * primary.c (gfc_match_varspec): Turn gcc_assert into MATCH_ERROR.
308
309 2013-04-12 Tobias Burnus <burnus@net-b.de>
310
311 PR fortran/56929
312 * trans-array.c (duplicate_allocatable): Fix handling
313 of scalar coarrays.
314
315 2013-04-12 Janus Weil <janus@gcc.gnu.org>
316
317 PR fortran/56261
318 * gfortran.h (gfc_explicit_interface_required): New prototype.
319 * expr.c (gfc_check_pointer_assign): Check if an explicit interface is
320 required in a proc-ptr assignment.
321 * interface.c (check_result_characteristics): Extra check.
322 * resolve.c (gfc_explicit_interface_required): New function.
323 (resolve_global_procedure): Use new function
324 'gfc_explicit_interface_required'. Do a full interface check.
325
326 2013-04-12 Tobias Burnus <burnus@net-b.de>
327
328 PR fortran/56845
329 * trans-decl.c (gfc_trans_deferred_vars): Restrict
330 static CLASS init to SAVE and -fno-automatic.
331
332 2013-04-12 Tobias Burnus <burnus@net-b.de>
333
334 PR fortran/56845
335 * trans-decl.c (gfc_trans_deferred_vars): Set _vptr for
336 allocatable static BT_CLASS.
337 * trans-expr.c (gfc_class_set_static_fields): New function.
338 * trans.h (gfc_class_set_static_fields): New prototype.
339
340 2013-04-11 Janne Blomqvist <jb@gcc.gnu.org>
341
342 * gfortran.h: Remove enum gfc_try, replace gfc_try with bool type.
343 * arith.c: Replace gfc_try with bool type.
344 * array.c: Likewise.
345 * check.c: Likewise.
346 * class.c: Likewise.
347 * cpp.c: Likewise.
348 * cpp.h: Likewise.
349 * data.c: Likewise.
350 * data.h: Likewise.
351 * decl.c: Likewise.
352 * error.c: Likewise.
353 * expr.c: Likewise.
354 * f95-lang.c: Likewise.
355 * interface.c: Likewise.
356 * intrinsic.c: Likewise.
357 * intrinsic.h: Likewise.
358 * io.c: Likewise.
359 * match.c: Likewise.
360 * match.h: Likewise.
361 * module.c: Likewise.
362 * openmp.c: Likewise.
363 * parse.c: Likewise.
364 * parse.h: Likewise.
365 * primary.c: Likewise.
366 * resolve.c: Likewise.
367 * scanner.c: Likewise.
368 * simplify.c: Likewise.
369 * symbol.c: Likewise.
370 * trans-intrinsic.c: Likewise.
371 * trans-openmp.c: Likewise.
372 * trans-stmt.c: Likewise.
373 * trans-types.c: Likewise.
374
375 2013-04-09 Tobias Burnus <burnus@net-b.de>
376
377 * gfortran.texi (KIND Type Parameters,
378 Internal representation of LOGICAL variables): Add crossrefs.
379 (Intrinsic Types): Mention issues with _Bool interop.
380 (Naming and argument-passing conventions): New section.
381
382 2013-04-08 Thomas Koenig <tkoenig@gcc.gnu.org>
383
384 PR fortran/56782
385 * frontend-passes.c (callback_reduction): Dont't do
386 any simplification if there is only a single element
387 which has an iterator.
388
389 2013-04-07 Tobias Burnus <burnus@net-b.de>
390
391 PR fortran/56849
392 * iresolve.c (gfc_resolve_reshape): Set shape also
393 with order=.
394
395 2013-04-04 Janus Weil <janus@gcc.gnu.org>
396
397 PR fortran/40881
398 * match.c (gfc_match_return): Remove standard notification.
399 * primary.c (gfc_match_actual_arglist): Add standard notification.
400
401 2013-04-04 Tobias Burnus <burnus@net-b.de>
402
403 PR fortran/50269
404 * gcc/fortran/check.c (is_c_interoperable,
405 gfc_check_c_loc): Correct c_loc array checking
406 for Fortran 2003 and Fortran 2008.
407
408 2013-04-03 Janus Weil <janus@gcc.gnu.org>
409
410 PR fortran/56284
411 PR fortran/40881
412 * decl.c (gfc_match_formal_arglist): Warn about alternate-return
413 arguments.
414 * interface.c (check_dummy_characteristics): Return if symbols are NULL.
415
416 2013-04-01 Janus Weil <janus@gcc.gnu.org>
417
418 PR fortran/56500
419 * symbol.c (gfc_set_default_type): Build class container for
420 IMPLICIT CLASS.
421
422 2013-03-31 Tobias Burnus <burnus@net-b.de>
423
424 * class.c (finalization_scalarizer, finalizer_insert_packed_call,
425 generate_finalization_wrapper): Avoid segfault with absent SIZE=
426 argment to TRANSFER and use correct result kind for SIZE.
427 * intrinsic.c (gfc_isym_id_by_intmod): Also handle ids of
428 nonmodules.
429 * trans.c (gfc_build_final_call): Handle coarrays.
430
431 2013-03-30 Thomas Koenig <tkoenig@gcc.gnu.org>
432
433 * trans-expr.c (build_memcmp_call): New function.
434 (gfc_build_compare_string): If the strings
435 compared have constant and equal lengths and
436 the strings are kind=1, or, for kind=4 strings,
437 the test is for (in)equality, use memcmp().
438
439 2013-03-29 Tobias Burnus <burnus@net-b.de>
440
441 PR fortran/35203
442 * trans-decl.c (create_function_arglist): Pass hidden argument
443 for passed-by-value optional+value dummies.
444 * trans-expr.c (gfc_conv_expr_present,
445 gfc_conv_procedure_call): Handle those.
446
447 2013-03-28 Thomas Koenig <tkoenig@gcc.gnu.org>
448
449 PR fortran/45159
450 * gfortran.h (gfc_dep_difference): Add prototype.
451 * dependency.c (discard_nops): New function.
452 (gfc_dep_difference): New function.
453 (check_section_vs_section): Use gfc_dep_difference
454 to calculate the difference of starting indices.
455 * trans-expr.c (gfc_conv_substring): Use
456 gfc_dep_difference to calculate the length of
457 substrings where possible.
458
459 2013-03-28 Thomas Koenig <tkoenig@gcc.gnu.org>
460
461 PR fortran/55806
462 * frontend-passes.c (optimize_code): Keep track of
463 current code to make code insertion possible.
464 (combine_array_constructor): New function.
465 (optimize_op): Call it.
466
467 2013-03-27 Tobias Burnus <burnus@net-b.de>
468
469 PR fortran/56650
470 PR fortran/36437
471 * check.c (gfc_check_sizeof, gfc_check_c_sizeof,
472 gfc_check_storage_size): Update checks.
473 * intrinsic.texi (SIZEOF): Correct class.
474 * intrinsic.h (gfc_simplify_sizeof,
475 gfc_simplify_storage_size): New prototypes.
476 * intrinsic.c (add_functions): Use them.
477 * simplify.c (gfc_simplify_sizeof,
478 gfc_simplify_storage_size): New functions.
479
480 2013-03-27 Janne Blomqvist <jb@gcc.gnu.org>
481
482 PR fortran/25708
483 * module.c (module_locus): Use long for position.
484 (module_content): New variable.
485 (module_pos): Likewise.
486 (prev_character): Remove.
487 (bad_module): Free data instead of closing mod file.
488 (set_module_locus): Use module_pos.
489 (get_module_locus): Likewise.
490 (module_char): use buffer rather than stdio file.
491 (module_unget_char): Likewise.
492 (read_module_to_tmpbuf): New function.
493 (gfc_use_module): Call read_module_to_tmpbuf.
494
495 2013-03-26 Tobias Burnus <burnus@net-b.de>
496
497 PR fortran/56649
498 * simplify.c (gfc_simplify_merge): Simplify more.
499
500 2013-03-25 Tobias Burnus <burnus@net-b.de>
501
502 PR fortran/38536
503 PR fortran/38813
504 PR fortran/38894
505 PR fortran/39288
506 PR fortran/40963
507 PR fortran/45824
508 PR fortran/47023
509 PR fortran/47034
510 PR fortran/49023
511 PR fortran/50269
512 PR fortran/50612
513 PR fortran/52426
514 PR fortran/54263
515 PR fortran/55343
516 PR fortran/55444
517 PR fortran/55574
518 PR fortran/56079
519 PR fortran/56378
520 * check.c (gfc_var_strlen): Properly handle 0-sized string.
521 (gfc_check_c_sizeof): Use is_c_interoperable, add checks.
522 (is_c_interoperable, gfc_check_c_associated, gfc_check_c_f_pointer,
523 gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc): New
524 functions.
525 * expr.c (check_inquiry): Add c_sizeof, compiler_version and
526 compiler_options.
527 (gfc_check_pointer_assign): Refine function result check.
528 gfortran.h (gfc_isym_id): Add GFC_ISYM_C_ASSOCIATED,
529 GFC_ISYM_C_F_POINTER, GFC_ISYM_C_F_PROCPOINTER, GFC_ISYM_C_FUNLOC,
530 GFC_ISYM_C_LOC.
531 (iso_fortran_env_symbol, iso_c_binding_symbol): Handle
532 NAMED_SUBROUTINE.
533 (generate_isocbinding_symbol): Update prototype.
534 (get_iso_c_sym): Remove.
535 (gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New prototypes.
536 * intrinsic.c (gfc_intrinsic_subroutine_by_id): New function.
537 (gfc_intrinsic_sub_interface): Use it.
538 (add_functions, add_subroutines): Add missing C-binding intrinsics.
539 (gfc_intrinsic_func_interface): Add special case for c_loc.
540 gfc_isym_id_by_intmod, gfc_isym_id_by_intmod_sym): New functions.
541 (gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Use them.
542 * intrinsic.h (gfc_check_c_associated, gfc_check_c_f_pointer,
543 gfc_check_c_f_procpointer, gfc_check_c_funloc, gfc_check_c_loc,
544 gfc_resolve_c_loc, gfc_resolve_c_funloc): New prototypes.
545 * iresolve.c (gfc_resolve_c_loc, gfc_resolve_c_funloc): New
546 functions.
547 * iso-c-binding.def: Split PROCEDURE into NAMED_SUBROUTINE and
548 NAMED_FUNCTION.
549 * iso-fortran-env.def: Add NAMED_SUBROUTINE for completeness.
550 * module.c (create_intrinsic_function): Support subroutines and
551 derived-type results.
552 (use_iso_fortran_env_module): Update calls.
553 (import_iso_c_binding_module): Ditto; update calls to
554 generate_isocbinding_symbol.
555 * resolve.c (find_arglists): Skip for intrinsic symbols.
556 (gfc_resolve_intrinsic): Find intrinsic subs via id.
557 (is_scalar_expr_ptr, gfc_iso_c_func_interface,
558 set_name_and_label, gfc_iso_c_sub_interface): Remove.
559 (resolve_function, resolve_specific_s0): Remove calls to those.
560 (resolve_structure_cons): Fix handling.
561 * symbol.c (gen_special_c_interop_ptr): Update c_ptr/c_funptr
562 generation.
563 (gen_cptr_param, gen_fptr_param, gen_shape_param,
564 build_formal_args, get_iso_c_sym): Remove.
565 (std_for_isocbinding_symbol): Handle NAMED_SUBROUTINE.
566 (generate_isocbinding_symbol): Support hidden symbols and
567 using c_ptr/c_funptr symtrees for nullptr defs.
568 * target-memory.c (gfc_target_encode_expr): Fix handling
569 of c_ptr/c_funptr.
570 * trans-expr.c (conv_isocbinding_procedure): Remove.
571 (gfc_conv_procedure_call): Remove call to it.
572 (gfc_trans_subcomponent_assign, gfc_conv_expr): Update handling
573 of c_ptr/c_funptr.
574 * trans-intrinsic.c (conv_isocbinding_function,
575 conv_isocbinding_subroutine): New.
576 (gfc_conv_intrinsic_function, gfc_conv_intrinsic_subroutine):
577 Call them.
578 * trans-io.c (transfer_expr): Fix handling of c_ptr/c_funptr.
579 * trans-types.c (gfc_typenode_for_spec,
580 gfc_get_derived_type): Ditto.
581 (gfc_init_c_interop_kinds): Handle NAMED_SUBROUTINE.
582
583 2013-03-18 Tobias Burnus <burnus@net-b.de>
584
585 * gfortran.h (gfc_option_t): Remove flag_whole_file.
586 * invoke.texi (-fno-whole-file): Remove.
587 * lang.opt (fwhole-file): Change to Ignore.
588 * options.c (gfc_init_options, gfc_post_options,
589 gfc_handle_option): Remove !flag_whole_file handling
590 * parse.c (resolve_all_program_units, translate_all_program_units,
591 gfc_parse_file): Ditto.
592 * resolve.c (resolve_global_procedure): Ditto.
593 * trans-decl.c (gfc_get_symbol_decl, gfc_get_extern_function_decl,
594 gfc_create_module_variable): Ditto.
595 * trans-types.c (gfc_get_derived_type): Ditto.
596
597 2013-03-15 Tobias Burnus <burnus@net-b.de>
598
599 PR fortran/56615
600 * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Pack arrays
601 if they are not simply contiguous.
602
603 2013-03-11 Tobias Burnus <burnus@net-b.de>
604
605 * gfortran.texi (STRUCTURE and RECORD): State more clearly how
606 to convert them into derived types.
607
608 2013-03-10 Paul Thomas <pault@gcc.gnu.org>
609
610 PR fortran/56575
611 * expr.c (gfc_default_initializer): Check that a class declared
612 type has any components.
613 * resolve.c (resolve_fl_derived0): On failing the test for C437
614 set the type to BT_UNKNOWN to prevent repeat error messages.
615
616 2013-03-03 Mikael Morin <mikael@gcc.gnu.org>
617
618 PR fortran/56477
619 * expr.c (gfc_check_pointer_assign): Avoid NULL pointer dereference.
620
621 2013-03-03 Mikael Morin <mikael@gcc.gnu.org>
622
623 PR fortran/54730
624 * array.c (gfc_match_array_constructor): Set a checkpoint before
625 matching a typespec. Drop it on success, restore it otherwise.
626
627 2013-03-03 Mikael Morin <mikael@gcc.gnu.org>
628
629 PR fortran/54730
630 * gfortran.h (struct gfc_undo_change_set): New field 'previous'.
631 (gfc_new_undo_checkpoint, gfc_drop_last_undo_checkpoint,
632 gfc_restore_last_undo_checkpoint): New prototypes.
633 * symbol.c (default_undo_chgset_var): Update initialization.
634 (single_undo_checkpoint_p, gfc_new_undo_checkpoint,
635 free_undo_change_set_data, pop_undo_change_set,
636 gfc_drop_last_undo_checkpoint, enforce_single_undo_checkpoint):
637 New functions.
638 (save_symbol_data): Handle multiple change sets. Make sure old_symbol
639 field's previous value is not overwritten. Clear gfc_new field.
640 (restore_old_symbol): Restore previous old_symbol field.
641 (gfc_restore_last_undo_checkpoint): New function, using body renamed
642 from gfc_undo_symbols. Restore the previous change set as current one.
643 (gfc_undo_symbols): New body.
644 (gfc_commit_symbols, gfc_commit_symbol, gfc_enforce_clean_symbol_state):
645 Call enforce_single_undo_checkpoint.
646 (gfc_symbol_done_2): Ditto. Free change set data.
647
648 2013-03-03 Mikael Morin <mikael@gcc.gnu.org>
649
650 * symbol.c (restore_old_symbol): Fix thinko.
651
652 2013-03-03 Mikael Morin <mikael@gcc.gnu.org>
653
654 * symbol.c (gfc_undo_symbols): Move code...
655 (restore_old_symbol): ... here as a new function.
656
657 2013-03-03 Mikael Morin <mikael@gcc.gnu.org>
658
659 * Make-lang.in (F95_PARSER_OBJS): Add dependency to vec.h.
660 * gfortran.h: Include vec.h.
661 (gfc_undo_change_set): New struct.
662 * symbol.c (tentative_tbp): Remove struct.
663 (changed_syms, tentative_tbp_list): Remove variables.
664 (default_undo_chgset_var, latest_undo_chgset): New variables.
665 (save_symbol_data, gfc_get_sym_tree, gfc_undo_symbols,
666 gfc_commit_symbols, gfc_commit_symbol,
667 gfc_enforce_clean_symbol_state, gfc_get_typebound_proc):
668 Use latest_undo_chgset instead of changed_syms and tentative_tbp_list.
669
670 2013-03-01 Tobias Burnus <burnus@net-b.de>
671
672 PR fortran/56491
673 * iresolve.c (resolve_bound): Use gfc_get_string instead of xstrdup.
674 * symbol.c (free_components): Free proc-pointer components.
675
676 2013-03-01 Tobias Burnus <burnus@net-b.de>
677
678 * trans-decl.c (gfc_trans_deferred_vars): Free expr after use.
679 * trans-io.c (build_dt): Ditto.
680
681 2013-02-24 Joseph Myers <joseph@codesourcery.com>
682
683 * resolve.c (generate_component_assignments): Don't use UTF-8
684 ligature in diagnostic.
685
686 2013-02-21 Janus Weil <janus@gcc.gnu.org>
687
688 PR fortran/56385
689 * trans-array.c (structure_alloc_comps): Handle procedure-pointer
690 components with allocatable result.
691
692 2013-02-21 Tobias Burnus <burnus@net-b.de>
693
694 PR fortran/56416
695 * gfortran.texi (Part II: Language Reference, Extensions,
696 Non-Fortran Main Program): Sort @menu to match actual section order.
697 * intrinsic.texi (Intrinsic Procedures): Ditto.
698 (C_F_POINTER, PRECISION): Move to the alphabetically correct place.
699
700 2013-02-15 Tobias Burnus <burnus@net-b.de>
701 Mikael Morin <mikael@gcc.gnu.org>
702
703 PR fortran/56318
704 * simplify.c (gfc_simplify_matmul): Fix result shape
705 and matmul result.
706
707 2013-02-15 Tobias Burnus <burnus@net-b.de>
708
709 PR fortran/53818
710 * resolve.c (apply_default_init_local): Don't create an
711 initializer for a result variable.
712
713 2013-02-14 Thomas Koenig <tkoenig@gcc.gnu.org>
714
715 PR fortran/56224
716 * gfortran.h (gfc_add_include_path): Add boolean argument
717 for warn.
718 * scanner.c (gfc_add_include_path): Pass along warn argument
719 to add_path_to_list.
720 * options.c (gfc_post_options): Add true warn argument to
721 gfc_add_include_path.
722 (gfc_handle_module_path_options): Likewise.
723 (gfc_handle_option): Also gfc_add_include_path for intrinsic
724 modules, without warning.
725
726 2013-02-14 Paul Thomas <pault@gcc.gnu.org>
727 Tobias Burnus <burnus@net-b.de>
728
729 PR testsuite/56138
730 * trans-decl.c (gfc_get_symbol_decl): Fix deferred-length
731 results for functions without extra result variable.
732
733 Revert:
734 2013-01-30 Tobias Burnus <burnus@net-b.de>
735
736 PR fortran/56138
737 * trans-decl.c (gfc_trans_deferred_vars): Fix deferred-length
738 results for functions without extra result variable.
739
740 2013-02-12 Janus Weil <janus@gcc.gnu.org>
741
742 PR fortran/46952
743 * resolve.c (resolve_call): Do not check deferred procedures for
744 recursiveness.
745
746 2013-02-09 Paul Thomas <pault@gcc.gnu.org>
747
748 PR fortran/55362
749 * check.c (array_check): It is an error if a procedure is
750 passed.
751
752 2013-02-08 Mikael Morin <mikael@gcc.gnu.org>
753
754 PR fortran/54107
755 * trans-types.c (gfc_get_function_type): Change a NULL backend_decl
756 to error_mark_node on entry. Detect recursive types. Build a variadic
757 procedure type if the type is recursive. Restore the initial
758 backend_decl.
759
760 2013-02-07 Tobias Burnus <burnus@net-b.de>
761
762 PR fortran/54339
763 * gfortran.texi (Standards): Mention TS29113.
764 (Varying Length Character): Mention deferred-length
765 strings.
766 (Fortran 2003 Status): Add unlimited polymorphic.
767 (TS 29113 Status): Add TYPE(*) and DIMENSION(..).
768 (C Interop): Update the section about TS29113.
769
770 2013-02-06 Paul Thomas <pault@gcc.gnu.org>
771
772 PR fortran/55789
773 * trans-array.c (trans_array_constructor): Remove condition
774 'dynamic' = true if the loop ubound is a VAR_DECL.
775
776 2013-02-04 Paul Thomas <pault@gcc.gnu.org>
777
778 PR fortran/56008
779 PR fortran/47517
780 * trans-array.c (gfc_alloc_allocatable_for_assignment): Save
781 the lhs descriptor before it is modified for reallocation. Use
782 it to deallocate allocatable components in the reallocation
783 block. Nullify allocatable components for newly (re)allocated
784 arrays.
785
786 2013-02-04 Mikael Morin <mikael@gcc.gnu.org>
787
788 PR fortran/54195
789 * resolve.c (resolve_typebound_procedures): Recurse through
790 resolve_symbol.
791
792 2013-02-04 Mikael Morin <mikael@gcc.gnu.org>
793
794 PR fortran/54107
795 PR fortran/54195
796 * gfortran.h (struct gfc_symbol): New field 'resolved'.
797 * resolve.c (resolve_fl_var_and_proc): Don't skip result symbols.
798 (resolve_symbol): Skip duplicate calls. Don't check the current
799 namespace.
800
801 2013-02-02 Thomas Koenig <tkoenig@gcc.gnu.org>
802
803 PR fortran/50627
804 PR fortran/56054
805 * decl.c (gfc_match_end): Remove half-ready namespace
806 from parent if the end of a block is missing.
807 * parse.c (parse_module): Do not put namespace into
808 gsymbol on error.
809
810 2013-01-30 Tobias Burnus <burnus@net-b.de>
811
812 PR fortran/56138
813 * trans-decl.c (gfc_trans_deferred_vars): Fix deferred-length
814 results for functions without extra result variable.
815
816 2013-01-29 Janus Weil <janus@gcc.gnu.org>
817 Mikael Morin <mikael@gcc.gnu.org>
818
819 PR fortran/54107
820 * gfortran.h (gfc_component): Delete members 'formal' and 'formal_ns'.
821 (gfc_copy_formal_args,gfc_copy_formal_args_ppc,gfc_expr_replace_symbols,
822 gfc_expr_replace_comp): Delete.
823 (gfc_sym_get_dummy_args): New prototype.
824 * dependency.c (gfc_check_fncall_dependency): Use
825 'gfc_sym_get_dummy_args'.
826 * expr.c (gfc_is_constant_expr): Ditto.
827 (replace_symbol,gfc_expr_replace_symbols,replace_comp,
828 gfc_expr_replace_comp): Deleted.
829 * frontend-passes.c (doloop_code,do_function): Use
830 'gfc_sym_get_dummy_args'.
831 * interface.c (gfc_check_operator_interface,gfc_compare_interfaces,
832 gfc_procedure_use,gfc_ppc_use,gfc_arglist_matches_symbol,
833 gfc_check_typebound_override): Ditto.
834 * module.c (MOD_VERSION): Bump module version.
835 (mio_component): Do not read/write 'formal' and 'formal_ns'.
836 * resolve.c (resolve_procedure_interface,resolve_fl_derived0): Do not
837 copy formal args, but just keep a pointer to the interface.
838 (resolve_function,resolve_call,resolve_typebound_generic_call,
839 resolve_ppc_call,resolve_expr_ppc,generate_component_assignments,
840 resolve_fl_procedure,gfc_resolve_finalizers,check_generic_tbp_ambiguity,
841 resolve_typebound_procedure,check_uop_procedure): Use
842 'gfc_sym_get_dummy_args'.
843 * symbol.c (free_components): Do not free 'formal' and 'formal_ns'.
844 (gfc_copy_formal_args,gfc_copy_formal_args_ppc): Deleted.
845 (gfc_sym_get_dummy_args): New function.
846 * trans-array.c (get_array_charlen,gfc_walk_elemental_function_args):
847 Use 'gfc_sym_get_dummy_args'.
848 * trans-decl.c (build_function_decl,create_function_arglist,
849 build_entry_thunks,init_intent_out_dt,gfc_trans_deferred_vars,
850 add_argument_checking): Ditto.
851 * trans-expr.c (gfc_map_fcn_formal_to_actual,gfc_conv_procedure_call,
852 gfc_conv_statement_function): Ditto.
853 * trans-stmt.c (gfc_conv_elemental_dependencies): Ditto.
854 * trans-types.c (create_fn_spec,gfc_get_function_type): Ditto.
855
856 2013-01-28 Tobias Burnus <burnus@net-b.de>
857 Mikael Morin <mikael@gcc.gnu.org>
858
859 PR fortran/53537
860 * symbol.c (gfc_find_sym_tree): Don't look for the symbol outside an
861 interface block.
862 (gfc_get_ha_symtree): Let gfc_find_sym_tree lookup the parent namespace.
863 * decl.c (gfc_match_data_decl): Ditto.
864 (variable_decl): Remove undeclared type error.
865 (gfc_match_import): Use renamed instead of original name.
866
867 2013-01-27 Paul Thomas <pault@gcc.gnu.org>
868
869 PR fortran/55984
870 PR fortran/56047
871 * gfortran.h : Add associate_var to symbol_attr.
872 * resolve.c (resolve_assoc_var): Set associate_var attribute.
873 If the target class_ok is set, set it for the associate
874 variable.
875 * check.c (allocatable_check): Associate variables should not
876 have the allocatable attribute even if their symbols do.
877 * class.c (gfc_build_class_symbol): Symbols with associate_var
878 set will always have a good class container.
879
880 2013-01-23 Janus Weil <janus@gcc.gnu.org>
881
882 PR fortran/56081
883 * resolve.c (resolve_select): Add argument 'select_type', reject
884 non-scalar expressions.
885 (resolve_select_type,resolve_code): Pass new argument to
886 'resolve_select'.
887
888 2013-01-23 Jakub Jelinek <jakub@redhat.com>
889
890 PR fortran/56052
891 * trans-decl.c (gfc_get_symbol_decl): Set DECL_ARTIFICIAL
892 and DECL_IGNORED_P on select_type_temporary and don't set
893 DECL_BY_REFERENCE.
894
895 2013-01-21 Thomas Koenig <tkoenig@gcc.gnu.org>
896
897 PR fortran/55919
898 * scanner.c (add_path_to_list): Copy path to temporary and strip
899 trailing directory separators before calling stat().
900
901 2013-01-17 Richard Biener <rguenther@suse.de>
902
903 * trans-stmt.c (gfc_trans_do): Conditionally compute countm1
904 dependent on sign of step, avoids repeated evaluation of
905 step sign test. Avoid undefined overflow issues by using unsigned
906 arithmetic.
907
908 2013-01-16 Janus Weil <janus@gcc.gnu.org>
909
910 PR fortran/55983
911 * class.c (find_typebound_proc_uop): Check for f2k_derived instead of
912 asserting it.
913
914 2013-01-16 Jakub Jelinek <jakub@redhat.com>
915 Tobias Burnus <burnus@net-b.de>
916
917 PR driver/55884
918 * lang.opt (fintrinsic-modules-path): Don't accept Joined.
919 (fintrinsic-modules-path=): New.
920 * options.c (gfc_handle_option, gfc_get_option_string,
921 gfc_get_option_string): Handle the latter.
922
923 2013-01-16 Jakub Jelinek <jakub@redhat.com>
924
925 PR fortran/52865
926 * trans-stmt.c (gfc_trans_do): Put countm1-- before conditional
927 and use value of countm1 before the decrement in the condition.
928
929 2013-01-15 Paul Thomas <pault@gcc.gnu.org>
930
931 PR fortran/54286
932 * expr.c (gfc_check_pointer_assign): Check for presence of
933 's2' before using it.
934
935 2013-01-14 Thomas Koenig <tkoenig@gcc.gnu.org>
936
937 PR fortran/55806
938 * frontend-passes.c (optimize_reduction): New function,
939 including prototype.
940 (callback_reduction): Likewise.
941 (gfc_run_passes): Also run optimize_reduction.
942 (copy_walk_reduction_arg): New function.
943 (dummy_code_callback): New function.
944
945 2013-01-13 Jakub Jelinek <jakub@redhat.com>
946
947 PR fortran/55935
948 * trans-expr.c (gfc_conv_structure): Call
949 unshare_expr_without_location on the ctor elements.
950
951 2013-01-13 Paul Thomas <pault@gcc.gnu.org>
952
953 PR fortran/54286
954 * expr.c (gfc_check_pointer_assign): Ensure that both lvalue
955 and rvalue interfaces are presented to gfc_compare_interfaces.
956 Simplify references to interface names by using the symbols
957 themselves. Call gfc_compare_interfaces with s1 and s2 inter-
958 changed to overcome the asymmetry of this function. Do not
959 repeat the check for the presence of s1 and s2.
960
961 2013-01-12 Janus Weil <janus@gcc.gnu.org>
962
963 PR fortran/55072
964 * trans-array.c (gfc_conv_array_parameter): No packing was done for
965 full arrays of derived type.
966
967 2013-01-08 Paul Thomas <pault@gcc.gnu.org>
968
969 PR fortran/55868
970 * class.c (get_unique_type_string): Change $tar to STAR and
971 replace sprintf by strcpy where there is no formatting.
972 * decl.c (gfc_match_decl_type_spec): Change $tar to STAR.
973
974 2013-01-09 Mikael Morin <mikael@gcc.gnu.org>
975
976 PR fortran/47203
977 * module.c (check_for_ambiguous): Get the current program unit using
978 gfc_current_ns.
979
980 2013-01-09 Tobias Burnus <burnus@net-b.de>
981
982 PR fortran/55758
983 * resolve.c (resolve_symbol): Reject non-C_Bool logicals
984 in BIND(C) procedures with -std=f*.
985
986 2013-01-08 Paul Thomas <pault@gcc.gnu.org>
987
988 PR fortran/55618
989 * trans-expr.c (gfc_conv_procedure_call): Dereference scalar
990 character function arguments to elemental procedures in
991 scalarization loops.
992
993 2013-01-07 Tobias Burnus <burnus@net-b.de>
994
995 PR fortran/55763
996 * gfortran.h (gfc_check_assign_symbol): Update prototype.
997 * decl.c (add_init_expr_to_sym, do_parm): Update call.
998 * expr.c (gfc_check_assign_symbol): Handle BT_CLASS and
999 improve error location; support components.
1000 (gfc_check_pointer_assign): Handle component assignments.
1001 * resolve.c (resolve_fl_derived0): Call gfc_check_assign_symbol.
1002 (resolve_values): Update call.
1003 (resolve_structure_cons): Avoid double diagnostic.
1004
1005 2013-01-07 Tobias Burnus <burnus@net-b.de>
1006 Thomas Koenig <tkoenig@gcc.gnu.org>
1007
1008 PR fortran/55852
1009 * expr.c (gfc_build_intrinsic_call): Avoid clashes
1010 with user's procedures.
1011 * gfortran.h (gfc_build_intrinsic_call): Update prototype.
1012 * simplify.c (gfc_simplify_size): Update call.
1013 * class.c (finalization_scalarizer, finalization_get_offset,
1014 finalizer_insert_packed_call, generate_finalization_wrapper):
1015 Clean up by using gfc_build_intrinsic_call.
1016
1017 2013-01-07 Tobias Burnus <burnus@net-b.de>
1018
1019 PR fortran/55763
1020 * resolve.c (resolve_select_type): Reject intrinsic types for
1021 a non-unlimited-polymorphic selector.
1022
1023 2013-01-06 Paul Thomas <pault@gcc.gnu.org>
1024
1025 PR fortran/53876
1026 PR fortran/54990
1027 PR fortran/54992
1028 * trans-array.c (build_array_ref): Check the TYPE_CANONICAL
1029 to see if it is GFC_CLASS_TYPE_P.
1030 * trans-expr.c (gfc_get_vptr_from_expr): The same.
1031 (gfc_conv_class_to_class): If the types are not the same,
1032 cast parmese->expr to the type of ctree.
1033 * trans-types.c (gfc_get_derived_type): GFC_CLASS_TYPE_P of
1034 CLASS components must be set.
1035
1036 2013-01-06 Mikael Morin <mikael@gcc.gnu.org>
1037
1038 PR fortran/42769
1039 PR fortran/45836
1040 PR fortran/45900
1041 * module.c (read_module): Don't reuse local symtree if the associated
1042 symbol isn't exactly the one wanted. Don't reuse local symtree if it is
1043 ambiguous.
1044 * resolve.c (resolve_call): Use symtree's name instead of symbol's to
1045 lookup the symtree.
1046
1047 2013-01-05 Steven G. Kargl <kargl@gcc.gnu.org>
1048 Mikael Morin <mikael@gcc.gnu.org>
1049
1050 PR fortran/55827
1051 * class.c (gfc_fix_class_refs): Adapt ts initialization for the case
1052 e->symtree == NULL.
1053 * trans-expr.c (gfc_conv_function_expr): Init sym earlier. Use it.
1054
1055 2013-01-05 Tobias Burnus <burnus@net-b.de>
1056
1057 * class.c (finalize_component): Used passed offset expr.
1058 (finalization_get_offset): New static function.
1059 (finalizer_insert_packed_call, generate_finalization_wrapper): Use it
1060 to handle noncontiguous arrays.
1061
1062 2013-01-04 Tobias Burnus <burnus@net-b.de>
1063
1064 * trans.c (gfc_build_final_call): New function.
1065 * trans.h (gfc_build_final_call, gfc_conv_scalar_to_descriptor):
1066 New function prototypes.
1067 * trans-expr.c (gfc_conv_scalar_to_descriptor): Renamed from
1068 conv_scalar_to_descriptor, removed static attribute.
1069 (gfc_conv_procedure_call): Honor renaming.
1070
1071 2013-01-04 Tobias Burnus <burnus@net-b.de>
1072
1073 * intrinsic.c (add_functions): New internal intrinsic
1074 function GFC_PREFIX ("stride").
1075 * gfortran.h (gfc_isym_id): Add GFC_ISYM_STRIDE.
1076 * intrinsic.h (gfc_resolve_stride): New prototypes.
1077 * iresolve.c (gfc_resolve_stride): New function.
1078 * trans-intrinsic.c (conv_intrinsic_stride): New static
1079 function.
1080 (gfc_conv_intrinsic_function): Use it.
1081
1082 2013-01-04 Tobias Burnus <burnus@net-b.de>
1083
1084 * class.c (gfc_find_intrinsic_vtab): Add _final
1085 component.
1086 * decl.c (gfc_match_null): Remove superfluous
1087 variadic argument to gfc_match.
1088
1089 2013-01-04 Paul Thomas <pault@gcc.gnu.org>
1090
1091 PR fortran/55172
1092 * match.c (copy_ts_from_selector_to_associate): Remove call to
1093 gfc_resolve_expr and replace it with explicit setting of the
1094 array reference type.
1095 * resolve.c (resolve_select_type): It is an error if the
1096 selector is coindexed.
1097
1098 2013-01-04 Tobias Burnus <burnus@net-b.de>
1099
1100 PR fortran/55763
1101 * decl.c (gfc_match_null): Parse and reject MOLD.
1102
1103 2013-01-04 Tobias Burnus <burnus@net-b.de>
1104
1105 PR fortran/55854
1106 PR fortran/55763
1107 * class.c (gfc_class_null_initializer): Fix finding the vtab.
1108 (gfc_find_intrinsic_vtab): Use BT_VOID for some components.
1109
1110 2013-01-03 Janus Weil <janus@gcc.gnu.org>
1111
1112 PR fortran/55855
1113 * expr.c (gfc_check_assign): Use 'gfc_expr_attr' to evaluate attributes
1114 of rvalue. Correct hyphenation in error message.
1115
1116 2013-01-03 Jakub Jelinek <jakub@redhat.com>
1117
1118 * gfortranspec.c (lang_specific_driver): Update copyright notice
1119 dates.
1120 \f
1121 Copyright (C) 2013 Free Software Foundation, Inc.
1122
1123 Copying and distribution of this file, with or without modification,
1124 are permitted in any medium without royalty provided the copyright
1125 notice and this notice are preserved.