re PR fortran/78798 ([cleanup] some int-valued functions should be bool)
[gcc.git] / gcc / fortran / ChangeLog
1 2016-12-15 Janus Weil <janus@gcc.gnu.org>
2
3 PR fortran/78798
4 * gfortran.h (gfc_compare_derived_types,gfc_compare_types,
5 gfc_compare_interfaces,gfc_has_vector_subscript): Return bool instead
6 of int.
7 * interface.c (compare_components): Ditto.
8 (gfc_compare_union_types): Rename to compare_union_types, declare as
9 static, return bool.
10 (gfc_compare_derived_types): Return bool instead of int.
11 (gfc_compare_types): Ditto.
12 (compare_type): Ditto.
13 (compare_rank): Ditto.
14 (compare_type_rank): Ditto.
15 (compare_type_rank_if): Ditto.
16 (count_types_test): Ditto.
17 (generic_correspondence): Ditto.
18 (gfc_compare_interfaces): Ditto.
19 (check_interface0): Ditto.
20 (check_interface1): Ditto.
21 (compare_allocatable): Ditto.
22 (compare_parameter): Ditto.
23 (gfc_has_vector_subscript): Ditto.
24 (compare_actual_formal): Ditto.
25
26 2016-12-15 Janus Weil <janus@gcc.gnu.org>
27
28 PR fortran/78800
29 * interface.c (compare_allocatable): Avoid additional errors on bad
30 class declarations.
31 (compare_parameter): Put the result of gfc_expr_attr into a variable,
32 in order to avoid calling it multiple times. Exit early on bad class
33 declarations to avoid ICE.
34
35 2016-12-14 Martin Jambor <mjambor@suse.cz>
36
37 * trans-openmp.c: Include omp-general.h.
38
39 2016-12-14 Andre Vehreschild <vehre@gcc.gnu.org>
40
41 PR fortran/78780
42 * trans-expr.c (gfc_trans_assignment_1): Improve check whether detour
43 caf-runtime routines is needed.
44
45 2016-12-14 Andre Vehreschild <vehre@gcc.gnu.org>
46
47 PR fortran/78672
48 * array.c (gfc_find_array_ref): Add flag to return NULL when no ref is
49 found instead of erroring out.
50 * data.c (gfc_assign_data_value): Only constant expressions are valid
51 for initializers.
52 * gfortran.h: Reflect change of gfc_find_array_ref's signature.
53 * interface.c (compare_actual_formal): Access the non-elemental
54 array-ref. Prevent taking a REF_COMPONENT for a REF_ARRAY. Correct
55 indentation.
56 * module.c (load_omp_udrs): Clear typespec before reading into it.
57 * trans-decl.c (gfc_build_qualified_array): Prevent accessing the array
58 when it is a coarray.
59 * trans-expr.c (gfc_conv_cst_int_power): Use wi::abs()-function instead
60 of crutch preventing sanitizer's bickering here.
61 * trans-stmt.c (gfc_trans_deallocate): Only get data-component when it
62 is a descriptor-array here.
63
64 2016-12-13 Janus Weil <janus@gcc.gnu.org>
65
66 PR fortran/78798
67 * gfortran.h (gfc_is_constant_expr, gfc_is_formal_arg,
68 gfc_is_compile_time_shape): Return bool instead of int.
69 * array.c (gfc_is_compile_time_shape): Ditto.
70 * expr.c (gfc_is_constant_expr): Ditto.
71 * resolve.c (gfc_is_formal_arg): Ditto. Make formal_arg_flag bool.
72
73 2016-12-13 Andre Vehreschild <vehre@gcc.gnu.org>
74
75 PR fortran/77785
76 * resolve.c (resolve_symbol): Correct attr lookup to the _data
77 component.
78 * trans-array.c (gfc_alloc_allocatable_for_assignment): Indirect ref
79 pointers and references before retrieving the caf-token.
80
81 2016-12-13 Janus Weil <janus@gcc.gnu.org>
82 Paul Thomas <pault@gcc.gnu.org>
83
84 PR fortran/78737
85 * gfortran.h (gfc_find_typebound_dtio_proc): New prototype.
86 * interface.c (gfc_compare_interfaces): Whitespace fix.
87 (gfc_find_typebound_dtio_proc): New function.
88 (gfc_find_specific_dtio_proc): Use it. Improve error recovery.
89 * trans-io.c (get_dtio_proc): Implement polymorphic calls to DTIO
90 procedures.
91
92 2016-12-12 Janus Weil <janus@gcc.gnu.org>
93
94 PR fortran/78392
95 * expr.c (gfc_is_constant_expr): Specification functions are not
96 compile-time constants. Update documentation (add reference to F08
97 standard), add a FIXME.
98 (external_spec_function): Add reference to F08 standard.
99 * resolve.c (resolve_fl_variable): Ditto.
100
101 2016-12-10 Thomas Koenig <tkoenig@gcc.gnu.org>
102
103 PR fortran/78226
104 * error.c (gfc_warning_internal): New function.
105 * frontend-passes.c (gfc_run_passes): Call check_locus if
106 CHECKING_P is defined.
107 (check_locus_code): New function.
108 (check_locus_expr): New function.
109 (check_locus): New function.
110 * gfortran.h: Add prototype for gfc_warning_internal.
111
112 2016-12-10 Paul Thomas <pault@gcc.gnu.org>
113
114 PR fortran/78350
115 * resolve.c (resolve_structure_cons): Remove the block that
116 tried to remove a charlen and rely on namespace cleanup.
117
118 2016-12-09 Paul Thomas <pault@gcc.gnu.org>
119
120 PR fortran/77903
121 * decl.c (get_proc_name): Use the symbol tlink field instead of
122 the typespec interface field.
123 (gfc_match_function_decl, gfc_match_submod_proc): Ditto.
124 * gfortran.h : Since the symbol tlink field is no longer used
125 by the frontend for change management, change the comment to
126 reflect its current uses.
127 * parse.c (get_modproc_result): Same as decl.c changes.
128 * resolve.c (resolve_fl_procedure): Ditto.
129
130 2016-12-09 Janus Weil <janus@gcc.gnu.org>
131
132 PR fortran/61767
133 * class.c (has_finalizer_component): Fix this function to detect only
134 non-pointer non-allocatable components which have a finalizer.
135
136 2016-12-09 Andre Vehreschild <vehre@gcc.gnu.org>
137
138 PR fortran/78505
139 * trans-stmt.c (gfc_trans_allocate): Add sync all after the execution
140 of the whole allocate-statement to adhere to the standard.
141
142 2016-12-09 Andre Vehreschild <vehre@gcc.gnu.org>
143
144 * trans-array.c (gfc_array_deallocate): Remove wrapper.
145 (gfc_trans_dealloc_allocated): Same.
146 (structure_alloc_comps): Restructure deallocation of (nested)
147 allocatable components. Insert dealloc of sub-component into the block
148 guarded by the if != NULL for the component.
149 (gfc_trans_deferred_array): Use the almightly deallocate_with_status.
150 * trans-array.h: Remove prototypes.
151 * trans-expr.c (gfc_conv_procedure_call): Use the almighty deallocate_
152 with_status.
153 * trans-openmp.c (gfc_walk_alloc_comps): Likewise.
154 (gfc_omp_clause_assign_op): Likewise.
155 (gfc_omp_clause_dtor): Likewise.
156 * trans-stmt.c (gfc_trans_deallocate): Likewise.
157 * trans.c (gfc_deallocate_with_status): Allow deallocation of scalar
158 and arrays as well as coarrays.
159 (gfc_deallocate_scalar_with_status): Get the data member for coarrays
160 only when freeing an array with descriptor. And set correct caf_mode
161 when freeing components of coarrays.
162 * trans.h: Change prototype of gfc_deallocate_with_status to allow
163 adding statements into the block guarded by the if (pointer != 0) and
164 supply a coarray handle.
165
166 2016-12-09 Paul Thomas <pault@gcc.gnu.org>
167
168 PR fortran/44265
169 * gfortran.h : Add fn_result_spec bitfield to gfc_symbol.
170 * resolve.c (flag_fn_result_spec): New function.
171 (resolve_fntype): Call it for character result lengths.
172 * symbol.c (gfc_new_symbol): Set fn_result_spec to zero.
173 * trans-decl.c (gfc_sym_mangled_identifier): Include the
174 procedure name in the mangled name for symbols with the
175 fn_result_spec bit set.
176 (gfc_finish_var_decl): Mark the decls of these symbols
177 appropriately for the case where the function is external.
178 (gfc_get_symbol_decl): Mangle the name of these symbols.
179 (gfc_create_module_variable): Allow them through the assert.
180 (gfc_generate_function_code): Remove the assert before the
181 initialization of sym->tlink because the frontend no longer
182 uses this field.
183 * trans-expr.c (gfc_map_intrinsic_function): Add a case to
184 treat the LEN_TRIM intrinsic.
185 (gfc_trans_string_copy): Deal with Wstringop-overflow warning
186 that can occur with constant source lengths at -O3.
187
188 2016-12-08 Steven G. Kargl <kargl@gcc.gnu.org>
189
190 PR fortran/65173
191 PR fortran/69064
192 PR fortran/69859
193 PR fortran/78350
194 * gfortran.h (gfc_namespace): Remove old_cl_list member.
195 * parse.c (use_modules, next_statement): old_cl_list is gone.
196 (clear_default_charlen): Remove no longer used function.
197 (reject_statement): Do not try ot clean up gfc_charlen structure(s)
198 that may have been added to a cl_list list.
199 * symbol.c (gfc_new_charlen): old_cl_list structure is gone.
200
201 2016-12-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
202
203 PR fortran/78659
204 * resolve.c (resolve_fl_namelist): Remove unneeded error.
205
206 2016-12-06 Andre Vehreschild <vehre@gcc.gnu.org>
207
208 PR fortran/78226
209 * class.c (finalize_component): Add missing locus information.
210 (finalization_scalarizer): Likewise.
211 (finalization_get_offset): Likewise.
212 (finalizer_insert_packed_call): Likewise.
213 (generate_finalization_wrapper): Likewise.
214
215 2016-12-05 Nathan Sidwell <nathan@acm.org>
216
217 * error.c (gfc_warning_check): Call diagnostic_check_max_errors.
218 (gfc_error_check): Likewise.
219
220 2016-12-04 Janus Weil <janus@gcc.gnu.org>
221
222 PR fortran/78618
223 * intrinsic.c (gfc_convert_type_warn): Do not set the full typespec for
224 the conversion symbol, but only type and kind. Set the full typespec
225 for the expression.
226 (gfc_convert_chartype): Ditto.
227
228 2016-12-03 Janus Weil <janus@gcc.gnu.org>
229
230 PR fortran/43207
231 * primary.c (gfc_match_varspec): Reject nonpolymorphic references to
232 abstract types.
233
234 2016-12-03 Janus Weil <janus@gcc.gnu.org>
235
236 PR fortran/42188
237 * primary.c (gfc_match_rvalue): Add a new check that gives better error
238 messages.
239
240 2016-12-03 Janus Weil <janus@gcc.gnu.org>
241
242 PR fortran/58175
243 * resolve.c (gfc_resolve_finalizers): Prevent bogus warning.
244
245 2016-12-02 Steven G. Kargl <kargl@gcc.gnu.org>
246
247 * simplify.c (gfc_convert_char_constant): Free result on error.
248
249 2016-12-02 Janus Weil <janus@gcc.gnu.org>
250 Steven G. Kargl <kargl@gcc.gnu.org>
251
252 PR fortran/78618
253 * check.c (gfc_check_rank): Remove ATTRIBUTE_UNUSED.
254 * expr.c (gfc_check_assign): Fix error propagation.
255
256 2016-12-01 Elizebeth Punnoose <elizebeth.punnoose@hpe.com>
257
258 PR fortran/77505
259 * trans-array.c (trans_array_constructor): Treat negative character
260 length as LEN = 0.
261
262 2016-12-01 Steven G. Kargl <kargl@gcc.gnu.org>
263
264 PR fortran/78279
265 * dependency.c (identical_array_ref): Convert gcc_assert to conditional
266 and gfc_internal_error.
267
268 2016-11-30 Andre Vehreschild <vehre@gcc.gnu.org>
269
270 * check.c (gfc_check_allocated): By pass the caf_get call and check on
271 the array.
272 * gfortran.h: Add optional flag to gfc_caf_attr.
273 * gfortran.texi: Document new enum values and _caf_is_present function.
274 * primary.c (caf_variable_attr): Add optional flag to indicate that the
275 expression is reffing a component.
276 (gfc_caf_attr): Likewise.
277 * trans-array.c (gfc_array_deallocate): Handle deallocation mode for
278 coarray deregistration.
279 (gfc_trans_dealloc_allocated): Likewise.
280 (duplicate_allocatable): Use constants instead of
281 creating custom constant tree node of zero or one. Use gfc_add_modify
282 convenience function.
283 (duplicate_allocatable_coarray): This function is similar to
284 duplicate_allocatable but tailored to handle coarrays.
285 (caf_enabled): Check whether in-derived-type coarray processing is
286 enabled.
287 (caf_in_coarray): Check that in-derived-type coarray processing is
288 enabled and currently in a derived-typed coarray.
289 (gfc_caf_is_dealloc_only): Return true, when deallocate only is
290 desired for components in derived typed coarrays.
291 (structure_alloc_comps): A mode for handling coarrays, that is no
292 longer encode in the purpose. This makes the use cases of the
293 routine more flexible without repeating. Allocatable components in
294 derived type coarrays are now registered only when nullifying an
295 object and allocated before copying data into them.
296 (gfc_nullify_alloc_comp): Use the caf_mode of structure_alloc_comps
297 now.
298 (gfc_deallocate_alloc_comp): Likewise.
299 (gfc_deallocate_alloc_comp_no_caf): Likewise.
300 (gfc_reassign_alloc_comp_caf): Likewise.
301 (gfc_copy_alloc_comp): Likewise.
302 (gfc_copy_only_alloc_comp): Likewise.
303 (gfc_alloc_allocatable_for_assignment): Make use to the cheaper way of
304 reallocating a coarray without deregistering and reregistering it.
305 (gfc_trans_deferred_array): Initialize the coarray token correctly for
306 deferred variables and tear them down on exit.
307 * trans-array.h: Change some prototypes to add the coarray (de-)
308 registration modes. Add prototype for checking if deallocate only is
309 selected for components in derived typed coarrays.
310 * trans-decl.c (gfc_build_builtin_function_decls): Generate the
311 declarations for the changed/new caf-lib routines.
312 (gfc_trans_deferred_vars): Ensure deferred variables are (de-)
313 registered correctly on procedure entry/exit.
314 (generate_coarray_sym_init): Use constants.
315 * trans-expr.c (gfc_conv_procedure_call): Propagate coarray allocation
316 modes accordingly.
317 (gfc_trans_alloc_subarray_assign): Likewise.
318 (gfc_trans_subcomponent_assign): Likewise.
319 (gfc_trans_structure_assign): Generate code to register the components
320 of a derived type coarray prior to initialization.
321 (gfc_conv_structure): Set flag that the structure is in a coarray.
322 (gfc_trans_scalar_assign): Add flag to indicate being in a coarray and
323 set the structure_alloc_comps modes correctly.
324 (gfc_trans_assignment_1): Figure being in a coarray expression.
325 * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Adapt to new
326 structure_alloc_comps interface.
327 (conv_caf_send): Use the old API as long as possible.
328 (trans_caf_is_present): Generate code to check whether an allocatable
329 component in a derived typed coarray is allocated on a remote image.
330 (caf_this_image_ref): Return true, when only reffing this image.
331 (gfc_conv_allocated): Convert allocated queries on allocatable
332 components to the library API.
333 (conv_intrinsic_move_alloc): Adapt to new interface of
334 structure_alloc_comps.
335 * trans-openmp.c (gfc_walk_alloc_comps): Likewise.
336 (gfc_omp_clause_assign_op): Likewise.
337 (gfc_omp_clause_dtor): Likewise.
338 * trans-stmt.c (gfc_trans_deallocate): Figure which mode to use when
339 deallocating allocatable components in derived type coarras.
340 * trans.c (gfc_allocate_using_lib): Renamed to
341 gfc_allcate_using_caf_lib.
342 (gfc_allocate_allocatable): Set the registration mode/type of caf-
343 register calls adapting to all the possible allocatable objects.
344 (gfc_deallocate_with_status): Add deregistration mode for allocatable
345 components in derived type coarrays.
346 (gfc_deallocate_scalar_with_status): Likewise.
347 * trans.h (enum gfc_coarray_type): Renamed to gfc_coarray_regtype to
348 avoid collision with gfc_coarray_deregtype.
349
350 2016-11-30 Janus Weil <janus@gcc.gnu.org>
351
352 PR fortran/78593
353 * primary.c (gfc_match_varspec): Check if sym is non-null to avoid ICE.
354
355 2016-11-30 Janus Weil <janus@gcc.gnu.org>
356
357 PR fortran/78592
358 * interface.c (gfc_find_specific_dtio_proc): Rearrange code to avoid
359 dereferencing a null pointer.
360
361 2016-11-30 Janus Weil <janus@gcc.gnu.org>
362
363 PR fortran/78573
364 * decl.c (build_struct): On error, return directly and do not build
365 class symbol.
366
367 2016-11-29 Tobias Burnus <burnus@net-b.de>
368
369 PR fortran/58175
370 * resolve.c (gfc_resolve_finalizers): Properly detect scalar finalizers.
371
372 2016-11-27 Paul Thomas <pault@gcc.gnu.org>
373
374 PR fortran/78474
375 * module.c (gfc_match_submodule): If there is more than one
376 colon, it is a syntax error.
377
378 PR fortran/78331
379 * module.c (gfc_use_module): If an smod file does not exist it
380 is either because the module does not have a module procedure
381 interface or there is an error in the module.
382
383 2016-11-25 Janne Blomqvist <jb@gcc.gnu.org>
384
385 * intrinsic.texi: Fix ptrdiff_t typo in ISO_C_BINDING constants
386 table.
387
388 2016-11-25 Janus Weil <janus@gcc.gnu.org>
389
390 PR fortran/60853
391 * interface.c (gfc_compare_interfaces): Remove bad special case for
392 unlimited polymorphism. Refactor for loop.
393
394 2016-11-25 Andre Vehreschild <vehre@gcc.gnu.org>
395 Paul Thomas <pault@gcc.gnu.org>
396
397 PR fortran/78293
398 * trans-expr.c (gfc_conv_procedure_call): Prepend deallocation
399 of alloctable components to post, rather than adding to
400 se->post.
401 * trans-stmt.c (gfc_trans_allocate): Move deallocation of expr3
402 allocatable components so that all expr3s are visited.
403
404 2016-11-25 Paul Thomas <pault@gcc.gnu.org>
405
406 PR fortran/78293
407 * gfortran.dg/allocatable_function_10.f90: New test.
408 * gfortran.dg/class_array_15.f03: Increase builtin_free count
409 from 11 to 12.
410
411 2016-11-24 Steven G. Kargl <kargl@gcc.gnu.org>
412
413 PR fortran/78500
414 * expr.c (gfc_check_vardef_contextm): Fix NULL pointer dereference.
415 * interface.c (matching_typebound_op): Ditto.
416
417 2016-11-23 Steven G. Kargl <kargl@gcc.gnu.org>
418
419 PR fortran/78297
420 * trans-common.c (finish_equivalences): Do not dereference a NULL pointer.
421
422 2016-11-23 Martin Jambor <mjambor@suse.cz>
423
424 * f95-lang.c (DEF_HSA_BUILTIN): New macro.
425
426 2016-11-22 Steven G. Kargl <kargl@gcc.gnu.org>
427
428 PR fortran/78479
429 * expr.c (gfc_apply_init): Allocate a charlen if needed.
430
431 2016-11-22 Janus Weil <janus@gcc.gnu.org>
432
433 PR fortran/78443
434 * class.c (add_proc_comp): Add a vtype component for non-overridable
435 procedures that are overriding.
436
437 2016-11-20 Harald Anlauf <anlauf@gmx.de>
438
439 PR fortran/69741
440 * resolve.c (gfc_resolve_forall): Check for nonscalar index variables.
441
442 2016-11-20 Andre Vehreschild <vehre@gcc.gnu.org>
443
444 PR fortran/78395
445 * resolve.c (resolve_typebound_function): Prevent stripping of refs,
446 when the base-expression is a class' typed one.
447
448 2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
449 Alan Hayward <alan.hayward@arm.com>
450 David Sherwood <david.sherwood@arm.com>
451
452 * trans-common.c (build_common_decl): Use SET_DECL_MODE.
453 * trans-decl.c (gfc_build_label_decl): Likewise.
454 * trans-types.c (gfc_get_array_descr_info): Likewise.
455
456 2016-11-17 Janus Weil <janus@gcc.gnu.org>
457
458 PR fortran/66227
459 * simplify.c (gfc_simplify_extends_type_of): Fix missed optimization.
460 Prevent over-simplification. Fix a comment. Add a comment.
461
462 2016-11-16 Steven G. Kargl <kargl@gcc.gnu.org>
463
464 PR fortran/58001
465 * io.c (next_char_not_space): Update handling of a 'tab' in a FORMAT.
466 (format_lex): Adjust invocations of next_char_not_space().
467
468 2016-11-16 Andre Vehreschild <vehre@gcc.gnu.org>
469
470 PR fortran/78356
471 * class.c (gfc_is_class_scalar_expr): Prevent taking an array ref for
472 a component ref.
473 * trans-expr.c (gfc_trans_assignment_1): Ensure a reference to the
474 object to copy is generated, when assigning class objects.
475
476 2016-11-14 Thomas Koenig <tkoenig@gcc.gnu.org>
477
478 * dump-parse-tree.c (show_code): Add prototype.
479 (gfc_debug_code): New function.
480 (show_code_node): Add space after SELECT TYPE.
481
482 2016-11-14 Janus Weil <janus@gcc.gnu.org>
483
484 PR fortran/78300
485 * resolve.c (resolve_procedure_interface): Properly handle CLASS-valued
486 function results.
487
488 2016-11-13 Janus Weil <janus@gcc.gnu.org>
489
490 PR fortran/60952
491 * decl.c (match_procedure_in_type): Apply the FL_PROCEDURE attribute
492 to the target procedure.
493
494 2016-11-13 Janus Weil <janus@gcc.gnu.org>
495
496 PR fortran/66366
497 * resolve.c (resolve_component): Move check for C437
498 to ...
499 * decl.c (build_struct): ... here. Fix indentation.
500
501 2016-11-12 Janus Weil <janus@gcc.gnu.org>
502
503 PR fortran/77501
504 * class.c (gfc_find_typebound_intrinsic_op): Remove an unnecessary
505 assert and nullification.
506 * decl.c (gfc_match_decl_type_spec): Use gfc_get_tbp_symtree,
507 fix indentation.
508 (gfc_match_generic): Remove an unnecessary assert.
509 Use gfc_get_tbp_symtree to avoid ICE.
510
511 2016-11-10 Fritz O. Reese <fritzoreese@gmail.com>
512
513 PR fortran/78277
514 * gcc/fortran/decl.c (gfc_match_data_decl): Gracefully handle bad
515 anonymous structure declarations.
516
517 2016-11-10 Fritz O. Reese <fritzoreese@gmail.com>
518
519 * decl.c (get_struct_decl, gfc_match_map, gfc_match_union): Fix
520 whitespace.
521 * interface.c (gfc_compare_union_types): Likewise.
522
523 2016-11-10 Jakub Jelinek <jakub@redhat.com>
524
525 * cpp.c (cpp_define_builtins): Define _OPENMP to 201511 instead
526 of 201307.
527 * gfortran.texi: Mention partial OpenMP 4.5 support.
528 * intrinsic.texi: Update for OpenMP 4.5.
529
530 * openmp.c (gfc_free_omp_clauses): Free critical_name, grainsize,
531 hint, num_tasks, priority and if_exprs.
532 (gfc_match_omp_to_link, gfc_match_omp_depend_sink): New functions.
533 (enum omp_mask1, enum omp_mask2): New enums.
534 Change all OMP_CLAUSE_* defines into enum values, and change their
535 values from ((uint64_t) 1 << bit) to just bit.
536 (omp_mask, omp_inv_mask): New classes. Add ctors and operators.
537 (gfc_match_omp_clauses): Change mask argument from uint64_t to
538 const omp_mask. Assert OMP_MASK1_LAST and OMP_MASK2_LAST are
539 at most 64. Move delete clause handling to where it
540 alphabetically belongs. Parse defaultmap, grainsize, hint,
541 is_device_ptr, nogroup, nowait, num_tasks, priority, simd, threads
542 and use_device_ptr clauses. Parse if clause modifier. Parse map
543 clause always modifier, and release and delete kinds. Parse ordered
544 clause with argument. Parse schedule clause modifiers. Differentiate
545 device clause parsing based on openacc flag. Guard link clause
546 parsing with openacc flag. Add support for parsing
547 linear clause modifiers. Parse depend(source) and depend(sink: ...).
548 Use gfc_match_omp_to_link for to and link clauses in declare target
549 construct.
550 (match_acc): Change mask type from uint64_t to const omp_mask.
551 (OMP_SINGLE_CLAUSES, OMP_ORDERED_CLAUSES,
552 OMP_DECLARE_TARGET_CLAUSES, OMP_TASKLOOP_CLAUSES,
553 OMP_TARGET_ENTER_DATA_CLAUSES, OMP_TARGET_EXIT_DATA_CLAUSES): Define.
554 (OACC_PARALLEL_CLAUSES, OACC_KERNELS_CLAUSES, OACC_DATA_CLAUSES,
555 OACC_LOOP_CLAUSES, OACC_HOST_DATA_CLAUSES, OACC_DECLARE_CLAUSES,
556 OACC_ENTER_DATA_CLAUSES, OACC_EXIT_DATA_CLAUSES, OACC_WAIT_CLAUSES,
557 OACC_ROUTINE_CLAUSES, OMP_PARALLEL_CLAUSES, OMP_DECLARE_SIMD_CLAUSES,
558 OMP_SECTIONS_CLAUSES, OMP_TEAMS_CLAUSES, OMP_DISTRIBUTE_CLAUSES):
559 Replace first or only OMP_CLAUSE_* value in bitset with
560 omp_mask (OMP_CLAUSE_*).
561 (OMP_DO_CLAUSES): Likewise. Add OMP_CLAUSE_LINEAR.
562 (OMP_SIMD_CLAUSES): Replace first or only OMP_CLAUSE_* value in
563 bitset with omp_mask (OMP_CLAUSE_*). Add OMP_CLAUSE_SIMDLEN.
564 (OACC_UPDATE_CLAUSES): Replace first or only OMP_CLAUSE_* value in
565 bitset with omp_mask (OMP_CLAUSE_*). Replace OMP_CLAUSE_OACC_DEVICE
566 with OMP_CLAUSE_DEVICE.
567 (OMP_TASK_CLAUSES): Replace first or only OMP_CLAUSE_* value in
568 bitset with omp_mask (OMP_CLAUSE_*). Add OMP_CLAUSE_PRIORITY.
569 (OMP_TARGET_CLAUSES): Replace first or only OMP_CLAUSE_* value in
570 bitset with omp_mask (OMP_CLAUSE_*). Add OMP_CLAUSE_DEPEND,
571 OMP_CLAUSE_NOWAIT, OMP_CLAUSE_PRIVATE, OMP_CLAUSE_FIRSTPRIVATE,
572 OMP_CLAUSE_DEFAULTMAP and OMP_CLAUSE_IS_DEVICE_PTR.
573 (OMP_TARGET_DATA_CLAUSES): Replace first or only OMP_CLAUSE_* value in
574 bitset with omp_mask (OMP_CLAUSE_*). Add OMP_CLAUSE_USE_DEVICE_PTR.
575 (OMP_TARGET_UPDATE_CLAUSES): Replace first or only OMP_CLAUSE_* value
576 in bitset with omp_mask (OMP_CLAUSE_*). Add OMP_CLAUSE_DEPEND and
577 OMP_CLAUSE_NOWAIT.
578 (match_omp): Change mask argument from unsigned int to
579 const omp_mask.
580 (gfc_match_omp_critical): Parse optional clauses and use omp_clauses
581 union member instead of omp_name.
582 (gfc_match_omp_end_critical): New function.
583 (gfc_match_omp_distribute_parallel_do): Remove ordered and linear
584 clauses from the mask.
585 (gfc_match_omp_distribute_parallel_do_simd): Use
586 & ~(omp_mask (OMP_CLAUSE_*)) instead of & ~OMP_CLAUSE_*.
587 (gfc_match_omp_target_teams_distribute_parallel_do_simd): Likewise.
588 (gfc_match_omp_teams_distribute_parallel_do_simd): Likewise.
589 (gfc_match_omp_do_simd): Likewise. Don't remove ordered clause from
590 the mask.
591 (gfc_match_omp_parallel_do_simd): Likewise.
592 (gfc_match_omp_target_teams_distribute_parallel_do): Likewise.
593 (gfc_match_omp_teams_distribute_parallel_do): Likewise.
594 (gfc_match_omp_declare_simd): If not using the form with
595 (proc-name), require space before first clause. Make (proc-name)
596 optional. If not present, set proc_name to NULL.
597 (gfc_match_omp_declare_target): Rewritten for OpenMP 4.5.
598 (gfc_match_omp_single): Use OMP_SINGLE_CLAUSES.
599 (gfc_match_omp_task, gfc_match_omp_taskwait, gfc_match_omp_taskyield):
600 Move around to where they belong alphabetically.
601 (gfc_match_omp_target_enter_data, gfc_match_omp_target_exit_data,
602 gfc_match_omp_target_parallel, gfc_match_omp_target_parallel_do,
603 gfc_match_omp_target_parallel_do_simd, gfc_match_omp_target_simd,
604 gfc_match_omp_taskloop, gfc_match_omp_taskloop_simd):
605 New functions.
606 (gfc_match_omp_ordered): Parse clauses.
607 (gfc_match_omp_ordered_depend): New function.
608 (gfc_match_omp_cancel, gfc_match_omp_end_single): Use
609 omp_mask (OMP_CLAUSE_*) instead of OMP_CLAUSE_*.
610 (resolve_oacc_scalar_int_expr): Renamed to ...
611 (resolve_scalar_int_expr): ... this. Fix up formatting.
612 (resolve_oacc_positive_int_expr): Renamed to ...
613 (resolve_positive_int_expr): ... this. Fix up formatting.
614 (resolve_nonnegative_int_expr): New function.
615 (resolve_omp_clauses): Adjust callers, use the above functions
616 even for OpenMP clauses, add handling of new OpenMP 4.5 clauses.
617 Require orderedc >= collapse if specified. Handle depend(sink:)
618 and depend(source) restrictions. Disallow linear clause when
619 orderedc is non-zero. Diagnose linear clause modifiers when not in
620 declare simd. Only check for integer type if ref modifier
621 is not used. Remove diagnostics for required VALUE attribute.
622 Diagnose VALUE attribute with ref or uval modifiers. Allow
623 non-constant linear-step, if it is a dummy argument alone and is
624 mentioned in uniform clause. Diagnose map kinds not allowed
625 for various constructs. Diagnose target {enter ,exit ,}data without
626 any map clauses. Add dummy OMP_LIST_IS_DEVICE_PTR and
627 OMP_LIST_USE_DEVICE_PTR cases.
628 (gfc_resolve_omp_do_blocks): Set omp_current_do_collapse to orderedc
629 if non-zero.
630 (gfc_resolve_omp_parallel_blocks): Handle new OpenMP 4.5 constructs,
631 replace underscores with spaces in a few construct names.
632 (resolve_omp_do): Set collapse to orderedc if non-zero. Handle new
633 OpenMP 4.5 constructs.
634 (resolve_oacc_loop_blocks): Call resolve_positive_int_expr instead
635 of resolve_oacc_positive_int_expr.
636 (gfc_resolve_omp_directive): Handle new OpenMP 4.5 constructs.
637 (gfc_resolve_omp_declare_simd): Allow ods->proc_name to be NULL.
638 * trans-openmp.c (gfc_omp_scalar_p): New function.
639 (doacross_steps): New variable.
640 (gfc_trans_omp_clauses): Handle new OpenMP 4.5 clauses and new clause
641 modifiers.
642 (gfc_trans_omp_critical): Adjust EXEC_OMP_CRITICAL handling.
643 (gfc_trans_omp_do): Handle doacross loops. Clear sched_simd flag.
644 Handle EXEC_OMP_TASKLOOP.
645 (gfc_trans_omp_ordered): Translate omp clauses, allow NULL
646 code->block.
647 (GFC_OMP_SPLIT_TASKLOOP, GFC_OMP_MASK_TASKLOOP): New enum constants.
648 (gfc_split_omp_clauses): Copy orderedc together with ordered. Change
649 firstprivate and lastprivate handling for OpenMP 4.5.
650 Handle EXEC_OMP_TARGET_SIMD, EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD}
651 and EXEC_OMP_TASKLOOP{,_SIMD}. Add handling for new OpenMP 4.5
652 clauses and clause modifiers and handle if clause without/with
653 modifiers.
654 (gfc_trans_omp_teams): Add omp_clauses argument, add it to other
655 teams clauses. Don't wrap into OMP_TEAMS if -fopenmp-simd.
656 (gfc_trans_omp_target): For -fopenmp, translate num_teams and
657 thread_limit clauses on combined target teams early and pass to
658 gfc_trans_omp_teams. Set OMP_TARGET_COMBINED if needed.
659 Handle EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD} and
660 EXEC_OMP_TARGET_SIMD.
661 (gfc_trans_omp_taskloop, gfc_trans_omp_target_enter_data,
662 gfc_trans_omp_target_exit_data): New functions.
663 (gfc_trans_omp_directive): Handle EXEC_OMP_TARGET_{ENTER,EXIT}_DATA
664 EXEC_OMP_TASKLOOP{,_SIMD}, EXEC_OMP_TARGET_PARALLEL{,_DO,_DO_SIMD}
665 and EXEC_OMP_TARGET_SIMD. Adjust gfc_trans_omp_teams caller.
666 * symbol.c (check_conflict): Handle omp_declare_target_link.
667 (gfc_add_omp_declare_target_link): New function.
668 (gfc_copy_attr): Copy omp_declare_target_link.
669 * dump-parse-tree.c (show_omp_namelist): Handle OMP_DEPEND_SINK_FIRST
670 depend_op. Print linear clause modifiers.
671 (show_omp_clauses): Adjust for OpenMP 4.5 clause changes.
672 (show_omp_node): Print clauses for EXEC_OMP_ORDERED. Allow NULL
673 c->block for EXEC_OMP_ORDERED. Formatting fixes. Adjust handling of
674 EXEC_OMP_CRITICAL, handle new OpenMP 4.5 constructs and some
675 forgotten OpenMP 4.0 constructs.
676 (show_code_node): Handle new OpenMP 4.5 constructs and some forgotten
677 OpenMP 4.0 constructs.
678 * gfortran.h (symbol_attribute): Add omp_declare_target_link bitfield.
679 (struct gfc_omp_namelist): Add u.common and u.linear_op fields.
680 (struct gfc_common_head): Change omp_declare_target into bitfield.
681 Add omp_declare_target_link bitfield.
682 (gfc_add_omp_declare_target_link): New prototype.
683 (enum gfc_statement): Add ST_OMP_TARGET_PARALLEL,
684 ST_OMP_END_TARGET_PARALLEL, ST_OMP_TARGET_PARALLEL_DO,
685 ST_OMP_END_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
686 ST_OMP_END_TARGET_PARALLEL_DO_SIMD, ST_OMP_TARGET_ENTER_DATA,
687 ST_OMP_TARGET_EXIT_DATA, ST_OMP_TARGET_SIMD, ST_OMP_END_TARGET_SIMD,
688 ST_OMP_TASKLOOP, ST_OMP_END_TASKLOOP, ST_OMP_TASKLOOP_SIMD,
689 ST_OMP_END_TASKLOOP_SIMD and ST_OMP_ORDERED_DEPEND.
690 (enum gfc_omp_depend_op): Add OMP_DEPEND_SINK_FIRST and
691 OMP_DEPEND_SINK.
692 (enum gfc_omp_linear_op): New.
693 (struct gfc_omp_clauses): Add critical_name, depend_source,
694 orderedc, defaultmap, nogroup, sched_simd, sched_monotonic,
695 sched_nonmonotonic, simd, threads, grainsize, hint, num_tasks,
696 priority and if_exprs fields.
697 (enum gfc_exec_op): Add EXEC_OMP_END_CRITICAL,
698 EXEC_OMP_TARGET_ENTER_DATA, EXEC_OMP_TARGET_EXIT_DATA,
699 EXEC_OMP_TARGET_PARALLEL, EXEC_OMP_TARGET_PARALLEL_DO,
700 EXEC_OMP_TARGET_PARALLEL_DO_SIMD, EXEC_OMP_TARGET_SIMD,
701 EXEC_OMP_TASKLOOP, EXEC_OMP_TASKLOOP_SIMD.
702 (enum gfc_omp_map_op): Add OMP_MAP_RELEASE,
703 OMP_MAP_ALWAYS_TO, OMP_MAP_ALWAYS_FROM and OMP_MAP_ALWAYS_TOFROM.
704 (OMP_LIST_IS_DEVICE_PTR, OMP_LIST_USE_DEVICE_PTR): New.
705 (enum gfc_omp_if_kind): New.
706 * module.c (enum ab_attribute): Add AB_OMP_DECLARE_TARGET_LINK.
707 (attr_bits): Add AB_OMP_DECLARE_TARGET_LINK entry.
708 (mio_symbol_attribute): Save and restore omp_declare_target_link bit.
709 * trans.h (gfc_omp_scalar_p): New prototype.
710 * frontend-passes.c (gfc_code_walker): Handle new OpenMP 4.5
711 expressions.
712 * trans.c (trans_code): Handle new OpenMP 4.5 constructs.
713 * resolve.c (gfc_resolve_blocks): Likewise.
714 (gfc_resolve_code): Likewise.
715 * f95-lang.c (LANG_HOOKS_OMP_SCALAR_P): Redefine to gfc_omp_scalar_p.
716 (gfc_attribute_table): Add "omp declare target link".
717 * st.c (gfc_free_statement): Handle EXEC_OMP_END_CRITICAL like
718 EXEC_OMP_CRITICAL before, free clauses for EXEC_OMP_CRITICAL
719 and new OpenMP 4.5 constructs. Free omp clauses even for
720 EXEC_OMP_ORDERED.
721 * match.c (match_exit_cycle): Rename collapse variable to count,
722 set it to orderedc if non-zero, instead of collapse.
723 * trans-decl.c (add_attributes_to_decl): Add "omp declare target link"
724 instead of "omp declare target" for omp_declare_target_link.
725 * trans-common.c (build_common_decl): Likewise.
726 * match.h (gfc_match_omp_target_enter_data,
727 gfc_match_omp_target_exit_data, gfc_match_omp_target_parallel,
728 gfc_match_omp_target_parallel_do,
729 gfc_match_omp_target_parallel_do_simd, gfc_match_omp_target_simd,
730 gfc_match_omp_taskloop, gfc_match_omp_taskloop_simd,
731 gfc_match_omp_end_critical, gfc_match_omp_ordered_depend): New
732 prototypes.
733 * parse.c (decode_omp_directive): Use gfc_match_omp_end_critical
734 instead of gfc_match_omp_critical for !$omp end critical.
735 Handle new OpenMP 4.5 constructs. If ordered directive has
736 depend clause as the first of the clauses, use
737 gfc_match_omp_ordered_depend and ST_OMP_ORDERED_DEPEND instead of
738 gfc_match_omp_ordered and ST_OMP_ORDERED.
739 (case_executable): Add ST_OMP_TARGET_ENTER_DATA,
740 ST_OMP_TARGET_EXIT_DATA and ST_OMP_ORDERED_DEPEND cases.
741 (case_exec_markers): Add ST_OMP_TARGET_PARALLEL,
742 ST_OMP_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
743 ST_OMP_TARGET_SIMD, ST_OMP_TASKLOOP and ST_OMP_TASKLOOP_SIMD cases.
744 (gfc_ascii_statement): Handle new OpenMP 4.5 constructs.
745 (parse_omp_do): Handle ST_OMP_TARGET_PARALLEL_DO,
746 ST_OMP_TARGET_PARALLEL_DO_SIMD, ST_OMP_TASKLOOP and
747 ST_OMP_TASKLOOP_SIMD.
748 (parse_omp_structured_block): Handle EXEC_OMP_END_CRITICAL instead
749 of EXEC_OMP_CRITICAL, adjust for EXEC_OMP_CRITICAL having omp clauses
750 now.
751 (parse_executable): Handle ST_OMP_TARGET_PARALLEL,
752 ST_OMP_TARGET_PARALLEL_DO, ST_OMP_TARGET_PARALLEL_DO_SIMD,
753 ST_OMP_TASKLOOP and ST_OMP_TASKLOOP_SIMD.
754
755 2016-11-09 Mikael Morin <mikael@gcc.gnu.org>
756 Janus Weil <janus@gcc.gnu.org>
757
758 PR fortran/46459
759 * interface.c (compare_actual_formal): Add safety checks to avoid ICE.
760
761 2016-11-09 Fritz O. Reese <fritzoreese@gmail.com>
762
763 PR fortran/78259
764 * trans-expr.c (gfc_trans_subcomponent_assign): Guard against NULL
765 values.
766
767 2016-11-09 Steven G. Kargl <kargl@gcc.gnu.org>
768 Janus Weil <janus@gcc.gnu.org>
769
770 PR fortran/60777
771 * expr.c (external_spec_function): Allow recursive specification
772 functions in F03.
773
774 2016-11-09 Paul Thomas <pault@gcc.gnu.org>
775
776 * check.c (gfc_check_move_alloc): Prevent error that avoids
777 aliasing between to and from arguments from rejecting valid
778 code.
779
780 2016-11-09 Janus Weil <janus@gcc.gnu.org>
781
782 PR fortran/71894
783 * class.c (gfc_add_component_ref): Add safety checks to avoid ICE.
784
785 2016-11-08 Janus Weil <janus@gcc.gnu.org>
786
787 PR fortran/68440
788 * expr.c (check_alloc_comp_init): Loosen an assert.
789 * resolve.c (resolve_fl_parameter): Reject class parameters.
790
791 2016-11-08 Janus Weil <janus@gcc.gnu.org>
792
793 PR fortran/77596
794 * expr.c (gfc_check_pointer_assign): Add special check for procedure-
795 pointer component with absent interface.
796
797 2016-11-07 Thomas Koenig <tkoenig@gcc.gnu.org>
798
799 PR fortran/78226
800 * expr.c (gfc_generate_initializer): Add where to EXPR_NULL
801 statement.
802 * iresolve.c (gfc_resolve_extends_type_of): Add where to
803 both arguments of the function.
804 * resolve.c (resolve_select_type): Add where to the
805 second argument of the new statement.
806
807 2016-11-07 Thomas Koenig <tkoenig@gcc.gnu.org>
808
809 PR fortran/78226
810 * match.c (gfc_match_select_type): Add where for expr1.
811 * resolve.c (resolev_select_type): Add where for expr1 of new
812 statement.
813
814 2016-11-06 Thomas Koenig <tkoenig@gcc.gnu.org>
815
816 PR fortran/78226
817 resolve.c (build_loc_call): Add location to return value.
818
819 2016-11-06 Andre Vehreschild <vehre@gcc.gnu.org>
820
821 * expr.c (is_non_empty_structure_constructor): New function to detect
822 non-empty structure constructor.
823 (gfc_has_default_initializer): Analyse initializers.
824 * resolve.c (cond_init): Removed.
825 (resolve_allocate_expr): Removed dead code. Moved invariant code out
826 of the loop over all objects to allocate.
827 (resolve_allocate_deallocate): Added the invariant code remove from
828 resolve_allocate_expr.
829 * trans-array.c (gfc_array_allocate): Removed nullify of structure
830 components in favour of doing this in gfc_trans_allocate for both
831 scalars and arrays in the same place.
832 * trans-expr.c (gfc_trans_init_assign): Always using _vptr->copy for
833 class objects.
834 * trans-stmt.c (allocate_get_initializer): Get the initializer
835 expression for object allocated.
836 (gfc_trans_allocate): Nullify a derived type only, when no SOURCE=
837 or MOLD= is present preventing duplicate work. Moved the creation
838 of the init-expression here to prevent code for conditions that
839 can not occur on freshly allocated object, like checking for the need
840 to free allocatable components.
841
842 2016-11-06 Thomas Koenig <tkoenig@gcc.gnu.org>
843
844 PR fortran/78221
845 * arith.c (gfc_complex2real): Change gfc_warning_now to
846 gfc_warning.
847
848 2016-11-05 Paul Thomas <pault@gcc.gnu.org>
849
850 * check.c (gfc_check_move_alloc): Introduce error to prevent
851 aliasing between to and from arguments.
852
853 2016-11-05 Janus Weil <janus@gcc.gnu.org>
854 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
855
856 PR fortran/69495
857 * invoke.texi: Mention -Wpedantic as an alias of -pedantic.
858 * check.c (gfc_check_transfer): Mention responsible flag in warning
859 message.
860 * frontend-passes.c (do_warn_function_elimination): Ditto.
861 * resolve.c (resolve_elemental_actual): Ditto.
862 (resolve_operator): Ditto.
863 (warn_unused_fortran_label): Ditto.
864 * trans-common.c (translate_common): Ditto.
865
866 2016-11-05 Paul Thomas <pault@gcc.gnu.org>
867
868 PR fortran/67564
869 * trans-expr.c (gfc_conv_class_to_class): Return _len component
870 of unlimited polymorphic entities.
871
872 2016-11-04 Paul Thomas <pault@gcc.gnu.org>
873
874 PR fortran/64933
875 * primary.c (gfc_match_varspec): If selector expression is
876 unambiguously an array, make sure that the associate name
877 is an array and has an array spec. Modify the original
878 condition for doing this to exclude character types.
879
880 2016-11-03 Fritz Reese <fritzoreese@gmail.com>
881
882 * gfortran.texi: Document.
883 * gfortran.h (gfc_dt): New field default_exp.
884 * primary.c (match_real_constant): Default exponent with -fdec.
885 * io.c (match_io): Set dt.default_exp with -fdec.
886 * ioparm.def (IOPARM_dt_default_exp): New.
887 * trans-io.c (build_dt): Set IOPARM_dt_default_exp with -fdec.
888
889 2016-11-03 Fritz O. Reese <fritzoreese@gmail.com>
890
891 * decl.c (gfc_match_parameter): Allow omitted '()' with -std=legacy.
892 * parse.c (decode_statement): Match "parameter" before assignments.
893 * gfortran.texi: Document.
894
895 2016-11-02 Fritz O. Reese <fritzoreese@gmail.com>
896
897 * lang.opt, invoke.texi: New argument -Wargument-mismatch.
898 * interface.c (compare_parameter, compare_actual_formal,
899 gfc_check_typebound_override, argument_rank_mismatch): Control argument
900 mismatch warnings with -Wargument-mismatch.
901 * resolve.c (resolve_structure_cons, resolve_global_procedure): Ditto.
902
903 2016-11-02 Fritz Reese <fritzoreese@gmail.com>
904
905 * gfortran.h (gfc_error): New declaration for gfc_error with 'opt'.
906 * error.c (gfc_error): Add optional 'opt' argument.
907 * error.c (gfc_notify_std): Call fully-qualified gfc_error.
908
909 2016-11-01 Thomas Koenig <tkoenig@gcc.gnu.org>
910
911 PR fortran/78178
912 * match.c (match_simple_where): Fill in locus for assigment
913 in simple WHERE statement.
914
915 2016-11-01 Thomas Koenig <tkoenig@gcc.gnu.org>
916
917 PR fortran/69544
918 * match.c (gfc_match_where): Fill in locus for assigment
919 in simple WHERE statement.
920
921 2016-10-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
922
923 PR fortran/54679
924 * io.c (check_format): Adjust checks for FMT_L to treat a zero
925 width as an extension, giving warnings or error as appropriate.
926 Improve messages.
927
928 2016-10-31 Jakub Jelinek <jakub@redhat.com>
929
930 * trans-types.c (gfc_get_array_descr_info): For -gdwarf-5 or
931 -gno-strict-dwarf, handle assumed rank arrays the way dwarf2out
932 expects.
933
934 2016-10-30 Thomas Koenig <tkoenig@gcc.gnu.org>
935
936 PR fortran/67219
937 * arith.c (gfc_int2real): Change gfc_warning_now
938 to gfc_warning.
939 * primary.c (match_complex_constant): If there
940 is no comma, throw away any warning which might have
941 been issued by gfc_int2real.
942
943 2016-10-28 Steven G. Kargl <kargl@gcc.gnu.org>
944
945 PR fortran/71891
946 * symbol.c (gfc_type_compatible): Fix typo.
947
948 2016-10-27 Jakub Jelinek <jakub@redhat.com>
949
950 PR fortran/78026
951 * parse.c (decode_statement): Don't create namespace for possible
952 select type here and destroy it afterwards.
953 (parse_select_type_block): Set gfc_current_ns to new_st.ext.block.ns.
954 (parse_executable, gfc_parse_file): Formatting fixes.
955 * match.c (gfc_match_select_type): Create namespace for select type
956 here, only after matching select type. Formatting fixes. Free that
957 namespace if not returning MATCH_YES, after gfc_undo_symbols,
958 otherwise remember it in new_st.ext.block.ns and switch to parent
959 namespace anyway.
960
961 2016-10-27 Fritz Reese <fritzoreese@gmail.com>
962
963 * expr.c (generate_union_initializer, get_union_initializer): New.
964 * expr.c (component_initializer): Consider BT_UNION specially.
965 * resolve.c (resolve_structure_cons): Hack for BT_UNION.
966 * trans-expr.c (gfc_trans_subcomponent_assign): Ditto.
967 * trans-expr.c (gfc_conv_union_initializer): New.
968 * trans-expr.c (gfc_conv_structure): Replace UNION handling code with
969 new function gfc_conv_union_initializer.
970
971 2016-10-26 Steven G. Kargl <kargl@gcc.gnu.org>
972
973 PR fortran/78092
974 * trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Fix reference to an
975 array element of type CLASS.
976
977 2016-10-26 Paul Thomas <pault@gcc.gnu.org>
978
979 PR fortran/78108
980 * resolve.c (resolve_typebound_intrinsic_op): For submodules
981 suppress the error and return if the same procedure symbol
982 is added more than once to the interface.
983
984 2016-10-26 Fritz Reese <fritzoreese@gmail.com>
985
986 * frontend-passes.c (gfc_code_walker): Add SHARE and CARRIAGECONTROL.
987 * io.c (gfc_free_open, gfc_resolve_open, gfc_match_open): Ditto.
988 * gfortran.h (gfc_open): Add SHARE, CARRIAGECONTROL, and READONLY.
989 * io.c (io_tag, match_open_element): Ditto.
990 * ioparm.def: Ditto.
991 * trans-io.c (gfc_trans_open): Ditto.
992 * io.c (match_dec_etag, match_dec_ftag): New functions.
993 * gfortran.texi: Document.
994
995 2016-10-25 Fritz Reese <fritzoreese@gmail.com>
996
997 * gfortran.texi: Document.
998 * resolve.c (logical_to_bitwise): New function.
999 * resolve.c (resolve_operator): Wrap operands with logical_to_bitwise.
1000
1001 2016-10-25 Andre Vehreschild <vehre@gcc.gnu.org>
1002
1003 PR fortran/72770
1004 * class.c (find_intrinsic_vtab): No longer encode the string length
1005 into vtype's name and use the char's kind for the size instead of
1006 the string_length time the size.
1007 * trans-array.c (gfc_conv_ss_descriptor): For deferred length char
1008 arrays the dynamically sized type needs to be declared.
1009 (build_class_array_ref): Address the i-th array element by multiplying
1010 it with the _vptr->_size and the _len to make sure char arrays are
1011 addressed correctly.
1012 * trans-expr.c (gfc_conv_intrinsic_to_class): Made comment more
1013 precise.
1014
1015 2016-10-25 Cesar Philippidis <cesar@codesourcery.com>
1016
1017 * intrinsic.texi (cosd): New mathop.
1018
1019 2016-10-25 Fritz Reese <fritzoreese@gmail.com>
1020
1021 * match.c (gfc_match_intrinsic_op): Match ".XOR." with -std=legacy.
1022 * gfortran.texi: Document.
1023
1024 2016-10-25 Fritz Reese <fritzoreese@gmail.com>
1025
1026 * primary.c (gfc_match_rvalue): Match %LOC as LOC with -std=legacy.
1027 * gfortran.texi: Document.
1028
1029 2016-10-25 Fritz Reese <fritzoreese@gmail.com>
1030
1031 * decl.c (gfc_match_type): New function.
1032 * match.h (gfc_match_type): New function.
1033 * match.c (gfc_match_if): Special case for one-line IFs.
1034 * gfortran.texi: Update documentation.
1035 * parse.c (decode_statement): Invoke gfc_match_type.
1036
1037 2016-10-25 Fritz Reese <fritzoreese@gmail.com>
1038
1039 * gfortran.texi: Document.
1040 * gfortran.h (gfc_is_whitespace): Include form feed ('\f').
1041
1042 2016-10-25 Fritz Reese <fritzoreese@gmail.com>
1043
1044 * invoke.texi, gfortran.texi: Touch up documentation of -fdec.
1045 * gfortran.h (gfc_option): Move flag_dec_structure out of gfc_option.
1046 * decl.c (match_record_decl, gfc_match_decl_type_spec,
1047 gfc_match_structure_decl): Ditto.
1048 * match.c (gfc_match_member_sep): Ditto.
1049 * options.c (gfc_handle_option): Ditto.
1050 * lang.opt (fdec-structure): Use Fortran Var for flag_dec_structure.
1051 * lang.opt (fdec): Use Fortran Var to create flag_dec.
1052 * options.c (set_dec_flags): With -fdec enable -fcray-pointer,
1053 -fd-lines-as-comments (default), -fdollar-ok, and legacy std flags.
1054
1055 2016-10-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1056
1057 PR fortran/77828
1058 * ioparm.def: Reorder dt parameters to match libgfortran.
1059 * libgfortran.h: Swap definitions of GFC_INTERNAL_UNIT and
1060 GFC_INTERNAL_UNIT4.
1061
1062 2016-10-24 Steven G. Kargl <kargl@gcc.gnu.org>
1063
1064 PR fortran/71895
1065 * interface.c (gfc_compare_derived_types): Convert gcc_assert()
1066 to a gfc_internal_error() to prevent an ICE.
1067
1068 2016-10-24 Jakub Jelinek <jakub@redhat.com>
1069
1070 * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Use VAR_P (x)
1071 instead of TREE_CODE (x) == VAR_DECL.
1072 * trans-expr.c (gfc_class_vptr_get, gfc_class_len_get,
1073 gfc_class_len_or_zero_get, gfc_get_vptr_from_expr,
1074 gfc_conv_string_length, conv_base_obj_fcn_val,
1075 gfc_conv_procedure_call, gfc_trans_assignment_1): Likewise.
1076 * trans-openmp.c (gfc_omp_predetermined_sharing,
1077 gfc_omp_disregard_value_expr, gfc_omp_private_debug_clause,
1078 gfc_trans_omp_atomic, gfc_trans_omp_do): Likewise.
1079 * trans-io.c (nml_get_addr_expr): Likewise.
1080 * trans-decl.c (gfc_finish_decl, gfc_build_qualified_array,
1081 gfc_get_symbol_decl, gfc_get_fake_result_decl,
1082 gfc_trans_deferred_vars, gfc_trans_use_stmts,
1083 generate_local_decl): Likewise.
1084 * trans-array.c (trans_array_constructor, trans_array_bound_check,
1085 build_class_array_ref, gfc_array_init_size,
1086 gfc_trans_auto_array_allocation, gfc_trans_g77_array,
1087 gfc_trans_dummy_array_bias, gfc_alloc_allocatable_for_assignment,
1088 gfc_trans_deferred_array): Likewise.
1089 * trans.c (gfc_build_array_ref): Likewise. Use
1090 VAR_OR_FUNCTION_DECL_P (x) instead of TREE_CODE (x) == VAR_DECL
1091 || TREE_CODE (x) == FUNCTION_DECL.
1092
1093 2016-10-23 Steven G. Kargl <kargl@gcc.gnu.org>
1094
1095 PR fortran/77763
1096 * parse.c (parse_spec): Allow STRUCTURE in BLOCK DATA. Sort
1097 case labels.
1098
1099 2016-10-23 Steven G. Kargl <kargl@gcc.gnu.org>
1100
1101 PR fortran/54730
1102 PR fortran/78033
1103 * array.c (gfc_match_array_constructor): Remove checkpointing
1104 introduced in r196416 (original fix for PR fortran/54730). Move
1105 initialization to top of function.
1106 * match.c (gfc_match_type_spec): Special case matching for REAL.
1107
1108 2016-10-23 Paul Thomas <pault@gcc.gnu.org>
1109
1110 PR fortran/69834
1111 * class.c (gfc_find_derived_vtab): Obtain the gsymbol for the
1112 derived type's module. If the gsymbol is present and the top
1113 level namespace corresponds to a module, use the gsymbol name
1114 space. In the search to see if the vtable exists, try the gsym
1115 namespace first.
1116 * dump-parse-tree (show_code_node): Modify select case dump to
1117 show select type construct.
1118 * resolve.c (build_loc_call): New function.
1119 (resolve_select_type): Add check for repeated type is cases.
1120 Retain selector expression and use it later instead of expr1.
1121 Exclude deferred length TYPE IS cases and emit error message.
1122 Store the address for the vtable in the 'low' expression and
1123 the hash value in the 'high' expression, for each case. Do not
1124 call resolve_select.
1125 * trans.c(trans_code) : Call gfc_trans_select_type.
1126 * trans-stmt.c (gfc_trans_select_type_cases): New function.
1127 (gfc_trans_select_type): New function.
1128 * trans-stmt.h : Add prototype for gfc_trans_select_type.
1129
1130 2016-10-22 Thomas Koenig <tkoenig@gcc.gnu.org>
1131
1132 PR fortran/78021
1133 * gfc_compare_functions: Strings with different lengths in
1134 argument lists compare unequal.
1135
1136 2016-10-22 Andre Vehreschild <vehre@gcc.gnu.org>
1137
1138 PR fortran/43366
1139 PR fortran/51864
1140 PR fortran/57117
1141 PR fortran/61337
1142 PR fortran/61376
1143 * primary.c (gfc_expr_attr): For transformational functions on classes
1144 get the attrs from the class argument.
1145 * resolve.c (resolve_ordinary_assign): Remove error message due to
1146 feature implementation. Rewrite POINTER_ASSIGNS to ordinary ones when
1147 the right-hand side is scalar class object (with some restrictions).
1148 * trans-array.c (trans_array_constructor): Create the temporary from
1149 class' inner type, i.e., the derived type.
1150 (build_class_array_ref): Add support for class array's storage of the
1151 class object or the array descriptor in the decl saved descriptor.
1152 (gfc_conv_expr_descriptor): When creating temporaries for class objects
1153 add the class object's handle into the decl saved descriptor.
1154 (structure_alloc_comps): Use the common way to get the _data component.
1155 (gfc_is_reallocatable_lhs): Add notion of allocatable class objects.
1156 * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Remove the only ref
1157 only when the expression's type is BT_CLASS.
1158 (gfc_trans_class_init_assign): Correctly handle class arrays.
1159 (gfc_trans_class_assign): Joined into gfc_trans_assignment_1.
1160 (gfc_conv_procedure_call): Support for class types as arguments.
1161 (trans_get_upoly_len): For unlimited polymorphics retrieve the _len
1162 component's tree.
1163 (trans_class_vptr_len_assignment): Catch all ways to assign the _vptr
1164 and _len components of a class object correctly.
1165 (pointer_assignment_is_proc_pointer): Identify assignments of
1166 procedure pointers.
1167 (gfc_trans_pointer_assignment): Enhance support for class object pointer
1168 assignments.
1169 (gfc_trans_scalar_assign): Removed assert.
1170 (trans_class_assignment): Assign to a class object.
1171 (gfc_trans_assignment_1): Treat class objects correctly.
1172 (gfc_trans_assignment): Propagate flags to trans_assignment_1.
1173 * trans-stmt.c (gfc_trans_allocate): Use gfc_trans_assignment now
1174 instead of copy_class_to_class.
1175 * trans-stmt.h: Function prototype removed.
1176 * trans.c (trans_code): Less special casing for class objects.
1177 * trans.h: Added flags to gfc_trans_assignment () prototype.
1178
1179 2016-10-21 Paul Thomas <pault@gcc.gnu.org>
1180
1181 PR fortran/69566
1182 * resolve.c (fixup_array_ref): New function.
1183 (resolve_select_type): Gather up the rank and array reference,
1184 if any, from the selector. Fix up the 'associate name' and the
1185 'associate entities' as necessary.
1186 * trans-expr.c (gfc_conv_class_to_class): If the symbol backend
1187 decl is a FUNCTION_DECL, use the 'fake_result_decl' instead.
1188
1189 2016-10-20 Steven G. Kargl <kargl@gcc.gnu.org>
1190
1191 * array.c (gfc_match_array_constructor): Remove set, but unused
1192 variable.
1193
1194 2016-10-20 Andre Vehreschild <vehre@gcc.gnu.org>
1195
1196 * class.c (gfc_build_class_symbol): Set the kind of _len to
1197 gfc_charlen_int_kind to catch changes of the charlen kind.
1198
1199 2016-10-17 Steven G. Kargl <kargl@gcc.gnu.org>
1200
1201 PR fortran/77978
1202 * match.c (gfc_match_stopcode): Fix error reporting for several
1203 deficiencies in matching stop-codes.
1204
1205 2016-10-17 Paul Thomas <pault@gcc.gnu.org>
1206
1207 PR fortran/61420
1208 PR fortran/78013
1209 * resolve.c (resolve_variable): Obtain the typespec for a
1210 variable expression, when the variable is a function result
1211 that is a procedure pointer.
1212
1213 2016-10-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1214
1215 PR fortran/48298
1216 * trans-io.c (transfer_expr): Ignore dtio procedures for inquire
1217 with iolength.
1218
1219 2016-10-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1220
1221 PR fortran/77972
1222 * scanner.c (gfc_next_char_literal): If nextc is null do not
1223 decrement the pointer and call the diagnostics.
1224
1225 2016-10-14 Andre Vehreschild <vehre@gcc.gnu.org>
1226
1227 * resolve.c (resolve_symbol): Add unimplemented message for
1228 polymorphic types with allocatable/pointer components and coarray=lib.
1229
1230 2016-10-13 Thomas Preud'homme <thomas.preudhomme@arm.com>
1231
1232 * trans-intrinsic.c: Include memmodel.h.
1233
1234 2016-10-13 Andre Vehreschild <vehre@gcc.gnu.org>
1235
1236 PR fortran/72832
1237 * trans-expr.c (gfc_copy_class_to_class): Add generation of
1238 runtime array bounds check.
1239 * trans-intrinsic.c (gfc_conv_intrinsic_size): Add a crutch to
1240 get the descriptor of a function returning a class object.
1241 * trans-stmt.c (gfc_trans_allocate): Use the array spec on the
1242 array to allocate instead of the array spec from source=.
1243
1244 2016-10-12 Andre Vehreschild <vehre@gcc.gnu.org>
1245
1246 * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Fixed style.
1247 (gfc_trans_class_init_assign): Same.
1248 (gfc_conv_procedure_call): Same.
1249 (gfc_trans_assignment_1): Same.
1250 * trans-stmt.c (gfc_trans_allocate): Same.
1251
1252 2016-10-11 Jakub Jelinek <jakub@redhat.com>
1253
1254 * iresolve.c (is_trig_resolved, resolve_trig_call): Formatting fixes.
1255 * simplify.c (simplify_trig_call, degrees_f, radians_f,
1256 gfc_simplify_atrigd, gfc_simplify_cotan): Likewise.
1257
1258 2016-10-11 Steven G. Kargl <kargl@gcc.gnu.org>
1259
1260 PR fortran/77942
1261 * simplify.c (gfc_simplify_cshift): Check for zero.
1262
1263 2016-10-11 Fritz Reese <fritzoreese@gmail.com>
1264
1265 * iresolve.c (get_radians, get_degrees): Fix sloppy commit.
1266 * simplify.c (degrees_f, radians_f): Ditto.
1267
1268 2016-10-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1269
1270 * simplify.c (radians_f): Fix mpfr_mod.
1271 * ireolce.c (get_degrees): Declare tmp.
1272
1273 2016-10-11 Fritz Reese <fritzoreese@gmail.com>
1274
1275 * lang.opt: New flag -fdec-math.
1276 * options.c (set_dec_flags): Enable with -fdec.
1277 * invoke.texi, gfortran.texi, intrinsic.texi: Update documentation.
1278 * intrinsics.c (add_functions, do_simplify): New intrinsics
1279 with -fdec-math.
1280 * gfortran.h (gfc_isym_id): New isym GFC_ISYM_COTAN.
1281 * gfortran.h (gfc_resolve_atan2d, gfc_resolve_cotan,
1282 gfc_resolve_trigd, gfc_resolve_atrigd): New prototypes.
1283 * iresolve.c (resolve_trig_call, get_degrees, get_radians,
1284 is_trig_resolved, gfc_resolve_cotan, gfc_resolve_trigd,
1285 gfc_resolve_atrigd, gfc_resolve_atan2d): New functions.
1286 * intrinsics.h (gfc_simplify_atan2d, gfc_simplify_atrigd,
1287 gfc_simplify_cotan, gfc_simplify_trigd): New prototypes.
1288 * simplify.c (simplify_trig_call, degrees_f, radians_f,
1289 gfc_simplify_cotan, gfc_simplify_trigd, gfc_simplify_atrigd,
1290 gfc_simplify_atan2d): New functions.
1291
1292 2016-10-10 Thomas Koenig <tkoenig@gcc.gnu.org>
1293
1294 PR fortran/77915
1295 * frontend-passes.c (inline_matmul_assign): Return early if
1296 inside a FORALL statement.
1297
1298 2016-10-07 Fritz Reese <fritzoreese@gmail.com>
1299
1300 * interface.c (compare_components): Check charlen for BT_CHAR.
1301
1302 2016-10-07 Steven G. Kargl <kargl@gcc.gnu.org>
1303
1304 PR fortran/77406
1305 * interface.c (gfc_compare_interfaces): Fix detection of ambiguous
1306 interface involving alternate return.
1307 (check_interface1): Improve error message and loci.
1308
1309 2016-10-06 Louis Krupp <louis.krupp@zoho.com>
1310
1311 PR fortran/69955
1312 * trans-array.c (gfc_conv_expr_descriptor): Don't allocate
1313 components if it's not necessary.
1314
1315 2016-10-05 Louis Krupp <louis.krupp@zoho.com>
1316
1317 PR fortran/57910
1318 * trans-expr.c (gfc_add_interface_mapping): Don't try to
1319 dereference call-by-value scalar argument.
1320
1321 2016-10-05 Steven G. Kargl <kargls@gcc.gnu.org>
1322
1323 PR fortran/58991
1324 PR fortran/58992
1325 * resolve.c (resolve_assoc_var): Fix CHARACTER type-spec for a
1326 selector in ASSOCIATE.
1327 (resolve_fl_variable): Skip checks for an ASSOCIATE variable.
1328
1329 2016-10-05 Fritz Reese <fritzoreese@gmail.com>
1330
1331 * interface.c (gfc_compare_types): Don't compare BT_UNION components
1332 until we know they're both UNIONs.
1333 * interface.c (gfc_compare_union_types): Guard against empty
1334 components.
1335
1336 2016-10-05 Louis Krupp <louis.krupp@zoho.com>
1337
1338 PR fortran/67524
1339 * resolve.c (resolve_symbol): Don't apply default type rules to
1340 mixed-entry master created for function entry points.
1341
1342 2016-09-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1343
1344 PR fortran/66643
1345 * io.c (match_dt_unit): Peek check for missing format.
1346
1347 2016-09-30 Fritz Reese <fritzoreese@gmail.com>
1348
1349 PR fortran/77764
1350 * interface.c (gfc_compare_union_types): Null-guard map components.
1351
1352 2016-09-30 Fritz Reese <fritzoreese@gmail.com>
1353
1354 PR fortran/77782
1355 * interface.c (gfc_compare_derived_types): Use gfc_compare_union_types
1356 to compare union types.
1357
1358 2016-09-30 Andre Vehreschild <vehre@gcc.gnu.org>
1359
1360 * trans-array.c (gfc_array_allocate): Use the token from coarray's
1361 .token member.
1362 * trans-intrinsic.c (conv_expr_ref_to_caf_ref): Only generate
1363 caf-reference chains from the first coarray references on.
1364 * trans-types.c (gfc_get_derived_type): Switch on mandatory .token
1365 member generation for allocatable arrays in coarrays in derived types.
1366
1367 2016-09-29 James Greenhalgh <james.greenhalgh@arm.com>
1368
1369 * options.c (gfc_post_options): Remove special case for
1370 TARGET_FLT_EVAL_METHOD_NON_DEFAULT with -fexcess-precision=standard.
1371
1372 2016-09-27 Jakub Jelinek <jakub@redhat.com>
1373
1374 * dependency.c (gfc_dep_compare_expr): Remove break after return.
1375 * frontend-passes.c (optimize_op): Likewise.
1376 * interface.c (gfc_current_interface_head): Likewise.
1377 * symbol.c (check_conflict): Likewise.
1378 * trans-intrinsic.c (build_fix_expr): Likewise.
1379
1380 PR fortran/77666
1381 * trans-openmp.c (gfc_omp_private_outer_ref): Return true even for
1382 references to allocatable arrays.
1383
1384 2016-09-26 Steven G. Kargl <kargl@gcc.gnu.org>
1385
1386 PR fortran/77420
1387 * trans-common.c: Handle array elements in equivalence when
1388 the lower and upper bounds of array spec are NULL.
1389
1390 2016-09-26 Paul Thomas <pault@gcc.gnu.org>
1391
1392 PR fortran/48298
1393 * interface.c (gfc_find_specific_dtio_proc) : Return NULL if
1394 the derived type is broken, as indicated by a flavor other than
1395 FL_DERIVED.
1396
1397 2016-09-26 Marek Polacek <polacek@redhat.com>
1398
1399 PR c/7652
1400 * arith.c (eval_intrinsic): Add gcc_fallthrough.
1401 * frontend-passes.c (optimize_op): Likewise.
1402 (gfc_expr_walker): Likewise.
1403 * parse.c (next_fixed): Likewise.
1404 * primary.c (match_variable): Likewise.
1405 * trans-array.c: Likewise.
1406 * trans-expr.c (flatten_array_ctors_without_strlen): Likewise.
1407 * trans-io.c (transfer_expr): Likewise.
1408
1409 2016-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
1410
1411 PR fortran/77429
1412 * dependency.c (gfc_check_dependency): Convert gcc_assert() to
1413 a conditional and possible call to gfc_internal_error().
1414
1415 2016-09-25 Steven G. Kargl <kargl@gcc.gnu.org>
1416
1417 PR fortran/77694
1418 * frontend-passes.c (optimize_binop_array_assignment): Check pointer
1419 for NULL.
1420
1421 2016-09-23 Fritz Reese <fritzoreese@gmail.com>
1422
1423 * lang.opt, invoke.texi, gfortran.texi: New flag -fdec-static.
1424 * options.c (set_dec_flags): Set -fdec-static with -fdec.
1425 * gfortran.h (symbol_attribute): New attribute automatic.
1426 * gfortran.h (gfc_add_automatic): New prototype.
1427 * match.h (gfc_match_automatic, gfc_match_static): New functions.
1428 * decl.c (gfc_match_automatic, gfc_match_static): Ditto.
1429 * symbol.c (gfc_add_automatic): Ditto.
1430 * decl.c (match_attr_spec): Match AUTOMATIC and STATIC decls.
1431 * parse.c (decode_specification_statement, decode_statement): Ditto.
1432 * resolve.c (apply_default_init_local, resolve_fl_variable_derived,
1433 resolve_symbol): Support for automatic attribute.
1434 * symbol.c (check_conflict, gfc_copy_attr, gfc_is_var_automatic):
1435 Ditto.
1436 * trans-decl.c (gfc_finish_var_decl): Ditto.
1437
1438 2016-09-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1439
1440 PR fortran/48298
1441 * gfortran.h (gfc_dt): Add *udtio.
1442 * ioparm.def: Add bit IOPARM_dt_f2003 to align with library use of bit
1443 25. Add IOPARM_dt_dtio bit to common flags.
1444 * resolve.c (resolve_transfer): Set dt->udtio to expression.
1445 * io.c (gfc_match_inquire): Adjust error message for internal
1446 unit KIND.
1447 * libgfortran.h: Adjust defines for GFC_INTERNAL_UNIT4,
1448 GFC_INTERNAL_UNIT, and GFC_INVALID_UNIT.
1449 * trans-io.c (build_dt): Set common_unit to reflect the KIND of
1450 the internal unit. Set mask bit for presence of dt->udtio.
1451
1452 2016-09-22 Andre Vehreschild <vehre@gcc.gnu.org>
1453
1454 * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Use the old caf-
1455 interface where possible.
1456
1457 2016-09-22 Paul Thomas <pault@gcc.gnu.org>
1458
1459 * interface.c (check_dtio_interface1): Introduce errors for
1460 alternate returns and incorrect numbers of arguments.
1461 (gfc_find_specific_dtio_proc): Return cleanly if the derived
1462 type either doesn't exist or has no namespace.
1463
1464 2016-09-21 Louis Krupp <louis.krupp@zoho.com>
1465
1466 PR fortran/66107
1467 * decl.c (add_init_expr_to_sym): Catch variable character length
1468 in parameter array.
1469
1470 2016-09-21 Paul Thomas <pault@gcc.gnu.org>
1471
1472 PR fortran/77657
1473
1474 * interface.c (gfc_find_specific_dtio_proc): Borrow trick from
1475 resolve_typebound_generic_call to find dtio procedures that
1476 over-ride those in the declared type.
1477
1478 2016-09-20 Marek Polacek <polacek@redhat.com>
1479
1480 * trans-intrinsic.c (conv_expr_ref_to_caf_ref): Adjust fall through
1481 comment.
1482
1483 2016-09-19 Andre Vehreschild <vehre@gcc.gnu.org>
1484
1485 PR fortran/71952
1486 * expr.c (gfc_check_assign): Added flag to control whether datatype
1487 conversion is allowed.
1488 * gfortran.h: Added caf-token-tree to gfc_component. Changed
1489 prototypes mostly to add whether datatype conversion is allowed.
1490 * gfortran.texi: Added documentation for the caf_reference_t and the
1491 caf_*_by_ref function.
1492 * primary.c (caf_variable_attr): Similar to gfc_variable_attr but
1493 focused on the needs of coarrays.
1494 (gfc_caf_attr): Same.
1495 * resolve.c (resolve_ordinary_assign): Set the conversion allowed
1496 flag when not in a coarray.
1497 * trans-array.c (gfc_array_init_size): Moved setting of array
1498 descriptor's datatype before the alloc, because caf_register needs it.
1499 (gfc_array_allocate): Changed notion of whether an array is a coarray.
1500 (gfc_array_deallocate): Same.
1501 (gfc_alloc_allocatable_for_assignment): Added setting of coarray's
1502 array descriptor datatype before the register. And using deregister/
1503 register to mimmick a realloc for coarrays.
1504 * trans-decl.c (gfc_build_builtin_function_decls): Corrected signatures
1505 of old caf-functions and added signature definitions of the _by_ref
1506 ones.
1507 (generate_coarray_sym_init): Adapted to new caf_register signature.
1508 * trans-expr.c (gfc_conv_scalar_to_descriptor): Make sure a constant
1509 is translated to an lvalue expression before use in an array
1510 descriptor.
1511 (gfc_get_ultimate_alloc_ptr_comps_caf_token): New function. Get the
1512 last allocatable component's coarray token.
1513 (gfc_get_tree_for_caf_expr): For top-level object get the coarray
1514 token and check for unsupported features.
1515 (gfc_get_caf_token_offset): Getting the offset might procude new
1516 statements, which now are stored in the pre and post of the current se.
1517 (gfc_caf_get_image_index): For this image return a call to
1518 caf_this_image.
1519 (expr_may_alias_variables): Check that the result is set for testing
1520 its properties.
1521 (alloc_scalar_allocatable_for_assignment): Added auto allocation of
1522 coarray components.
1523 (gfc_trans_assignment_1): Rewrite an assign to a coarray object to
1524 be a sendget.
1525 * trans-intrinsic.c (conv_caf_vector_subscript_elem): Corrected
1526 wrong comment.
1527 (compute_component_offset): Compute the correct offset a structure
1528 member.
1529 (conv_expr_ref_to_caf_ref): Convert to a chain of refs into
1530 caf_references.
1531 (gfc_conv_intrinsic_caf_get): Call caf_get_by_ref instead of caf_get.
1532 (conv_caf_send): Call caf_*_by_ref for coarrays that need
1533 reallocation.
1534 (gfc_conv_intrinsic_function): Adapted to new signuature of the caf
1535 drivers.
1536 (conv_intrinsic_atomic_op): Add pre and post statements correctly.
1537 (conv_intrinsic_atomic_ref): Same.
1538 (conv_intrinsic_atomic_cas): Same.
1539 (conv_intrinsic_event_query): Same.
1540 * trans-stmt.c (gfc_trans_lock_unlock): Same.
1541 (gfc_trans_event_post_wait): Same.
1542 (gfc_trans_allocate): Support allocation of allocatable coarrays.
1543 (gfc_trans_deallocate): And there deallocation.
1544 * trans-types.c (gfc_typenode_for_spec): Added flag to control whether
1545 a component is part of coarray. When so, then add space to store a
1546 coarray token.
1547 (gfc_build_array_type): Same.
1548 (gfc_get_array_descriptor_base): Same.
1549 (gfc_get_array_type_bounds): Same.
1550 (gfc_sym_type): Same.
1551 (gfc_get_derived_type): Same.
1552 (gfc_get_caf_reference_type): Declare the caf_reference_type.
1553 * trans-types.h: Prototype changes only.
1554 * trans.c (gfc_allocate_using_lib): Use the updated caf_register
1555 signature.
1556 (gfc_allocate_allocatable): Same.
1557 (gfc_deallocate_with_status): Same.
1558 * trans.h: Defined the runtime types for caf_reference_t and the enums.
1559
1560 2016-09-19 Fritz Reese <fritzoreese@gmail.com>
1561
1562 PR fortran/77584
1563 * decl.c (match_record_decl, gfc_match_decl_type_spec): Fixes to
1564 handling of structure/record from declaration-type-spec.
1565
1566 2016_09_17 Louis Krupp <louis.krupp@zoho.com>
1567
1568 PR fortran/68078
1569 * resolve.c (resolve_allocate_expr): Check that derived type
1570 pointer, object or array has been successfully allocated before
1571 initializing.
1572
1573 2016-09-16 Steven G. Kargl <kargl@gcc.gnu.org>
1574
1575 PR fortran/77612
1576 * decl.c (char_len_param_value): Check parent namespace for
1577 seen_implicit_none.
1578
1579 2016-09-15 Louis Krupp <louis.krupp@zoho.com>
1580
1581 PR fortran/69963
1582 * parse.c (reject_statement): Clear charlen pointers in implicit
1583 character typespecs before those charlen structures are freed.
1584
1585 2016-09-14 Bernd Edlinger <bernd.edlinger@hotmail.de>
1586
1587 * simplify.c (gfc_simplify_repeat): Fix a misplaced closing ')'.
1588
1589 2016-09-13 Steven G. Kargl <kargl@gcc.gnu.org>
1590
1591 PR fortran/77420
1592 * module.c (load_equiv): Revert revision 240063.
1593
1594 2016-09-10 Paul Thomas <pault@gcc.gnu.org>
1595 Steven G. Kargl <kargl@gcc.gnu.org>
1596
1597 PR fortran/77532
1598 * interface.c (check_dtio_arg_TKR_intent): Return after error.
1599 (check_dtio_interface1): Remove asserts, test for NULL and return
1600 if found.
1601
1602 2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
1603
1604 PR fortran/77420
1605 * module.c (load_equiv): If the current namespace has a list of
1606 equivalence statements, initialize duplicate to false and then
1607 look for duplicates; otherwise, initialize it to true.
1608
1609 2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
1610
1611 PR fortran/77506
1612 * array.c (gfc_match_array_constructor): CHARACTER(len=*) cannot
1613 appear in an array constructor.
1614
1615 2016-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
1616
1617 PR fortran/77507
1618 * intrinsic.c (add_functions): Use correct keyword.
1619
1620 2016-09-08 Steven G. Kargl <kargl@gcc.gnu.org>
1621
1622 PR fortran/69514
1623 * array.c (gfc_match_array_constructor): If type-spec is present,
1624 walk the array constructor performing possible conversions for
1625 numeric types.
1626
1627 2016-09-08 Jakub Jelinek <jakub@redhat.com>
1628
1629 PR fortran/77500
1630 * trans-openmp.c (gfc_trans_omp_atomic): For atomic write or
1631 swap, don't try to look through GFC_ISYM_CONVERSION. In other cases,
1632 check that value.function.isym is non-NULL before dereferencing it.
1633
1634 2016-09-04 Steven G. Kargl <kargl@gcc.gnu.org>
1635
1636 PR fortran/77391
1637 * resolve.c (deferred_requirements): New function to check F2008:C402.
1638 (resolve_fl_variable,resolve_fl_parameter): Use it.
1639
1640 2016-09-04 Steven G. Kargl <kargl@gcc.gnu.org>
1641
1642 PR fortran/77460
1643 * simplify.c (simplify_transformation_to_scalar): On error, result
1644 may be NULL, simply return.
1645
1646 2016-08-31 Jakub Jelinek <jakub@redhat.com>
1647
1648 PR fortran/77352
1649 * trans-openmp.c (gfc_trans_omp_parallel_workshare): Always add a
1650 BIND_EXPR with BLOCK around what gfc_trans_omp_workshare returns.
1651
1652 PR fortran/77374
1653 * parse.c (parse_omp_oacc_atomic): Copy over cp->ext.omp_atomic
1654 to cp->block->ext.omp_atomic.
1655 * resolve.c (gfc_resolve_blocks): Assert block with one or two
1656 EXEC_ASSIGNs for EXEC_*_ATOMIC.
1657 * openmp.c (resolve_omp_atomic): Don't assert one or two
1658 EXEC_ASSIGNs, instead return quietly for EXEC_NOPs and otherwise
1659 error unexpected statements.
1660
1661 2016-08-31 Paul Thomas <pault@gcc.gnu.org>
1662 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1663
1664 PR fortran/48298
1665 * decl.c (access_attr_decl): Include case INTERFACE_DTIO as
1666 appropriate.
1667 * gfortran.h : Add INTRINSIC_FORMATTED and
1668 INTRINSIC_UNFORMATTED to gfc_intrinsic_op. Add INTERFACE_DTIO
1669 to interface type. Add new enum 'dtio_codes'. Add bitfield
1670 'has_dtio_procs' to symbol_attr. Add prototypes
1671 'gfc_check_dtio_interfaces' and 'gfc_find_specific_dtio_proc'.
1672 * interface.c (dtio_op): New function.
1673 (gfc_match_generic_spec): Match generic DTIO interfaces.
1674 (gfc_match_interface): Treat DTIO interfaces in the same way as
1675 (gfc_current_interface_head): Add INTERFACE_DTIO appropriately.
1676 (check_dtio_arg_TKR_intent): New function.
1677 (check_dtio_interface1): New function.
1678 (gfc_check_dtio_interfaces): New function.
1679 (gfc_find_specific_dtio_proc): New function.
1680 * io.c : Add FMT_DT to format_token.
1681 (format_lex): Handle DTIO formatting.
1682 * match.c (gfc_op2string): Add DTIO operators.
1683 * resolve.c (derived_inaccessible): Ignore pointer components
1684 to enclosing derived type.
1685 (resolve_transfer): Resolve transfers that involve DTIO.
1686 procedures. Find the specific subroutine for the transfer and
1687 use its existence to over-ride some of the constraints on
1688 derived types. If the transfer is recursive, require that the
1689 subroutine be so qualified.
1690 (dtio_procs_present): New function.
1691 (resolve_fl_namelist): Remove inhibition of polymorphic objects
1692 in namelists if DTIO read and write subroutines exist. Likewise
1693 for derived types.
1694 (resolve_types): Invoke 'gfc_verify_dtio_procedures'.
1695 * symbol.c : Set 'dtio_procs' using 'minit'.
1696 * trans-decl.c (gfc_finish_var_decl): If a derived-type/class
1697 object is associated with DTIO procedures, make it TREE_STATIC.
1698 * trans-expr.c (gfc_get_vptr_from_expr): If the expression
1699 drills down to a PARM_DECL, extract the vptr correctly.
1700 (gfc_conv_derived_to_class): Check 'info' in the test for
1701 'useflags'. If the se expression exists and is a pointer, use
1702 it as the class _data.
1703 * trans-io.c : Add IOCALL_X_DERIVED to iocall and the function
1704 prototype. Likewise for IOCALL_SET_NML_DTIO_VAL.
1705 (set_parameter_tree): Renamed from 'set_parameter_const', now
1706 returns void and has new tree argument. Calls modified to match
1707 new interface.
1708 (transfer_namelist_element): Transfer DTIO procedure pointer
1709 and vpointer using the new function IOCALL_SET_NML_DTIO_VAL.
1710 (get_dtio_proc): New function.
1711 (transfer_expr): Add new argument for the vptr field of class
1712 objects. Add the code to call the specific DTIO proc, convert
1713 derived types to class and call IOCALL_X_DERIVED.
1714 (trans_transfer): Add BT_CLASS to structures for treatment by
1715 the scalarizer. Obtain the vptr for the dynamic type, both for
1716 scalar and array transfer.
1717
1718 2016-08-30 Fritz Reese <fritzoreese@gmail.com>
1719
1720 * gfortran.texi: Fix typo in STRUCTURE documentation.
1721
1722 2016-08-29 Fritz Reese <fritzoreese@gmail.com>
1723
1724 Fix, reorganize, and clarify comparisons of anonymous types/components.
1725
1726 PR fortran/77327
1727 * interface.c (is_anonymous_component, is_anonymous_dt): New functions.
1728 * interface.c (compare_components, gfc_compare_derived_types): Use new
1729 functions.
1730
1731 2016-08-27 Steven G. Kargl <kargl@gcc.gnu.org>
1732
1733 PR fortran/77380
1734 * dependency.c (gfc_check_dependency): Do not assert with
1735 -fcoarray=lib.
1736
1737 2016-08-27 Steven G. Kargl <kargl@gcc.gnu.org>
1738
1739 PR fortran/77372
1740 simplify.c (simplify_ieee_selected_real_kind): Check for NULL pointers.
1741
1742 2016-08-25 Steven g. Kargl <kargl@gcc.gnu.org>
1743
1744 PR fortran/77351
1745 * frontend-passes.c (remove_trim,combine_array_constructor): Check for
1746 NULL pointer.
1747
1748 2016-08-24 Paul Thomas <pault@gcc.gnu.org>
1749
1750 PR fortran/77358
1751 * resolve.c (resolve_fl_procedure): Use the correct gfc_charlen
1752 for deferred character length module procedures.
1753
1754 2016-08-23 Fritz Reese <fritzoreese@gmail.com>
1755
1756 * decl.c (gfc_match_structure_decl): Make gfc_structure_id static.
1757
1758 2016-08-23 Fritz Reese <fritzoreese@gmail.com>
1759
1760 * interface.c (compare_components): Fix typo in name check conditional.
1761
1762 2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
1763 Bud Davis <jmdavis@link.com>
1764
1765 PR fortran/60774
1766 * parse.c (next_free,next_fixed): Issue error for statement label
1767 without a statement.
1768
1769 2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
1770
1771 PR fortran/61318
1772 * interface.c (compare_parameter): Use better locus for error message.
1773
1774 2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
1775
1776 PR fortran/77260
1777 * gcc/fortran/trans-decl.c (generate_local_decl): Suppress warning
1778 for unused variable if symbol is entry point.
1779
1780 2016-08-19 Joseph Myers <joseph@codesourcery.com>
1781
1782 PR c/32187
1783 * trans-types.h (float128_type_node): Rename to
1784 gfc_float128_type_node.
1785 (complex_float128_type_node): Rename to
1786 gfc_complex_float128_type_node.
1787 * iso-c-binding.def, trans-intrinsic.c, trans-types.c: All users
1788 changed.
1789
1790 2016-08-19 Jakub Jelinek <jakub@redhat.com>
1791
1792 PR fortran/71014
1793 * resolve.c (gfc_resolve): For ns->construct_entities don't save, clear
1794 and restore omp state around the resolving.
1795
1796 PR fortran/69281
1797 * trans-openmp.c (gfc_trans_omp_parallel, gfc_trans_omp_task,
1798 gfc_trans_omp_target): Wrap gfc_trans_omp_code result in an extra
1799 BIND_EXPR with its own forced BLOCK.
1800
1801 2016-08-19 Janne Blomqvist <jb@gcc.gnu.org>
1802
1803 * intrinsics.texi (RANDOM_NUMBER): Remove reference to
1804 init_random_seed in example.
1805 (RANDOM_SEED): Remove warning to not set all seed values to 0.
1806
1807 2016-08-18 David Malcolm <dmalcolm@redhat.com>
1808
1809 * error.c (gfc_diagnostic_starter): Update for change to
1810 diagnostic_show_locus.
1811
1812 2016-08-17 Jakub Jelinek <jakub@redhat.com>
1813
1814 PR fortran/67496
1815 * trans-array.c (trans_array_constructor): Load
1816 expr->ts.u.cl->length_from_typespec only if expr->ts.type is
1817 BT_CHARACTER.
1818
1819 2016-08-15 Fritz Reese <fritzoreese@gmail.com>
1820
1821 * lang.opt, invoke.texi: New flag -finit-derived.
1822 * gfortran.h (gfc_build_default_init_expr, gfc_apply_init,
1823 gfc_generate_initializer): New prototypes.
1824 * expr.c (gfc_build_default_init_expr, gfc_apply_init,
1825 component_initializer, gfc_generate_initializer): New functions.
1826 * expr.c (gfc_default_initializer): Wrap gfc_generate_initializer.
1827 * decl.c (build_struct): Move common code to gfc_apply_init.
1828 * resolve.c (can_generate_init): New function.
1829 * resolve.c (build_default_init_expr): Wrap gfc_build_default_init_expr.
1830 * resolve.c (apply_default_init, resolve_fl_variable_derived): Use
1831 gfc_generate_initializer.
1832 * trans-decl.c (gfc_generate_function_code): Use
1833 gfc_generate_initializer.
1834
1835 2016-08-15 Thomas Koenig <tkoenig@gcc.gnu.org>
1836
1837 * frontend-passes.c (create_var): Set ts.deferred for
1838 deferred-length character variables.
1839 * dump-parse-tree.c (show_typespec): Also dump
1840 is_c_interop, is_iso_c and deferred flags.
1841
1842 2016-08-15 Jakub Jelinek <jakub@redhat.com>
1843
1844 PR debug/71906
1845 * trans-decl.c (gfc_get_symbol_decl): Call gfc_finish_var_decl
1846 for decl's character length before gfc_finish_var_decl on the
1847 decl itself.
1848
1849 2016-08-14 Chung-Lin Tang <cltang@codesourcery.com>
1850
1851 PR fortran/70598
1852 * openmp.c (resolve_omp_clauses): Adjust use_device clause
1853 handling to only allow pointers and arrays.
1854
1855 2016-08-12 Marek Polacek <polacek@redhat.com>
1856
1857 PR c/7652
1858 * decl.c (match_attr_spec): Add FALLTHRU.
1859 * primary.c (match_arg_list_function): Likewise.
1860 * resolve.c (resolve_operator): Adjust fall through comment.
1861 (fixup_charlen): Add FALLTHRU.
1862 (resolve_allocate_expr): Adjust fall through comment.
1863 * trans-array.c (gfc_conv_ss_startstride): Add FALLTHRU.
1864 * trans-intrinsic.c (gfc_conv_intrinsic_len): Adjust fall through
1865 comment.
1866
1867 2016-08-11 Janne Blomqvist <jb@gcc.gnu.org>
1868
1869 * check.c (gfc_check_random_seed): Use new seed size in check.
1870 * intrinsic.texi (RANDOM_NUMBER): Updated documentation.
1871 (RANDOM_SEED): Likewise.
1872
1873 2016-08-08 Jakub Jelinek <jakub@redhat.com>
1874
1875 PR fortran/72716
1876 * openmp.c (gfc_match_omp_declare_simd): Don't stick anything into
1877 BLOCK DATA ns, it will be rejected later.
1878
1879 2016-08-08 Andre Vehreschild <vehre@gcc.gnu.org>
1880
1881 PR fortran/71936
1882 * trans-array.c (gfc_array_allocate): When SOURCE= is a function
1883 stick with the ref of the object to allocate.
1884
1885 2016-08-08 Andre Vehreschild <vehre@gcc.gnu.org>
1886
1887 PR fortran/72698
1888 * trans-stmt.c (gfc_trans_allocate): Prevent generating code for
1889 copy of zero sized string and with it an ICE.
1890
1891 2016-08-08 Andre Vehreschild <vehre@gcc.gnu.org>
1892
1893 PR fortran/70524
1894 * trans-array.c (gfc_trans_dummy_array_bias): Ensure that the
1895 location information is correctly set.
1896 * trans-decl.c (gfc_trans_deferred_vars): Set the locus of the
1897 current construct early.
1898
1899 2016-08-03 Fritz Reese <fritzoreese@gmail.com>
1900
1901 * lang.opt: New option -fdec-intrinsic-ints.
1902 * options.c (set_dec_flags): Enable with -fdec.
1903 * gfortran.texi, invoke.texi, intrinsics.texi: Update documentation.
1904 * intrinsic.c (add_function, add_subroutine): New B/I/J/K intrinsic
1905 variants.
1906
1907 2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
1908
1909 PR fortran/41922
1910 * target-memory.c (expr_to_char): Pass in locus and use it in error
1911 messages.
1912 (gfc_merge_initializers): Ditto.
1913 * target-memory.h: Update prototype for gfc_merge_initializers ().
1914 * trans-common.c (get_init_field): Use the correct locus.
1915
1916 2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
1917
1918 PR fortran/68566
1919 * check.c (gfc_check_reshape): Check for constant expression.
1920
1921 2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
1922
1923 PR fortran/69867
1924 * decl.c (build_struct): Ensure that pointers point to something.
1925
1926 2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
1927
1928 PR fortran/69962
1929 * decl.c (gfc_set_constant_character_len): if expr is not
1930 constant issue an error instead of an ICE.
1931
1932 2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
1933
1934 PR fortran/70006
1935 * io.c (gfc_resolve_dt): Use correct locus.
1936 * resolve.c (resolve_branch): Ditto.
1937
1938 2016-07-30 Steven G. Kargl <kargl@gcc.gnu.org>
1939
1940 PR fortran/71730
1941 * decl.c (char_len_param_value): Check return value of
1942 gfc_reduce_init_expr().
1943
1944 2016-07-29 Dominik Vogt <vogt@linux.vnet.ibm.com>
1945
1946 * trans-array.c (gfc_conv_array_ref): Fix allocation of diagnostic
1947 message (was too small).
1948
1949 2016-07-28 Steven G. Kargl <kargl@gcc.gnu.org>
1950
1951 PR fortran/71067
1952 * decl.c (match_data_constant): On error, set 'result' to NULL.
1953
1954 2016-07-28 Steven G. Kargl <kargl@gcc.gnu.org>
1955
1956 PR fortran/71799
1957 * resolve.c(gfc_resolve_iterator): Failure of type conversion need
1958 not ICE.
1959
1960 2016-07-28 Steven G. Kargl <kargl@gcc.gnu.org>
1961
1962 PR fortran/71859
1963 * check.c(numeric_check): Prevent ICE. Issue error for invalid
1964 subroutine as an actual argument when numeric argument is expected.
1965
1966 2016-07-28 Steven G. Kargl <kargl@gcc.gnu.org>
1967 Thomas Koenig <tkoenig@gcc.gnu.org>
1968
1969 PR fortran/71883
1970 * frontend-passes.c (gfc_run_passes): Bail out if there are any
1971 errors.
1972 * error.c (gfc_internal_error): If there are any errors in the
1973 buffer, exit with EXIT_FAILURE.
1974
1975 2016-07-28 Renlin Li <renlin.li@arm.com>
1976
1977 Revert
1978 2016-07-19 Thomas Koenig <tkoenig@gcc.gnu.org>
1979
1980 PR fortran/71902
1981 * dependency.c (gfc_check_dependency): Use dep_ref. Handle case
1982 if identical is true and two array element references differ.
1983 (gfc_dep_resovler): Move most of the code to dep_ref.
1984 (dep_ref): New function.
1985 * frontend-passes.c (realloc_string_callback): Name temporary
1986 variable "realloc_string".
1987
1988 2016-07-26 Steven G. Kargl <kargl@gcc.gnu.org>
1989
1990 PR fortran/71862
1991 * class.c: Remove assert. Iterate over component only if non-null.
1992
1993 2016-07-22 Steven G. Kargl <kargl@gcc.gnu.org>
1994
1995 PR fortran/71935
1996 * check.c (is_c_interoperable): Simplify right expression.
1997
1998 2016-07-22 Thomas Koenig <tkoenig@gcc.gnu.org>
1999
2000 PR fortran/71795
2001 * frontend-passes.c (combine_array_constructor): Don't
2002 do anything if the expression is inside an array iterator.
2003
2004 2016-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
2005
2006 * expr.c (gfc_find_stat_co): Fixed whitespaces.
2007 * gfortran.texi: Fixed typos and reversed meaning of caf_get()'s
2008 src and dst description.
2009 * trans-decl.c (gfc_build_builtin_function_decls): Fixed style
2010 and corrected fnspec for caf functions.
2011 * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Fixed style.
2012 (conv_caf_send): Dito.
2013
2014 2016-07-19 Thomas Koenig <tkoenig@gcc.gnu.org>
2015
2016 PR fortran/71902
2017 * dependency.c (gfc_check_dependency): Use dep_ref. Handle case
2018 if identical is true and two array element references differ.
2019 (gfc_dep_resovler): Move most of the code to dep_ref.
2020 (dep_ref): New function.
2021 * frontend-passes.c (realloc_string_callback): Name temporary
2022 variable "realloc_string".
2023
2024 2016-07-17 Fritz Reese <fritzoreese@gmail.com>
2025
2026 PR fortran/71523
2027 * trans-decl.c (gfc_finish_var_decl): Replace automatic initializer with
2028 a static one.
2029
2030 2016-07-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2031 Marco Restelli <mrestelli@gmail.com>
2032
2033 PR fortran/62125
2034 * symbol.c (select_type_insert_tmp): Recursively call self to take care
2035 of nested select type.
2036
2037 2016-07-15 Cesar Philippidis <cesar@codesourcery.com>
2038
2039 * openmp.c (gfc_match_omp_clauses): Scan for clause vector_length
2040 before vector.
2041
2042 2016-07-15 Andre Vehreschild <vehre@gcc.gnu.org>
2043
2044 PR fortran/71807
2045 * trans-expr.c (gfc_trans_subcomponent_assign): Special casing
2046 when allocatable component is set to null() in initializer.
2047
2048 2016-07-14 Steven G. Kargl <kargl@gcc.gnu.org>
2049
2050 PR fortran/29819
2051 * parse.c (parse_contained): Use proper locus.
2052
2053 2016-07-14 Andre Vehreschild <vehre@gcc.gnu.org>
2054
2055 PR fortran/70842
2056 * simplify.c (gfc_simplify_len): Only for unlimited polymorphic
2057 types replace the expression's _data ref with a _len ref.
2058
2059 2016-07-09 Thomas Koenig <tkoenig@gcc.gnu.org>
2060
2061 PR fortran/71783
2062 * frontend-passes.c (create_var): Always allocate a charlen
2063 for character variables.
2064
2065 2016-07-08 Steven G. Kargl <kargl@gcc.gnu.org>
2066
2067 PR fortran/68426
2068 * simplify (gfc_simplify_spread): Adjust locus.
2069
2070 2016-07-08 Cesar Philippidis <cesar@codesourcery.com>
2071
2072 * parse.c (matcha): Define.
2073 (decode_oacc_directive): Add spec_only local var and set it. Use
2074 matcha to parse acc directives except for routine and declare. Return
2075 ST_GET_FCN_CHARACTERISTICS if a non-declarative directive could be
2076 matched.
2077
2078 2016-07-08 Martin Liska <mliska@suse.cz>
2079
2080 * invoke.texi (Wundefined-do-loop): Enhance documentation.
2081
2082 2016-07-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2083
2084 PR fortran/71764
2085 * trans-expr.c (gfc_trans_structure_assign): Remove assert.
2086
2087 2016-07-07 Martin Liska <mliska@suse.cz>
2088
2089 * lang.opt (Wundefined-do-loop): New option.
2090 * resolve.c (gfc_resolve_iterator): Warn for Wundefined-do-loop.
2091 (gfc_trans_simple_do): Generate a c-style loop.
2092 (gfc_trans_do): Fix GNU coding style.
2093 * invoke.texi: Mention the new warning.
2094
2095 2016-07-07 Martin Liska <mliska@suse.cz>
2096
2097 * trans-stmt.c (gfc_trans_do): Add expect builtin for DO
2098 loops with step bigger than +-1.
2099
2100 2016-07-05 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
2101
2102 * array.c (gfc_match_array_ref): Add parsing support for
2103 STAT= attribute in CAF reference.
2104 * expr.c (gfc_find_stat_co): New function that returns
2105 the STAT= assignment.
2106 * gfortran.h (gfc_array_ref): New member.
2107 * trans-decl.c (gfc_build_builtin_function_decls):
2108 new attribute for caf_get and caf_send functions.
2109 * trans-intrinsic.c (gfc_conv_intrinsic_caf_get): Passing
2110 the stat attribute to external function.
2111 (gfc_conv_intrinsic_caf_send): Ditto.
2112
2113 2016-07-05 Andre Vehreschild <vehre@gcc.gnu.org>
2114
2115 PR fortran/71623
2116 * trans-stmt.c (gfc_trans_allocate): Add code of pre block of typespec
2117 in allocate to parent block.
2118
2119 2016-07-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2120
2121 PR fortran/66575
2122 * decl.c (match_procedure_interface): Exit loop if procedure
2123 interface refers to itself.
2124
2125 2016-07-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2126 Steven G. Kargl <kargl@gcc.gnu.org>
2127
2128 PR fortran/35849
2129 * simplify.c (gfc_simplify_ishftc): Check that absolute value of
2130 SHIFT is less than or equal to SIZE.
2131
2132 2016-07-01 Jakub Jelinek <jakub@redhat.com>
2133
2134 PR fortran/71687
2135 * f95-lang.c (struct binding_level): Add reversed field.
2136 (clear_binding_level): Adjust initializer.
2137 (getdecls): If reversed is clear, set it and nreverse the names
2138 chain before returning it.
2139 (poplevel): Use getdecls.
2140 * trans-decl.c (gfc_generate_function_code, gfc_process_block_locals):
2141 Use nreverse to pushdecl decls in the declaration order.
2142
2143 PR fortran/71717
2144 * trans-openmp.c (gfc_omp_privatize_by_reference): Return false
2145 for GFC_DECL_ASSOCIATE_VAR_P with POINTER_TYPE.
2146
2147 2016-06-30 Jakub Jelinek <jakub@redhat.com>
2148
2149 PR fortran/71704
2150 * parse.c (matchs, matcho): Move right before decode_omp_directive.
2151 If spec_only, only gfc_match the keyword and if successful, goto
2152 do_spec_only.
2153 (matchds, matchdo): Define.
2154 (decode_omp_directive): Add spec_only local var and set it.
2155 Use matchds or matchdo macros instead of matchs or matcho
2156 for declare target, declare simd, declare reduction and threadprivate
2157 directives. Return ST_GET_FCN_CHARACTERISTICS if a non-declarative
2158 directive could be matched.
2159 (next_statement): For ST_GET_FCN_CHARACTERISTICS restore
2160 gfc_current_locus from old_locus even if there is no label.
2161
2162 PR fortran/71705
2163 * trans-openmp.c (gfc_trans_omp_clauses): Set TREE_ADDRESSABLE on
2164 decls in to/from clauses.
2165
2166 2016-06-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2167
2168 PR fortran/71686
2169 * scanner.c (gfc_next_char_literal): Only decrement nextc if it
2170 is not NULL.
2171
2172 2016-06-29 Cesar Philippidis <cesar@codesourcery.com>
2173
2174 * openmp.c (match_oacc_clause_gang): Rename to ...
2175 (match_oacc_clause_gwv): this. Add support for OpenACC worker and
2176 vector clauses.
2177 (gfc_match_omp_clauses): Use match_oacc_clause_gwv for
2178 OMP_CLAUSE_{GANG,WORKER,VECTOR}. Propagate any MATCH_ERRORs for
2179 invalid OMP_CLAUSE_{ASYNC,WAIT,GANG,WORKER,VECTOR} clauses.
2180 (gfc_match_oacc_wait): Propagate MATCH_ERROR for invalid
2181 oacc_expr_lists. Adjust the first and needs_space arguments to
2182 gfc_match_omp_clauses.
2183
2184 2016-06-29 Richard Biener <rguenther@suse.de>
2185
2186 PR middle-end/71002
2187 * f95-lang.c (LANG_HOOKS_GET_ALIAS_SET): Remove (un-)define.
2188 (gfc_get_alias_set): Remove.
2189
2190 2016-06-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2191
2192 PR fortran/71649
2193 * module.c (create_intrinsic_function): Check for NULL values and
2194 return after giving error.
2195
2196 2016-06-21 Michael Meissner <meissner@linux.vnet.ibm.com>
2197
2198 * trans-types.c (gfc_build_complex_type): Move setting complex
2199 MODE to layout_type, instead of setting it ahead of time by the
2200 caller.
2201
2202 2016-06-21 Tobias Burnus <burnus@net-b.de>
2203
2204 PR fortran/71068
2205 * resolve.c (resolve_function): Don't resolve caf_get/caf_send.
2206 (check_data_variable): Strip-off caf_get before checking.
2207
2208 2016-06-20 Tobias Burnus <burnus@net-b.de>
2209
2210 PR fortran/71194
2211 * trans-expr.c (gfc_trans_pointer_assignment): Correctly handle
2212 RHS pointer functions.
2213
2214 2016-06-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2215
2216 * class.c (gfc_add_class_array_ref): Call gfc_add_data_component()
2217 instead of gfc_add_component_ref().
2218 (gfc_get_len_component): Call gfc_add_len_component() instead of
2219 gfc_add_component_ref().
2220 * trans-intrinsic.c (gfc_conv_intrinsic_loc): Call
2221 gfc_add_data_component() instead of gfc_add_component_ref().
2222 * trans.c (gfc_add_finalizer_call): Call
2223 gfc_add_final_component() and gfc_add_size_component() instead
2224 of gfc_add_component_ref.
2225
2226 2016-06-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
2227
2228 * trans-types.c (gfc_typenode_for_spec): Commentary typo fix.
2229
2230 2016-06-17 Cesar Philippidis <cesar@codesourcery.com>
2231
2232 * openmp.c (match_acc): New generic function to parse OpenACC
2233 directives.
2234 (gfc_match_oacc_parallel_loop): Use it.
2235 (gfc_match_oacc_parallel): Likewise.
2236 (gfc_match_oacc_kernels_loop): Likewise.
2237 (gfc_match_oacc_kernels): Likewise.
2238 (gfc_match_oacc_data): Likewise.
2239 (gfc_match_oacc_host_data): Likewise.
2240 (gfc_match_oacc_loop): Likewise.
2241 (gfc_match_oacc_enter_data): Likewise.
2242 (gfc_match_oacc_exit_data): Likewise.
2243
2244 2016-06-16 Martin Liska <mliska@suse.cz>
2245
2246 * trans-stmt.c (gfc_trans_simple_do): Predict the edge.
2247
2248 2016-06-16 Martin Liska <mliska@suse.cz>
2249
2250 * trans-array.c (gfc_array_allocate): Do not generate expect
2251 stmt.
2252 * trans.c (gfc_allocate_using_malloc): Properly set FAIL_ALLOC
2253 predictor for malloc return value.
2254 (gfc_allocate_allocatable): Use REALLOC predictor instead of
2255 FAIL_ALLOC.
2256 (gfc_deallocate_with_status): Likewise.
2257
2258 2016-06-13 Paul Thomas <pault@gcc.gnu.org>
2259
2260 PR fortran/70673
2261 * frontend-passes.c (realloc_string_callback): Add a call to
2262 gfc_dep_compare_expr.
2263
2264 2016-06-11 Dominique d'Humieres <dominiq@lps.ens.fr>
2265
2266 PR fortran/60751
2267 * io.c (gfc_resolve_dt): Replace GFC_STD_GNU with GFC_STD_LEGACY.
2268
2269 2016-06-10 Thomas Schwinge <thomas@codesourcery.com>
2270
2271 PR c/71381
2272 * openmp.c (gfc_match_oacc_cache): Add comment.
2273
2274 2016-06-05 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2275
2276 PR fortran/71404
2277 * io.c (match_io): For READ, commit in pending symbols in the
2278 current statement before trying to match an expression so that
2279 if the match fails and we undo symbols we dont toss good symbols.
2280
2281 2016-06-05 Andre Vehreschild <vehre@gcc.gnu.org>
2282
2283 PR fortran/69659
2284 * trans-array.c (gfc_trans_dummy_array_bias): For class arrays use
2285 the address of the _data component to reference the arrays data
2286 component.
2287
2288 2016-06-03 Chung-Lin Tang <cltang@codesourcery.com>
2289
2290 * trans-openmp.c (gfc_trans_omp_reduction_list): Add mark_addressable
2291 bool parameter, set reduction clause DECLs as addressable when true.
2292 (gfc_trans_omp_clauses): Pass clauses->async to
2293 gfc_trans_omp_reduction_list, add comment describing OpenACC situation.
2294
2295 2016-06-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2296
2297 PR fortran/52393
2298 * io.c (match_io): For READ, try to match a default character
2299 expression. If found, set the dt format expression to this,
2300 otherwise go back and try control list.
2301
2302 2016-06-01 Paul Thomas <pault@gcc.gnu.org>
2303
2304 PR fortran/71156
2305 * decl.c (copy_prefix): Add checks that the module procedure
2306 declaration prefixes are compliant with the interface. Invert
2307 order of existing elemental and pure checks.
2308 * resolve.c (resolve_fl_procedure): Invert order of elemental
2309 and pure errors.
2310
2311 2016-06-01 Jakub Jelinek <jakub@redhat.com>
2312
2313 * parse.c (case_decl): Move ST_OMP_* to ...
2314 (case_omp_decl): ... here, new macro.
2315 (verify_st_order): For case_omp_decl, complain about
2316 p->state >= ORDER_EXEC, but don't change p->state otherwise.
2317
2318 2016-05-26 Jakub Jelinek <jakub@redhat.com>
2319
2320 * openmp.c (resolve_omp_clauses): Warn if chunk_size is known not to
2321 be positive.
2322
2323 2016-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2324
2325 PR fortran/66461
2326 * scanner.c (gfc_next_char_literal): Clear end_flag when adjusting
2327 current locus back to old_locus.
2328
2329 2016-05-20 Jakub Jelinek <jakub@redhat.com>
2330
2331 PR fortran/71204
2332 * frontend-passes.c (realloc_string_callback): Clear inserted_block
2333 and changed_statement before calling create_var.
2334
2335 2016-05-15 Harald Anlauf <anlauf@gmx.de>
2336
2337 PR fortran/69603
2338 * interface.c (compare_parameter): Check for non-NULL pointer.
2339
2340 2016-05-14 Fritz Reese <fritzoreese@gmail.com>
2341
2342 * gfortran.texi: Update example of DEC UNION extension.
2343
2344 2016-05-14 Fritz Reese <fritzoreese@gmail.com>
2345
2346 PR fortran/71047
2347 * expr.c (gfc_default_initializer): Avoid extra component refs in
2348 constructors for derived types and classes.
2349
2350 2016-05-11 Jakub Jelinek <jakub@redhat.com>
2351
2352 PR fortran/70855
2353 * frontend-passes.c (inline_matmul_assign): Disable in !$omp workshare.
2354
2355 2016-05-09 Richard Biener <rguenther@suse.de>
2356
2357 PR fortran/70937
2358 * trans-decl.c: Include gimplify.h for unshare_expr.
2359 (gfc_trans_vla_one_sizepos): Unshare exprs before inserting
2360 them into the IL.
2361
2362 2016-05-07 Fritz Reese <fritzoreese@gmail.com>
2363
2364 PR fortran/56226
2365 * module.c (dt_upper_string): Rename to gfc_dt_upper_string
2366 (dt_lower_string): Likewise.
2367 * gfortran.h: Make new gfc_dt_upper/lower_string global.
2368 * class.c: Use gfc_dt_upper_string.
2369 * decl.c: Likewise.
2370 * symbol.c: Likewise.
2371 * resolve.c (resolve_component): New function.
2372 (resolve_fl_derived0): Move component loop code to resolve_component.
2373 * parse.c (check_component): New function.
2374 (parse_derived): Move loop code to check_component.
2375 * lang.opt, invoke.texi, options.c : New option -fdec-structure.
2376 * libgfortran.h (bt): New basic type BT_UNION.
2377 * gfortran.h (gfc_option): New option -fdec-structure.
2378 (gfc_get_union_type, gfc_compare_union_types): New prototypes.
2379 (gfc_bt_struct, gfc_fl_struct, case_bt_struct, case_fl_struct): New
2380 macros.
2381 (gfc_find_component): Change prototype.
2382 * match.h (gfc_match_member_sep, gfc_match_map, gfc_match_union,
2383 gfc_match_structure_decl): New prototypes.
2384 * parse.h (gfc_comp_struct): New macro.
2385 * symbol.c (gfc_find_component): Search for components in nested unions
2386 * class.c (insert_component_ref, gfc_add_component_ref, add_proc_comp,
2387 copy_vtab_proc_comps): Update calls to gfc_find_component.
2388 * primary.c (gfc_convert_to_structure_constructor): Likewise.
2389 * symbol.c (gfc_add_component): Likewise.
2390 * resolve.c (resolve_typebound_function, resolve_typebound_subroutine,
2391 resolve_typebound_procedure, resolve_component, resolve_fl_derived):
2392 Likewise.
2393 * expr.c (get_union_init, component_init): New functions.
2394 * decl.c (match_clist_expr, match_record_decl, get_struct_decl,
2395 gfc_match_map, gfc_match_union, gfc_match_structure_decl): Likewise.
2396 * interface.c (compare_components, gfc_compare_union_types): Likewise.
2397 * match.c (gfc_match_member_sep): Likewise.
2398 * parse.c (check_component, parse_union, parse_struct_map): Likewise.
2399 * resolve.c (resolve_fl_struct): Likewise.
2400 * symbol.c (find_union_component): Likewise.
2401 * trans-types.c (gfc_get_union_type): Likewise.
2402 * parse.c (parse_derived): Use new functions.
2403 * interface.c (gfc_compare_derived_types, gfc_compare_types): Likewise.
2404 * expr.c (gfc_default_initializer): Likewise.
2405 * gfortran.texi: Support for DEC structures, unions, and maps.
2406 * gfortran.h (gfc_statement, sym_flavor): Likewise.
2407 * check.c (gfc_check_kill_sub): Likewise.
2408 * expr.c (gfc_copy_expr, simplify_const_ref,
2409 gfc_has_default_initializer): Likewise.
2410 * decl.c (build_sym, match_data_constant, add_init_expr_to_sym,
2411 match_pointer_init, build_struct, variable_decl,
2412 gfc_match_decl_type_spec, gfc_mach_data-decl, gfc_match_entry,
2413 gfc_match_end, gfc_match_derived_decl): Likewise.
2414 * interface.c (check_interface0, check_interface1,
2415 gfc_search_interface): Likewise.
2416 * misc.c (gfc_basic_typename, gfc_typename): Likewise.
2417 * module.c (add_true_name, build_tnt, bt_types, mio_typespec,
2418 fix_mio_expr, load_needed, mio_symbol, read_module, write_symbol,
2419 gfc_get_module_backend_decl): Likewise.
2420 * parse.h (gfc_compile_state): Likewise.
2421 * parse.c (decode_specification_statement, decode_statement,
2422 gfc_ascii_statement, verify_st_order, parse_spec): Likewise.
2423 * primary.c (gfc_match_varspec, gfc_match_structure_constructor,
2424 gfc_match_rvalue, match_variable): Likewise.
2425 * resolve.c (find_arglists, resolve_structure_cons,
2426 is_illegal_recursion, resolve_generic_f, get_declared_from_expr,
2427 resolve_typebound_subroutine, resolve_allocate_expr,
2428 nonscalar_typebound_assign, generate_component_assignments,
2429 resolve_fl_variable_derived, check_defined_assignments,
2430 resolve_component, resolve_symbol, resolve_equivalence_derived):
2431 Likewise.
2432 * symbol.c (flavors, check_conflict, gfc_add_flavor, gfc_use_derived,
2433 gfc_restore_last_undo_checkpoint, gfc_type_compatible,
2434 gfc_find_dt_in_generic): Likewise.
2435 * trans-decl.c (gfc_get_module_backend_decl, create_function_arglist,
2436 gfc_create_module_variable, check_constant_initializer): Likewise.
2437 * trans-expr.c (gfc_conv_component_ref, gfc_conv_initializer,
2438 gfc_trans_alloc_subarray_assign, gfc_trans_subcomponent_assign,
2439 gfc_conv_structure, gfc_trans_scalar_assign, copyable_array_p):
2440 Likewise.
2441 * trans-io.c (transfer_namelist_element, transfer_expr,
2442 gfc_trans_transfer): Likewise.
2443 * trans-stmt.c (gfc_trans_deallocate): Likewise.
2444 * trans-types.c (gfc_typenode_for_spec, gfc_copy_dt_decls_ifequal,
2445 gfc_get_derived_type): Likewise.
2446
2447 2016-05-05 Jakub Jelinek <jakub@redhat.com>
2448
2449 * openmp.c (gfc_match_omp_clauses): Restructuralize, so that clause
2450 parsing is done in a big switch based on gfc_peek_ascii_char and
2451 individual clauses under their first letters are sorted too.
2452
2453 2016-05-02 Michael Meissner <meissner@linux.vnet.ibm.com>
2454
2455 * trans-types.c (gfc_build_complex_type):
2456
2457 2016-05-02 Richard Biener <rguenther@suse.de>
2458
2459 * trans-array.c (gfc_trans_create_temp_array): Properly
2460 create a DECL_EXPR for the anonymous VLA array type.
2461
2462 2016-04-29 Cesar Philippidis <cesar@codesourcery.com>
2463
2464 PR middle-end/70626
2465 * trans-openmp.c (gfc_trans_oacc_combined_directive): Duplicate
2466 the reduction clause in both parallel and loop directives.
2467
2468 2016-04-18 Michael Matz <matz@suse.de>
2469
2470 * trans-io.c (gfc_build_io_library_fndecls): Use SET_TYPE_ALIGN.
2471 * trans-common.c (build_common_decl): Use SET_DECL_ALIGN.
2472 * trans-types.c (gfc_add_field_to_struct): Use SET_DECL_ALIGN.
2473
2474 2016-04-13 Dominique d'Humieres <dominiq@lps.ens.fr>
2475
2476 PR fortran/67039
2477 * intrinsic.texi: Correct the documentation of pseudorandom
2478 number intrinsics.
2479
2480 2016-04-13 Dominique d'Humieres <dominiq@lps.ens.fr>
2481
2482 PR fortran/58000
2483 * gfortran.texi: Document OPEN( ... NAME=) as not implemented
2484 in GNU Fortran
2485
2486 2016-04-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2487
2488 PR fortran/68566
2489 * array.c (match_array_element_spec): Add check for non-integer.
2490 * simplify.c (gfc_simplify_reshape): If source shape is NULL return.
2491
2492 2016-04-06 Patrick Palka <ppalka@gcc.gnu.org>
2493
2494 PR c/70436
2495 * openmp.c (gfc_find_omp_udr): Add explicit braces to resolve a
2496 future -Wparentheses warning.
2497
2498 2016-04-04 Andre Vehreschild <vehre@gcc.gnu.org>
2499
2500 PR fortran/67538
2501 * resolve.c (resolve_allocate_expr): Emit error message when no
2502 array spec and no array valued source= expression is given in an
2503 F2008 allocate() for an array to allocate.
2504
2505 2016-04-04 Andre Vehreschild <vehre@gcc.gnu.org>
2506
2507 PR fortran/65795
2508 * trans-array.c (gfc_array_allocate): When the array is a coarray,
2509 do not nullyfing its allocatable components in array_allocate, because
2510 the nullify missed the array ref and nullifies the wrong component.
2511 Cosmetics.
2512
2513 2016-03-29 Andre Vehreschild <vehre@gcc.gnu.org>
2514
2515 PR fortran/70397
2516 * trans-expr.c (gfc_class_len_or_zero_get): Add function to return a
2517 constant zero tree, when the class to get the _len component from is
2518 not unlimited polymorphic.
2519 (gfc_copy_class_to_class): Use the new function.
2520 * trans.h: Added interface of new function gfc_class_len_or_zero_get.
2521
2522 2016-03-28 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
2523
2524 * trans-decl.c (gfc_build_builtin_function_decls):
2525 caf_stop_numeric and caf_stop_str definition.
2526 * trans-stmt.c (gfc_trans_stop): invoke external functions
2527 for stop and stop_str when coarrays are used.
2528 * trans.h: extern for new functions.
2529
2530 2016-03-19 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2531
2532 PR fortran/69043
2533 * scanner.c (load_file): Update to use S_ISREG macro.
2534
2535 2016-03-17 Thomas Schwinge <thomas@codesourcery.com>
2536
2537 * gfortran.h (enum gfc_omp_map_op): Rename OMP_MAP_FORCE_DEALLOC
2538 to OMP_MAP_DELETE. Adjust all users.
2539
2540 2016-03-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2541 Jim MacArthur <jim.macarthur@codethink.co.uk>
2542
2543 PR fortran/69043
2544 * scanner.c (load_file): Check that included file is regular.
2545
2546 2016-03-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2547 Harold Anlauf <anlauf@gmx.de>
2548
2549 PR fortran/69520
2550 * invoke.texi: Explain use of the 'no-' construct within the
2551 -fcheck= option.
2552 * options.c (gfc_handle_runtime_check_option): Enable use of
2553 'no-' prefix for the various options with -fcheck= to allow
2554 negating previously enabled check options.
2555
2556 2016-03-12 Paul Thomas <pault@gcc.gnu.org>
2557
2558 PR fortran/70031
2559 * decl.c (gfc_match_prefix): Treat the 'module' prefix in the
2560 same way as the others, rather than fixing it to come last.
2561 (gfc_match_function_decl, gfc_match_subroutine): After errors
2562 in 'copy_prefix', emit them immediately in the case of module
2563 procedures to prevent a later ICE.
2564
2565 PR fortran/69524
2566 * decl.c (gfc_match_submod_proc): Permit 'module procedure'
2567 declarations within the contains section of modules as well as
2568 submodules.
2569 * resolve.c (resolve_fl_procedure): Likewise.
2570 *trans-decl.c (build_function_decl): Change the gcc_assert to
2571 allow all forms of module procedure declarations within module
2572 contains sections.
2573
2574 2016-02-28 Thomas Koenig <tkoenig@gcc.gnu.org>
2575
2576 PR fortran/68147
2577 PR fortran/47674
2578 * frontend-passes.c (realloc_string_callback): Don't set
2579 walk_subtrees.
2580
2581 2016-02-28 Thomas Koenig <tkoenig@gcc.gnu.org>
2582
2583 * dump-parse-tree.c (show_code_node): Print association
2584 list of a block if present. Handle EXEC_END_BLOCK.
2585
2586 2016-02-28 Harald Anlauf <anlauf@gmx.de>
2587 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2588
2589 PR fortran/56007
2590 * match.c (gfc_match_iterator): Add diagnostic for array variable
2591 as do loop index.
2592
2593 2016-02-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2594 Steven G. Kargl <kargl@gcc.gnu.org>
2595
2596 PR fortran/69910
2597 * io.c (gfc_match_open): Check that open status is an expression
2598 constant before comparing string to 'scratch' with NEWUNIT.
2599
2600 2016-02-27 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
2601
2602 * trans.c (gfc_allocate_allocatable): size conversion
2603 from byte to number of elements for event variables.
2604 * trans-types.c (gfc_get_derived_type): event variables
2605 represented as a pointer (like lock variable).
2606
2607 2016-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2608
2609 PR fortran/61156
2610 * scanner.c (add_path_to_list): If include path is not a directory,
2611 issue a fatal error.
2612
2613 2016-02-23 Andre Vehreschild <vehre@gcc.gnu.org>
2614
2615 PR fortran/67451
2616 * trans-array.c (gfc_array_allocate): Take the attributes from the
2617 expression to allocate and not from the source=-expression.
2618
2619 2016-02-20 Paul Thomas <pault@gcc.gnu.org>
2620
2621 PR fortran/69423
2622 * trans-decl.c (create_function_arglist): Deferred character
2623 length functions, with and without declared results, address
2624 the passed reference type as '.result' and the local string
2625 length as '..result'.
2626 (gfc_null_and_pass_deferred_len): Helper function to null and
2627 return deferred string lengths, as needed.
2628 (gfc_trans_deferred_vars): Call it, thereby reducing repeated
2629 code, add call for deferred arrays and reroute pointer function
2630 results. Avoid using 'tmp' for anything other that a temporary
2631 tree by introducing 'type_of_array' for the arrayspec type.
2632
2633 2015-02-16 Thomas Koenig <tkoenig@gcc.gnu.org>
2634
2635 PR fortran/69742
2636 * frontend-passes.c (cfe-expr_0): Don't register functions
2637 from within an ASSOCIATE statement.
2638
2639 2016-02-14 Thomas Koenig <tkoenig@gcc.gnu.org>
2640
2641 PR fortran/60526
2642 * decl.c (build_sym): If the name has already been defined as a
2643 type, it has a symtree with an upper case letter at the beginning.
2644 If such a symtree exists, issue an error and exit. Don't do
2645 this if there is no corresponding upper case letter.
2646
2647 2016-02-14 Thomas Koenig <tkoenig@gcc.gnu.org>
2648
2649 PR fortran/60526
2650 PR bootstrap/69816
2651 * decl.c (build_sym): Reverted previous patch.
2652
2653 2016-02-14 Thomas Koenig <tkoenig@gcc.gnu.org>
2654
2655 PR fortran/60526
2656 * decl.c (build_sym): If the name has already been defined as a
2657 type, issue error and return false.
2658
2659 2016-02-12 David Malcolm <dmalcolm@redhat.com>
2660
2661 PR other/69554
2662 * error.c (gfc_diagnostic_start_span): New function.
2663 (gfc_diagnostics_init): Initialize global_dc's start_span.
2664
2665 2016-02-11 Andre Vehreschild <vehre@gcc.gnu.org>
2666
2667 PR fortran/69296
2668 * gfortran.h: Added flag to gfc_association_list indicating that
2669 the rank of an associate variable has been guessed only.
2670 * parse.c (parse_associate): Set the guess flag mentioned above
2671 when guessing the rank of an expression.
2672 * resolve.c (resolve_assoc_var): When the rank has been guessed,
2673 make sure, that the guess was correct else overwrite with the actual
2674 rank.
2675 * trans-stmt.c (trans_associate_var): For subref_array_pointers in
2676 class objects, take the span from the _data component.
2677
2678 2016-02-07 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2679
2680 PR fortran/50555
2681 * primary.c (match_actual_arg): If symbol has attribute flavor of
2682 namelist, generate an error. (gfc_match_rvalue): Likewise return
2683 MATCH_ERROR.
2684 * resolve.c (resolve_symbol): Scan arument list of procedures and
2685 generate an error if a namelist is found.
2686
2687 2016-02-05 Mikael Morin <mikael@gcc.gnu.org>
2688
2689 PR fortran/66089
2690 * trans-expr.c (expr_is_variable, gfc_expr_is_variable): Rename
2691 the former to the latter and make it non-static. Update callers.
2692 * gfortran.h (gfc_expr_is_variable): New declaration.
2693 (struct gfc_ss_info): Add field needs_temporary.
2694 * trans-array.c (gfc_scalar_elemental_arg_saved_as_argument):
2695 Tighten the condition on aggregate expressions with a check
2696 that the expression is a variable and doesn't need a temporary.
2697 (gfc_conv_resolve_dependency): Add intermediary reference variable.
2698 Set the needs_temporary field.
2699
2700 2016-02-03 Andre Vehreschild <vehre@gcc.gnu.org>
2701
2702 PR fortran/67451
2703 PR fortran/69418
2704 * trans-expr.c (gfc_copy_class_to_class): For coarrays just the
2705 pointer is passed. Take it as is without trying to deref the
2706 _data component.
2707 * trans-stmt.c (gfc_trans_allocate): Take care of coarrays as
2708 argument to source=-expression.
2709
2710 2016-02-02 Nathan Sidwell <nathan@codesourcery.com>
2711
2712 * lang.opt (fopenacc-dim=): New option.
2713
2714 2016-01-31 Paul Thomas <pault@gcc.gnu.org>
2715
2716 PR fortran/67564
2717 * trans-expr.c (gfc_conv_procedure_call): For the vtable copy
2718 subroutines, add a string length argument, when the actual
2719 argument is an unlimited polymorphic class object.
2720
2721 2016-01-30 Paul Thomas <pault@gcc.gnu.org>
2722
2723 PR fortran/69566
2724 * trans-expr.c (gfc_conv_procedure_call): Correct expression
2725 for 'ulim_copy', which was missing a test for 'comp'.
2726
2727 2016-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
2728
2729 PR fortran/62536
2730 * decl.c (gfc_match_end): Only unnest and remove BLOCK namespaces
2731 when the END encountered does not match a BLOCK's end.
2732
2733 2016-01-27 Janus Weil <janus@gcc.gnu.org>
2734
2735 PR fortran/69484
2736 * invoke.texi: Fix documentation of -Wall with respect to -Wtabs.
2737
2738 2016-01-27 Paul Thomas <pault@gcc.gnu.org>
2739
2740 PR fortran/69422
2741 * trans-expr.c (is_scalar_reallocatable_lhs): Remove the check
2742 for allocatable components, whilst checking if the symbol is a
2743 derived or class entity..
2744
2745 2016-01-26 Paul Thomas <pault@gcc.gnu.org>
2746
2747 PR fortran/69385
2748 * trans-expr.c (gfc_trans_assignment_1): Exclude initialization
2749 assignments from check on assignment of scalars to unassigned
2750 arrays and correct wrong code within the corresponding block.
2751
2752 2016-01-26 David Malcolm <dmalcolm@redhat.com>
2753
2754 PR other/69006
2755 * error.c (gfc_diagnostic_starter): Delete use of pp_newline.
2756
2757 2016-01-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2758
2759 PR fortran/69397
2760 PR fortran/68442
2761 * interface.c (gfc_arglist_matches_symbol): Replace assert with
2762 a return false if not a procedure.
2763 * resolve.c (resolve_generic_f): Test if we are resolving an
2764 initialization expression and adjust error message accordingly.
2765
2766 2016-01-24 Thomas Koenig <tkoenig@gcc.gnu.org>
2767
2768 PR fortran/66094
2769 * frontend-passes.c (matmul_lhs_realloc): Add
2770 forgotten break statement.
2771
2772 2016-01-24 Dominique d'Humieres <dominiq@lps.ens.fr>
2773
2774 PR fortran/68283
2775 * primary.c (gfc_variable_attr): revert revision r221955,
2776 call gfc_internal_error only if there is no error.
2777
2778 2016-01-24 Thomas Koenig <tkoenig@gcc.gnu.org>
2779
2780 PR fortran/66094
2781 * frontend-passes.c (enum matrix_case): Add case A2B2T for
2782 MATMUL(A,TRANSPoSE(B)) where A and B are rank 2.
2783 (inline_limit_check): Also add A2B2T.
2784 (matmul_lhs_realloc): Handle A2B2T.
2785 (check_conjg_variable): Rename to
2786 (check_conjg_transpose_variable): and also count TRANSPOSE.
2787 (inline_matmul_assign): Handle A2B2T.
2788
2789 2016-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2790
2791 PR fortran/65996
2792 * error.c (gfc_error): Save the state of abort_on_error and set
2793 it to false for buffered errors to allow normal processing.
2794 Restore the state before leaving.
2795
2796 2016-01-19 Martin Jambor <mjambor@suse.cz>
2797
2798 * types.def (BT_FN_VOID_UINT_PTR_INT_PTR): New.
2799 (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_INT_INT): Removed.
2800 (BT_FN_VOID_INT_OMPFN_SIZE_PTR_PTR_PTR_UINT_PTR_PTR): New.
2801
2802 2016-01-15 Paul Thomas <pault@gcc.gnu.org>
2803
2804 PR fortran/64324
2805 * resolve.c (check_uop_procedure): Prevent deferred length
2806 characters from being trapped by assumed length error.
2807
2808 PR fortran/49630
2809 PR fortran/54070
2810 PR fortran/60593
2811 PR fortran/60795
2812 PR fortran/61147
2813 PR fortran/64324
2814 * trans-array.c (gfc_conv_scalarized_array_ref): Pass decl for
2815 function as well as variable expressions.
2816 (gfc_array_init_size): Add 'expr' as an argument. Use this to
2817 correctly set the descriptor dtype for deferred characters.
2818 (gfc_array_allocate): Add 'expr' to the call to
2819 'gfc_array_init_size'.
2820 * trans.c (gfc_build_array_ref): Expand logic for setting span
2821 to include indirect references to character lengths.
2822 * trans-decl.c (gfc_get_symbol_decl): Ensure that deferred
2823 result char lengths that are PARM_DECLs are indirectly
2824 referenced both for directly passed and by reference.
2825 (create_function_arglist): If the length type is a pointer type
2826 then store the length as the 'passed_length' and make the char
2827 length an indirect reference to it.
2828 (gfc_trans_deferred_vars): If a character length has escaped
2829 being set as an indirect reference, return it via the 'passed
2830 length'.
2831 * trans-expr.c (gfc_conv_procedure_call): The length of
2832 deferred character length results is set TREE_STATIC and set to
2833 zero.
2834 (gfc_trans_assignment_1): Do not fix the rse string_length if
2835 it is a variable, a parameter or an indirect reference. Add the
2836 code to trap assignment of scalars to unallocated arrays.
2837 * trans-stmt.c (gfc_trans_allocate): Remove 'def_str_len' and
2838 all references to it. Instead, replicate the code to obtain a
2839 explicitly defined string length and provide a value before
2840 array allocation so that the dtype is correctly set.
2841 trans-types.c (gfc_get_character_type): If the character length
2842 is a pointer, use the indirect reference.
2843
2844 2016-01-10 Thomas Koenig <tkoenig@gcc.gnu.org>
2845
2846 PR fortran/69154
2847 * frontend-passes.c (in_where): New variable.
2848 (inline_matmul_assign): Don't try this if we are within
2849 a WHERE statement.
2850 (gfc_code_walker): Keep track of in_where.
2851
2852 2016-01-10 Paul Thomas <pault@gcc.gnu.org>
2853
2854 PR fortran/67779
2855 * trans_array.c (gfc_conv_scalarized_array_ref): Add missing
2856 se->use_offset from condition for calculation of 'base'.
2857
2858 2016-01-08 Jakub Jelinek <jakub@redhat.com>
2859
2860 PR fortran/69128
2861 * trans.h (OMPWS_SCALARIZER_BODY): Define.
2862 (OMPWS_NOWAIT): Renumber.
2863 * trans-stmt.c (gfc_trans_where_3): Only set OMPWS_SCALARIZER_WS
2864 if OMPWS_SCALARIZER_BODY is not set already, and set also
2865 OMPWS_SCALARIZER_BODY until the final loop creation.
2866 * trans-expr.c (gfc_trans_assignment_1): Likewise.
2867 * trans-openmp.c (gfc_trans_omp_workshare): Also clear
2868 OMPWS_SCALARIZER_BODY.
2869 * trans-array.c (gfc_trans_scalarized_loop_end): Don't create
2870 OMP_FOR if OMPWS_SCALARIZER_BODY is set.
2871
2872 2016-01-04 Jakub Jelinek <jakub@redhat.com>
2873
2874 Update copyright years.
2875
2876 * gfortranspec.c (lang_specific_driver): Update copyright notice
2877 dates.
2878 * gfc-internals.texi: Bump @copying's copyright year.
2879 * gfortran.texi: Ditto.
2880 * intrinsic.texi: Ditto.
2881 * invoke.texi: Ditto.
2882
2883 2016-01-01 Paul Thomas <pault@gcc.gnu.org>
2884
2885 PR fortran/68864
2886 * trans-array.c (evaluate_bound): If deferred, test that 'desc'
2887 is an array descriptor before using gfc_conv_descriptor_xxx.
2888 \f
2889 Copyright (C) 2016 Free Software Foundation, Inc.
2890
2891 Copying and distribution of this file, with or without modification,
2892 are permitted in any medium without royalty provided the copyright
2893 notice and this notice are preserved.