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