re PR c/79153 (-Wimplicit-fallthrough missed warning)
[gcc.git] / gcc / fortran / ChangeLog
1 2017-12-01 Jakub Jelinek <jakub@redhat.com>
2
3 PR c/79153
4 * match.c (gfc_match): Add FALLTHRU comment to avoid
5 -Wimplicit-fallthrough warning.
6
7 2017-12-01 Thomas Koenig <tkoenig@gcc.gnu.org>
8
9 PR fortran/83224
10 * frontend-passes.c (realloc_string_callback): Handle
11 case for which the RHS is an array expression.
12
13 2017-11-28 Janne Blomqvist <jb@gcc.gnu.org>
14
15 PR fortran/53796
16 * gfortran.texi: Remove mentions of GFORTRAN_DEFAULT_RECL.
17
18 2017-11-28 Paul Thomas <pault@gcc.gnu.org>
19
20 PR fortran/83021
21 * resolve.c (resolve_component): Only escape for use assciated
22 vtypes if the current namespace has no proc_name and is most
23 particularly block data.
24
25 2017-11-28 Jakub Jelinek <jakub@redhat.com>
26
27 * trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR
28 using fold_build2_loc instead of fold_build3_loc.
29 * trans-io.c (io_result): Likewise.
30 * trans-stmt.c (gfc_trans_integer_select, gfc_trans_character_select):
31 Likewise.
32
33 2017-11-24 Jakub Jelinek <jakub@redhat.com>
34
35 PR fortran/81304
36 * trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Set
37 attr.implicit_type in intrinsic_sym to avoid undesirable warning.
38
39 2017-11-23 Dirk Broemmel <d.broemmel@fz-juelich.de>
40 Jakub Jelinek <jakub@redhat.com>
41
42 PR fortran/81841
43 * parse.c (parse_spec): Allow ST_OMP_THREADPRIVATE inside of
44 BLOCK DATA.
45
46 2017-11-23 Mike Stump <mikestump@comcast.net>
47 Eric Botcazou <ebotcazou@adacore.com>
48
49 * trans-stmt.c (gfc_trans_forall_loop): Pass 3rd operand to
50 ANNOTATE_EXPR.
51
52 2017-11-23 Paul Thomas <pault@gcc.gnu.org>
53
54 PR fortran/82814
55 * trans-types.c (gfc_sym_type): If a character function result
56 is missing the charlen backend_decl, use the one from the name-
57 space procedure symbol, if present.
58
59 2017-11-22 David Malcolm <dmalcolm@redhat.com>
60
61 PR c++/62170
62 * error.c (gfc_notify_std): Convert "quoted" param from bool to
63 bool *.
64
65 2017-11-22 Thomas Koenig <tkoenig@gcc.gnu.org>
66
67 PR fortran/36313
68 * check.c (int_or_real_or_char_check_f2003): New function.
69 * iresolve.c (gfc_resolve_maxloc): Add number "2" for
70 character arguments and rank-zero return value.
71 (gfc_resolve_minloc): Likewise.
72 * trans-intrinsic.c (gfc_conv_intrinsic_minmaxloc): Handle case of
73 character arguments and rank-zero return value by removing
74 unneeded arguments and calling the library function.
75
76 2017-11-22 Paul Thomas <pault@gcc.gnu.org>
77
78 PR fortran/79072
79 * trans-stmt.c (trans_associate_var): Weaken the over strong
80 condition for using the fake result decl.
81
82 2017-11-20 Paul Thomas <pault@gcc.gnu.org>
83
84 PR fortran/79072
85 * trans-expr.c (trans_class_vptr_len_assignment): Set from_len
86 if the temporary is unlimited polymorphic.
87 * trans-stmt.c (trans_associate_var): Use the fake result decl
88 to obtain the 'len' field from an explicit function result when
89 in that function scope.
90
91 2017-11-19 Paul Thomas <pault@gcc.gnu.org>
92
93 PR fortran/78990
94 * expr.c (gfc_is_class_array_function): Renamed from
95 'gfc_is_alloc_class_array_function' and modified to return true
96 for pointers as well as allocatable results.
97 * gfortran.h : Change of name for prototype of above function.
98 * trans-array.c (gfc_add_loop_ss_code): Force finalization of
99 class array results.
100 (build_class_array_ref): Change assertion into a condition.
101 (build_class_array_ref): Set the se class_vptr for class array
102 function results.
103 (gfc_walk_function_expr): Reference gfc_is_class_array_function
104 as above.
105 * trans-decl.c (get_proc_result): Move it up before
106 gfc_trans_deferred_vars.
107 (gfc_trans_deferred_vars): Nullify explicit return class arrays
108 on entry.
109 * trans-expr.c (gfc_conv_class_to_class): Allow conversion of
110 class array functions that have an se class_vptr and use it
111 for the result vptr.
112 (gfc_conv_subref_array_arg): Rename reference to the above
113 function.
114 (gfc_conv_procedure_call): Ditto. Add the se pre block to the
115 loop pre block before the function is evaluated. Do not
116 finalize class pointer results.
117 (arrayfunc_assign_needs_temporary, gfc_trans_assignment_1) More
118 renamed references.
119 * trans-intrinsic.c (gfc_conv_intrinsic_size): Ditto.
120
121 2017-11-18 Janne Blomqvist <jb@gcc.gnu.org>
122
123 PR fortran/83036
124 * ioparm.def (IOPARM): Make nextrec a pintio.
125
126 2017-11-18 Janne Blomqvist <jb@gcc.gnu.org>
127
128 PR fortran/44292
129 * ioparm.def (IOPARM): Make recl_in intio, and recl_out pintio.
130
131 2017-11-18 Thomas Koenig <tkoenig@gcc.gnu.org>
132
133 PR fortran/83012
134 * expr.c (gfc_is_simply_contiguous): If a function call through a
135 class variable is done through a reference, check the function's
136 interface.
137
138 2017-11-17 Richard Biener <rguenther@suse.de>
139
140 PR fortran/83017
141 * trans-stmt.c (gfc_trans_forall_loop): Annotate DO CONCURRENT
142 loops with annot_expr_parallel_kind instead of just
143 annot_expr_ivdep_kind.
144
145 2017-11-15 Martin Liska <mliska@suse.cz>
146
147 * options.c (gfc_post_options):
148 Do not set default value of warn_return_type.
149 * trans-decl.c (gfc_trans_deferred_vars):
150 Compare warn_return_type for greater than zero.
151 (generate_local_decl): Likewise
152 (gfc_generate_function_code): Likewise.
153
154 2017-11-13 Fritz Reese <fritzoreese@gmail.com>
155
156 PR fortran/78240
157 * decl.c (match_clist_expr): Replace gcc_assert with proper
158 handling of bad result from spec_size().
159 * resolve.c (check_data_variable): Avoid NULL dereference when passing
160 locus to gfc_error.
161
162 2017-11-11 Janus Weil <janus@gcc.gnu.org>
163
164 PR fortran/82932
165 * resolve.c (update_compcall_arglist): Improve error recovery,
166 remove a gcc_assert.
167
168 2017-11-10 Fritz Reese <fritzoreese@gmail.com>
169
170 PR fortran/82886
171 * gfortran.h (gfc_build_init_expr): New prototype.
172 * invoke.texi (finit-derived): Update documentation.
173 * expr.c (gfc_build_init_expr): New, from gfc_build_default_init_expr.
174 (gfc_build_default_init_expr): Redirect to gfc_build_init_expr(,,false)
175 (component_initializer): Force building initializers using
176 gfc_build_init_expr(,,true).
177
178 2017-11-10 Martin Sebor <msebor@redhat.com>
179
180 PR c/81117
181 * gcc/fortran/decl.c (build_sym): Use strcpy instead of strncpy.
182
183 2017-11-10 Paul Thomas <pault@gcc.gnu.org>
184
185 PR fortran/82934
186 * trans-stmt.c (gfc_trans_allocate): Remove the gcc_assert on
187 null string length for assumed length typespec and set
188 expr3_esize to NULL_TREE;
189
190 2017-11-09 Paul Thomas <pault@gcc.gnu.org>
191
192 PR fortran/78619
193 * check.c (same_type_check): Introduce a new argument 'assoc'
194 with default value false. If this is true, use the symbol type
195 spec of BT_PROCEDURE expressions.
196 (gfc_check_associated): Set 'assoc' true in the call to
197 'same_type_check'.
198
199 2017-11-09 Steven G. Kargl <kargl@gcc.gnu.org>
200
201 PR fortran/78814
202 * interface.c (symbol_rank): Check for NULL pointer.
203
204 2017-11-08 Steven G. Kargl <kargl@kgcc.gnu.org>
205
206 PR Fortran/82841
207 * simplify.c(gfc_simplify_transfer): Do not dereference a NULL pointer.
208 Unwrap a short line.
209
210 2017-11-08 Steven G. Kargl <kargl@gcc.gnu.org>
211
212 PR fortran/82884
213 * arith.c (gfc_hollerith2character): Clear pad.
214
215 2017-11-08 Janne Blomqvist <jb@gcc.gnu.org>
216
217 PR 82869
218 * convert.c (truthvalue_conversion): Use logical_type_node.
219 * trans-array.c (gfc_trans_allocate_array_storage): Likewise.
220 (gfc_trans_create_temp_array): Likewise.
221 (gfc_trans_array_ctor_element): Likewise.
222 (gfc_trans_array_constructor_value): Likewise.
223 (trans_array_constructor): Likewise.
224 (trans_array_bound_check): Likewise.
225 (gfc_conv_array_ref): Likewise.
226 (gfc_trans_scalarized_loop_end): Likewise.
227 (gfc_conv_array_extent_dim): Likewise.
228 (gfc_array_init_size): Likewise.
229 (gfc_array_allocate): Likewise.
230 (gfc_trans_array_bounds): Likewise.
231 (gfc_trans_dummy_array_bias): Likewise.
232 (gfc_conv_array_parameter): Likewise.
233 (duplicate_allocatable): Likewise.
234 (duplicate_allocatable_coarray): Likewise.
235 (structure_alloc_comps): Likewise
236 (get_std_lbound): Likewise
237 (gfc_alloc_allocatable_for_assignment): Likewise
238 * trans-decl.c (add_argument_checking): Likewise
239 (gfc_generate_function_code): Likewise
240 * trans-expr.c (gfc_copy_class_to_class): Likewise
241 (gfc_trans_class_array_init_assign): Likewise
242 (gfc_trans_class_init_assign): Likewise
243 (gfc_conv_expr_present): Likewise
244 (gfc_conv_substring): Likewise
245 (gfc_conv_cst_int_power): Likewise
246 (gfc_conv_expr_op): Likewise
247 (gfc_conv_procedure_call): Likewise
248 (fill_with_spaces): Likewise
249 (gfc_trans_string_copy): Likewise
250 (gfc_trans_alloc_subarray_assign): Likewise
251 (gfc_trans_pointer_assignment): Likewise
252 (gfc_trans_scalar_assign): Likewise
253 (fcncall_realloc_result): Likewise
254 (alloc_scalar_allocatable_for_assignment): Likewise
255 (trans_class_assignment): Likewise
256 (gfc_trans_assignment_1): Likewise
257 * trans-intrinsic.c (build_fixbound_expr): Likewise
258 (gfc_conv_intrinsic_aint): Likewise
259 (gfc_trans_same_strlen_check): Likewise
260 (conv_caf_send): Likewise
261 (trans_this_image): Likewise
262 (conv_intrinsic_image_status): Likewise
263 (trans_image_index): Likewise
264 (gfc_conv_intrinsic_bound): Likewise
265 (conv_intrinsic_cobound): Likewise
266 (gfc_conv_intrinsic_mod): Likewise
267 (gfc_conv_intrinsic_dshift): Likewise
268 (gfc_conv_intrinsic_dim): Likewise
269 (gfc_conv_intrinsic_sign): Likewise
270 (gfc_conv_intrinsic_ctime): Likewise
271 (gfc_conv_intrinsic_fdate): Likewise
272 (gfc_conv_intrinsic_ttynam): Likewise
273 (gfc_conv_intrinsic_minmax): Likewise
274 (gfc_conv_intrinsic_minmax_char): Likewise
275 (gfc_conv_intrinsic_anyall): Likewise
276 (gfc_conv_intrinsic_arith): Likewise
277 (gfc_conv_intrinsic_minmaxloc): Likewise
278 (gfc_conv_intrinsic_minmaxval): Likewise
279 (gfc_conv_intrinsic_btest): Likewise
280 (gfc_conv_intrinsic_bitcomp): Likewise
281 (gfc_conv_intrinsic_shift): Likewise
282 (gfc_conv_intrinsic_ishft): Likewise
283 (gfc_conv_intrinsic_ishftc): Likewise
284 (gfc_conv_intrinsic_leadz): Likewise
285 (gfc_conv_intrinsic_trailz): Likewise
286 (gfc_conv_intrinsic_mask): Likewise
287 (gfc_conv_intrinsic_spacing): Likewise
288 (gfc_conv_intrinsic_rrspacing): Likewise
289 (gfc_conv_intrinsic_size): Likewise
290 (gfc_conv_intrinsic_sizeof): Likewise
291 (gfc_conv_intrinsic_transfer): Likewise
292 (gfc_conv_allocated): Likewise
293 (gfc_conv_associated): Likewise
294 (gfc_conv_same_type_as): Likewise
295 (gfc_conv_intrinsic_trim): Likewise
296 (gfc_conv_intrinsic_repeat): Likewise
297 (conv_isocbinding_function): Likewise
298 (conv_intrinsic_ieee_is_normal): Likewise
299 (conv_intrinsic_ieee_is_negative): Likewise
300 (conv_intrinsic_ieee_copy_sign): Likewise
301 (conv_intrinsic_move_alloc): Likewise
302 * trans-io.c (set_parameter_value_chk): Likewise
303 (set_parameter_value_inquire): Likewise
304 (set_string): Likewise
305 * trans-openmp.c (gfc_walk_alloc_comps): Likewise
306 (gfc_omp_clause_default_ctor): Likewise
307 (gfc_omp_clause_copy_ctor): Likewise
308 (gfc_omp_clause_assign_op): Likewise
309 (gfc_omp_clause_dtor): Likewise
310 (gfc_omp_finish_clause): Likewise
311 (gfc_trans_omp_clauses): Likewise
312 (gfc_trans_omp_do): Likewise
313 * trans-stmt.c (gfc_trans_goto): Likewise
314 (gfc_trans_sync): Likewise
315 (gfc_trans_arithmetic_if): Likewise
316 (gfc_trans_simple_do): Likewise
317 (gfc_trans_do): Likewise
318 (gfc_trans_forall_loop): Likewise
319 (gfc_trans_where_2): Likewise
320 (gfc_trans_allocate): Likewise
321 (gfc_trans_deallocate): Likewise
322 * trans-types.c (gfc_init_types): Initialize logical_type_node and
323 their true/false trees.
324 (gfc_get_array_descr_info): Use logical_type_node.
325 * trans-types.h (logical_type_node): New tree.
326 (logical_true_node): Likewise.
327 (logical_false_node): Likewise.
328 * trans.c (gfc_trans_runtime_check): Use logical_type_node.
329 (gfc_call_malloc): Likewise
330 (gfc_allocate_using_malloc): Likewise
331 (gfc_allocate_allocatable): Likewise
332 (gfc_add_comp_finalizer_call): Likewise
333 (gfc_add_finalizer_call): Likewise
334 (gfc_deallocate_with_status): Likewise
335 (gfc_deallocate_scalar_with_status): Likewise
336 (gfc_call_realloc): Likewise
337
338 2017-11-06 Paul Thomas <pault@gcc.gnu.org>
339
340 PR fortran/69739
341 * trans-expr.c (gfc_map_intrinsic_function): Return false for
342 bounds without the DIM argument instead of ICEing.
343
344 2017-11-06 Martin Liska <mliska@suse.cz>
345
346 PR middle-end/82404
347 * options.c (gfc_post_options): Set default value of
348 -Wreturn-type to false.
349
350 2017-11-05 Thomas Koenig <tkoenig@gcc.gnu.org>
351
352 PR fortran/82471
353 * lang.opt (ffrontend-loop-interchange): New option.
354 (Wfrontend-loop-interchange): New option.
355 * options.c (gfc_post_options): Handle ffrontend-loop-interchange.
356 * frontend-passes.c (gfc_run_passes): Run
357 optimize_namespace if flag_frontend_optimize or
358 flag_frontend_loop_interchange are set.
359 (optimize_namespace): Run functions according to flags set;
360 also call index_interchange.
361 (ind_type): New function.
362 (has_var): New function.
363 (index_cost): New function.
364 (loop_comp): New function.
365
366 2017-11-05 Paul Thomas <pault@gcc.gnu.org>
367
368 PR fortran/78641
369 * resolve.c (resolve_ordinary_assign): Do not add the _data
370 component for class valued array constructors being assigned
371 to derived type arrays.
372 * trans-array.c (gfc_trans_array_ctor_element): Take the _data
373 of class valued elements for assignment to derived type arrays.
374
375 2017-11-05 Paul Thomas <pault@gcc.gnu.org>
376
377 PR fortran/81447
378 PR fortran/82783
379 * resolve.c (resolve_component): There is no need to resolve
380 the components of a use associated vtype.
381 (resolve_fl_derived): Unconditionally generate a vtable for any
382 module derived type, as long as the standard is F2003 or later
383 and it is not a vtype or a PDT template.
384
385 2017-11-05 Tom de Vries <tom@codesourcery.com>
386
387 PR other/82784
388 * parse.c (match, matcha, matchs, matcho, matchds, matchdo): Remove
389 semicolon after "do {} while (0)".
390
391 2017-11-04 Andre Vehreschild <vehre@gcc.gnu.org>
392
393 * trans-expr.c (gfc_trans_assignment_1): Character kind conversion may
394 create a loop variant temporary, too.
395 * trans-intrinsic.c (conv_caf_send): Treat char arrays as arrays and
396 not as scalars.
397 * trans.c (get_array_span): Take the character kind into account when
398 doing pointer arithmetic.
399
400 2017-11-04 Thomas Koenig <tkoenig@gcc.gnu.org>
401
402 PR fortran/29600
403 * gfortran.h (gfc_check_f): Replace fm3l with fm4l.
404 * intrinsic.h (gfc_resolve_maxloc): Add gfc_expr * to argument
405 list in protoytpe.
406 (gfc_resolve_minloc): Likewise.
407 * check.c (gfc_check_minloc_maxloc): Handle kind argument.
408 * intrinsic.c (add_sym_3_ml): Rename to
409 (add_sym_4_ml): and handle kind argument.
410 (add_function): Replace add_sym_3ml with add_sym_4ml and add
411 extra arguments for maxloc and minloc.
412 (check_specific): Change use of check.f3ml with check.f4ml.
413 * iresolve.c (gfc_resolve_maxloc): Handle kind argument. If
414 the kind is smaller than the smallest library version available,
415 use gfc_default_integer_kind and convert afterwards.
416 (gfc_resolve_minloc): Likewise.
417
418 2017-11-04 Paul Thomas <pault@gcc.gnu.org>
419
420 PR fortran/81735
421 * trans-decl.c (gfc_trans_deferred_vars): Do a better job of a
422 case where 'tmp' was used unititialized and remove TODO.
423
424 2017-11-03 Steven G. Kargl <kargl@gcc.gnu.org>
425
426 PR fortran/82796
427 * resolve.c (resolve_equivalence): An entity in a common block within
428 a module cannot appear in an equivalence statement if the entity is
429 with a pure procedure.
430
431 2017-10-31 Jim Wilson <wilson@tuliptree.org>
432
433 * parse.c (unexpected_eof): Call gcc_unreachable before return.
434
435 2017-10-30 Paul Thomas <pault@gcc.gnu.org>
436
437 PR fortran/80850
438 * trans_expr.c (gfc_conv_procedure_call): When passing a class
439 argument to an unlimited polymorphic dummy, it is wrong to cast
440 the passed expression as unlimited, unless it is unlimited. The
441 correct way is to assign to each of the fields and set the _len
442 field to zero.
443
444 2017-10-30 Steven G. Kargl <kargl@gcc.gnu.org>
445
446 * resolve.c (resolve_transfer): Set derived to correct symbol for
447 BT_CLASS.
448
449 2017-10-29 Jim Wilson <wilson@tuliptree.org>
450
451 * invoke.texi: Delete adb and sdb references.
452
453 2017-10-28 Andre Vehreschild <vehre@gcc.gnu.org>
454
455 * check.c (gfc_check_co_reduce): Clarify error message.
456
457 2017-10-28 Paul Thomas <pault@gcc.gnu.org>
458
459 PR fortran/81758
460 * trans-expr.c (trans_class_vptr_len_assignment): 'vptr_expr'
461 must only be set if the right hand side expression is of type
462 class.
463
464 2017-10-27 Steven G. Kargl <kargl@gcc.gnu.org>
465
466 PR fortran/82620
467 * match.c (gfc_match_allocate): Exit early on syntax error.
468
469 2017-10-27 Thomas Koenig <tkoenig@gcc.gnu.org>
470
471 PR fortran/56342
472 * simplify.c (is_constant_array_expr): If the expression is
473 a parameter array, call gfc_simplify_expr.
474
475 2017-10-25 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
476
477 * match.c (gfc_match_type_is): Fix typo in error message.
478
479 2017-10-21 Paul Thomas <pault@gcc.gnu.org>
480
481 PR fortran/82586
482 * decl.c (gfc_get_pdt_instance): Remove the error message that
483 the parameter does not have a corresponding component since
484 this is now taken care of when the derived type is resolved. Go
485 straight to error return instead.
486 (gfc_match_formal_arglist): Make the PDT relevant errors
487 immediate so that parsing of the derived type can continue.
488 (gfc_match_derived_decl): Do not check the match status on
489 return from gfc_match_formal_arglist for the same reason.
490 * resolve.c (resolve_fl_derived0): Check that each type
491 parameter has a corresponding component.
492
493 PR fortran/82587
494 * resolve.c (resolve_generic_f): Check that the derived type
495 can be used before resolving the struture constructor.
496
497 PR fortran/82589
498 * symbol.c (check_conflict): Add the conflicts involving PDT
499 KIND and LEN attributes.
500
501 2017-10-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
502
503 * interface.c (check_sym_interfaces, check_uop_interfaces,
504 gfc_check_interfaces): Base interface_name buffer off
505 GFC_MAX_SYMBOL_LEN.
506
507 2017-10-19 Jakub Jelinek <jakub@redhat.com>
508
509 PR fortran/82568
510 * gfortran.h (gfc_resolve_do_iterator): Add a bool arg.
511 (gfc_resolve_omp_local_vars): New declaration.
512 * openmp.c (omp_current_ctx): Make static.
513 (gfc_resolve_omp_parallel_blocks): Handle EXEC_OMP_TASKLOOP
514 and EXEC_OMP_TASKLOOP_SIMD.
515 (gfc_resolve_do_iterator): Add ADD_CLAUSE argument, if false,
516 don't actually add any clause. Move omp_current_ctx test
517 earlier.
518 (handle_local_var, gfc_resolve_omp_local_vars): New functions.
519 * resolve.c (gfc_resolve_code): Call gfc_resolve_omp_parallel_blocks
520 instead of just gfc_resolve_omp_do_blocks for EXEC_OMP_TASKLOOP
521 and EXEC_OMP_TASKLOOP_SIMD.
522 (gfc_resolve_code): Adjust gfc_resolve_do_iterator caller.
523 (resolve_codes): Call gfc_resolve_omp_local_vars.
524
525 2017-10-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
526
527 * gfortran.h (gfc_lookup_function_fuzzy): New declaration.
528 (gfc_closest_fuzzy_match): New declaration.
529 (vec_push): New definition.
530 * misc.c (gfc_closest_fuzzy_match): New definition.
531 * resolve.c: Include spellcheck.h.
532 (lookup_function_fuzzy_find_candidates): New static function.
533 (lookup_uop_fuzzy_find_candidates): Likewise.
534 (lookup_uop_fuzzy): Likewise.
535 (resolve_operator) <INTRINSIC_USER>: Call lookup_uop_fuzzy.
536 (gfc_lookup_function_fuzzy): New definition.
537 (resolve_unknown_f): Call gfc_lookup_function_fuzzy.
538 * interface.c (check_interface0): Likewise.
539 (lookup_arg_fuzzy_find_candidates): New static function.
540 (lookup_arg_fuzzy ): Likewise.
541 (compare_actual_formal): Call lookup_arg_fuzzy.
542 * symbol.c: Include spellcheck.h.
543 (lookup_symbol_fuzzy_find_candidates): New static function.
544 (lookup_symbol_fuzzy): Likewise.
545 (gfc_set_default_type): Call lookup_symbol_fuzzy.
546 (lookup_component_fuzzy_find_candidates): New static function.
547 (lookup_component_fuzzy): Likewise.
548 (gfc_find_component): Call lookup_component_fuzzy.
549
550 2017-10-18 Thomas Koenig <tkoenig@gcc.gnu.org>
551
552 PR fortran/82567
553 * frontend-passes.c (combine_array_constructor): If an array
554 constructor is all constants and has more elements than a small
555 constant, don't convert a*[b,c] to [a*b,a*c] to reduce compilation
556 times.
557
558 2017-10-18 Thomas Koenig <tkoenig@gcc.gnu.org>
559
560 PR fortran/79795
561 * resolve.c (resovle_symbol): Change gcc_assert to
562 sensible error message.
563
564 2017-10-18 Paul Thomas <pault@gcc.gnu.org>
565
566 PR fortran/82550
567 * trans_decl.c (gfc_get_symbol_decl): Procedure symbols that
568 have the 'used_in_submodule' attribute should be processed by
569 'gfc_get_extern_function_decl'.
570
571 2017-10-16 Fritz Reese <fritzoreese@gmail.com>
572
573 PR fortran/82511
574 * trans-io.c (transfer_expr): Treat BT_UNION as BT_DERIVED.
575
576 2017-10-15 Thomas Koenig <tkoenig@gcc.gnu.org>
577
578 PR fortran/82372
579 * fortran/scanner.c (last_error_char): New global variable.
580 (gfc_scanner_init_1): Set last_error_char to NULL.
581 (gfc_gobble_whitespace): If a character not printable or
582 not newline, issue an error.
583
584 2017-10-13 Paul Thomas <pault@gcc.gnu.org>
585
586 PR fortran/81048
587 * resolve.c (resolve_symbol): Ensure that derived type array
588 results get default initialization.
589
590 2017-10-11 Nathan Sidwell <nathan@acm.org>
591
592 * cpp.c (gfc_cpp_add_include_path): Update incpath_e names.
593 (gfc_cpp_add_include_path_after): Likewise.
594
595 2017-10-10 Richard Sandiford <richard.sandiford@linaro.org>
596
597 * target-memory.c (gfc_interpret_logical): Use wi::to_wide when
598 operating on trees as wide_ints.
599 * trans-const.c (gfc_conv_tree_to_mpz): Likewise.
600 * trans-expr.c (gfc_conv_cst_int_power): Likewise.
601 * trans-intrinsic.c (trans_this_image): Likewise.
602 (gfc_conv_intrinsic_bound): Likewise.
603 (conv_intrinsic_cobound): Likewise.
604
605 2017-10-08 Steven G. Kargl <kargl@gcc.gnu.org>
606
607 * check.c (gfc_check_x): Remove function.
608 * intrinsic.c (add_functions): Use gfc_check_fn_r.
609
610 2017-10-08 Paul Thomas <pault@gcc.gnu.org>
611
612 PR fortran/82375
613 * module.c : Bump up MOD_VERSION to 15.
614 (mio_component): Edit comment about PDT specification list.
615 (mio_expr, mio_symbol): Include the expression and symbol PDT
616 specification lists in the same way as in mio_component.
617
618 2017-10-08 Thomas Koenig <tkoenig@gcc.gnu.org>
619
620 * dump_prase_tree (show_symbol): Output list of variables in
621 NAMELIST.
622 (show_code_node): Add new line for ELSE and END DO for DO
623 CONCURRENT.
624 * invoke.texi: Document that the output of
625 -fdump-fortran-original, -fdump-fortran-optimized and
626 -fdump-parse-tree is unsable and may lead to ICEs.
627
628 2017-10-07 Paul Thomas <pault@gcc.gnu.org>
629
630 PR fortran/82375
631 * class.c (gfc_find_derived_vtab): Return NULL for a passed
632 pdt template to prevent bad procedures from being written.
633 * decl.c (gfc_get_pdt_instance): Do not use the default
634 initializer for pointer and allocatable pdt type components. If
635 the component is allocatbale, set the 'alloc_comp' attribute of
636 'instance'.
637 * module.c : Add a prototype for 'mio_actual_arglist'. Add a
638 boolean argument 'pdt'.
639 (mio_component): Call it for the parameter list of pdt type
640 components with 'pdt' set to true.
641 (mio_actual_arg): Add the boolean 'pdt' and, if it is set, call
642 mio_integer for the 'spec_type'.
643 (mio_actual_arglist): Add the boolean 'pdt' and use it in the
644 call to mio_actual_arg.
645 (mio_expr, mio_omp_udr_expr): Call mio_actual_arglist with
646 'pdt' set false.
647 * resolve.c (get_pdt_spec_expr): Add the parameter name to the
648 KIND parameter error.
649 (get_pdt_constructor): Check that cons->expr is non-null.
650 * trans-array.c (structure_alloc_comps): For deallocation of
651 allocatable components, ensure that parameterized components
652 are deallocated first. Likewise, when parameterized components
653 are allocated, nullify allocatable components first. Do not
654 recurse into pointer or allocatable pdt components while
655 allocating or deallocating parameterized components. Test that
656 parameterized arrays or strings are allocated before freeing
657 them.
658 (gfc_trans_pointer_assignment): Call the new function. Tidy up
659 a minor whitespace issue.
660 trans-decl.c (gfc_trans_deferred_vars): Set 'tmp' to NULL_TREE
661 to prevent the expression from being used a second time.
662
663 2017-10-07 Thomas Koenig <tkoenig@gcc.gnu.org>
664
665 PR fortran/49232
666 * expr.c (gfc_check_pointer_assign): Error
667 for non-contiguous rhs.
668
669 2017-10-07 Thomas Koenig <tkoenig@gcc.gnu.org>
670
671 * gfortran.h (async_io_dt): Add external reference.
672 * io.c (async_io_dt): Add variable.
673 (compare_to_allowed_values): Add prototyte. Add optional argument
674 num. If present, set it to the number of the entry that was
675 matched.
676 (check_io_constraints): If this is for an asynchronous I/O
677 statement, set async_io_dt and set the asynchronous flag for
678 a SIZE tag.
679 * resolve.c (resolve_transfer): If async_io_dt is set, set
680 the asynchronous flag on the variable.
681 (resolve_fl_namelist): If async_io_dt is set, set the asynchronous
682 flag on all elements of the namelist.
683
684 2017-10-04 Paul Thomas <pault@gcc.gnu.org>
685
686 PR fortran/60458
687 PR fortran/77296
688 * resolve.c (resolve_assoc_var): Deferred character type
689 associate names must not receive an integer conatant length.
690 * symbol.c (gfc_is_associate_pointer): Deferred character
691 length functions also require an associate pointer.
692 * trans-decl.c (gfc_get_symbol_decl): Deferred character
693 length functions or derived type components require the assoc
694 name to have variable string length.
695 * trans-stmt.c (trans_associate_var): Set the string length of
696 deferred string length associate names. The address expression
697 is not needed for allocatable, pointer or dummy targets. Change
698 the comment about defered string length targets.
699
700 2017-10-03 Thomas Koenig <tkoenig@gcc.gnu.org>
701
702 * io.c (match_wait_element): Correctly match END and EOR tags.
703 * dump-parse-tree.c (show_code_node): Handle EXEC_WAIT.
704
705 2017-10-02 Paul Thomas <pault@gcc.gnu.org>
706
707 PR fortran/82312
708 * resolve.c (gfc_resolve_code): Simplify condition for class
709 pointer assignments becoming regular assignments by asserting
710 that only class valued targets are permitted.
711 * trans-expr.c (trans_class_pointer_fcn): New function using a
712 block of code from gfc_trans_pointer_assignment.
713 (gfc_trans_pointer_assignment): Call the new function. Tidy up
714 a minor whitespace issue.
715
716 2017-10-01 Dominique d'Humieres <dominiq@lps.ens.fr>
717
718 PR fortran/61450
719 * parse.c (gfc_global_used): Replace the gfc_internal_error
720 with an error.
721
722 2017-09-29 Dominique d'Humieres <dominiq@lps.ens.fr>
723
724 PR fortran/25071
725 * interface.c (compare_actual_formal): Change warnings to errors
726 when "Actual argument contains too few elements for dummy
727 argument", unless -std=legacy is used.
728
729 2017-09-27 Thomas Schwinge <thomas@codesourcery.com>
730
731 * lang.opt <Wdo-subscript>: End help text with a period.
732
733 2017-09-26 Thomas Koenig <tkoenig@gcc.gnu.org>
734
735 * frontend-passes.c (do_subscript): Don't do anything
736 if inside an associate list.
737
738 2017-09-25 Thomas Koenig <tkoenig@gcc.gnu.org>
739
740 * lang.opt: Add -Wdo-subscript.
741 * frontend-passes.c (do_t): New type.
742 (doloop_list): Use variable of do_type.
743 (if_level): Variable to track if levels.
744 (select_level): Variable to track select levels.
745 (gfc_run_passes): Initialize i_level and select_level.
746 (doloop_code): Record current level of if + select
747 level in doloop_list. Add seen_goto if there could
748 be a branch outside the loop. Use different type for
749 doloop_list.
750 (doloop_function): Call do_intent and do_subscript; move
751 functionality of checking INTENT to do_intent.
752 (insert_index_t): New type, for callback_insert_index.
753 (callback_insert_index): New function.
754 (insert_index): New function.
755 (do_subscript): New function.
756 (do_intent): New function.
757 (gfc_code_walker): Keep track of if_level and select_level.
758 * invoke.texi: Document -Wdo-subscript.
759
760 2017-09-25 Janne Blomqvist <jb@gcc.gnu.org>
761
762 * trans.c (gfc_unlikely): Remove unnecessary fold_convert.
763 (gfc_likely): Likewise.
764
765 2017-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
766 Steven G. Kargl <kargl@gcc.gnu.org>
767
768 PR fortran/80118
769 * expr.c (gfc_get_full_arrayspec_from_expr): If there is
770 no symtree, set array spec to NULL.
771
772 2017-09-23 Janus Weil <janus@gcc.gnu.org>
773
774 PR fortran/82143
775 * lang.opt: Add the options -fdefault-real-10 and -fdefault-real-16.
776 Rename flag_default_real to flag_default_real_8.
777 * invoke.texi: Add documentation.
778 * module.c (use_iso_fortran_env_module): flag_default_real is renamed.
779 * trans-types.c (gfc_init_kinds): Implement the flags
780 -fdefault-real-10 and -fdefault-real-16. Make -fdefault-double-8 work
781 without -fdefault-real-8.
782
783 2017-09-21 Paul Thomas <pault@gcc.gnu.org>
784
785 PR fortran/52832
786 * match.c (gfc_match_associate): Before failing the association
787 try again, allowing a proc pointer selector.
788
789 PR fortran/80120
790 PR fortran/81903
791 PR fortran/82121
792 * primary.c (gfc_match_varspec): Introduce 'tgt_expr', which
793 points to the associate selector, if any. Go through selector
794 references, after resolution for variables, to catch any full
795 or section array references. If a class associate name does
796 not have the same declared type as the selector, resolve the
797 selector and copy the declared type to the associate name.
798 Before throwing a no implicit type error, resolve all allowed
799 selector expressions, and copy the resulting typespec.
800
801 PR fortran/67543
802 * resolve.c (resolve_assoc_var): Selector must cannot be the
803 NULL expression and it must have a type.
804
805 PR fortran/78152
806 * resolve.c (resolve_symbol): Allow associate names to be
807 coarrays.
808
809 2017-09-21 Cesar Philippidis <cesar@codesourcery.com>
810
811 * openmp.c (gfc_match_oacc_wait): Don't restrict wait directive
812 arguments to constant integers.
813
814 2017-09-17 Paul Thomas <pault@gcc.gnu.org>
815
816 PR fortran/82173
817 * decl.c (gfc_get_pdt_instance): Use the component initializer
818 expression for the default, rather than the parameter value.
819 * resolve.c (resolve_pdt): New function.
820 (resolve_symbol): Call it. Remove false error, prohibiting
821 deferred type parameters for dummy arguments.
822
823 PR fortran/60483
824 * primary.c (gfc_match_varspec): If the type of an associate
825 name is unknown and yet there is a match, try resolving the
826 target expression and using its type.
827
828 2017-09-15 Paul Thomas <pault@gcc.gnu.org>
829
830 PR fortran/82184
831 trans-decl.c (gfc_trans_deferred_vars): Do not null the 'span'
832 field if the symbol is either implicitly or explicitly saved.
833
834 2017-09-13 Paul Thomas <pault@gcc.gnu.org>
835
836 PR fortran/82173
837 * decl.c (match_char_kind): If the kind expression is
838 parameterized, save it in saved_kind_expr and set kind = 0.
839 (gfc_get_pdt_instance): Resolve and simplify before emitting
840 error on expression kind. Insert a missing simplification after
841 insertion of kind expressions.
842
843 2017-09-12 Paul Thomas <pault@gcc.gnu.org>
844
845 PR fortran/82173
846 PR fortran/82168
847 * decl.c (variable_decl): Check pdt template components for
848 appearance of KIND/LEN components in the type parameter name
849 list, that components corresponding to type parameters have
850 either KIND or LEN attributes and that KIND or LEN components
851 are scalar. Copy the initializer to the parameter value.
852 (gfc_get_pdt_instance): Add a label 'error_return' and follow
853 it with repeated code, while replacing this code with a jump.
854 Check if a parameter appears as a component in the template.
855 Make sure that the parameter expressions are integer. Validate
856 KIND expressions.
857 (gfc_match_decl_type_spec): Search for pdt_types in the parent
858 namespace since they are instantiated in the template ns.
859 * expr.c (gfc_extract_int): Use a KIND parameter if it
860 appears as a component expression.
861 (gfc_check_init_expr): Allow expressions with the pdt_kind
862 attribute.
863 *primary.c (gfc_match_actual_arglist): Make sure that the first
864 keyword argument is recognised when 'pdt' is set.
865
866 2017-09-10 Paul Thomas <pault@gcc.gnu.org>
867
868 PR fortran/34640
869 PR fortran/40737
870 PR fortran/55763
871 PR fortran/57019
872 PR fortran/57116
873
874 * expr.c (is_subref_array): Add class pointer array dummies
875 to the list of expressions that return true.
876 * trans-array.c: Add SPAN_FIELD and update indices for
877 subsequent fields.
878 (gfc_conv_descriptor_span, gfc_conv_descriptor_span_get,
879 gfc_conv_descriptor_span_set, is_pointer_array,
880 get_array_span): New functions.
881 (gfc_get_descriptor_offsets_for_info): New function to preserve
882 API for access to descriptor fields for trans-types.c.
883 (gfc_conv_scalarized_array_ref): If the expression is a subref
884 array, make sure that info->descriptor is a descriptor type.
885 Otherwise, if info->descriptor is a pointer array, set 'decl'
886 and fix it if it is a component reference.
887 (build_array_ref): Simplify handling of class array refs by
888 passing the vptr to gfc_build_array_ref rather than generating
889 the pointer arithmetic in this function.
890 (gfc_conv_array_ref): As in gfc_conv_scalarized_array_ref, set
891 'decl'.
892 (gfc_array_allocate): Set the span field if this is a pointer
893 array. Use the expr3 element size if it is available, so that
894 the dynamic type element size is used.
895 (gfc_conv_expr_descriptor): Set the span field for pointer
896 assignments.
897 * trans-array.h: Prototypes for gfc_conv_descriptor_span_get
898 gfc_conv_descriptor_span_set and
899 gfc_get_descriptor_offsets_for_info added.
900 trans-decl.c (gfc_get_symbol_decl): If a non-class pointer
901 array, mark the declaration as a GFC_DECL_PTR_ARRAY_P. Remove
902 the setting of GFC_DECL_SPAN.
903 (gfc_trans_deferred_vars): Set the span field to zero in thge
904 originating scope.
905 * trans-expr.c (gfc_conv_procedure_call): Do not use copy-in/
906 copy-out to pass subref expressions to a pointer dummy.
907 (gfc_trans_pointer_assignment): Remove code for setting of
908 GFC_DECL_SPAN. Set the 'span' field for non-class pointers to
909 class function results. Likewise for rank remap. In the case
910 that the target is not a whole array, use the target array ref
911 for remap and, since the 'start' indices are missing, set the
912 lbounds to one, as required by the standard.
913 * trans-intrinsic.c (conv_expr_ref_to_caf_ref): Pick up the
914 'token' offset from the field decl in the descriptor.
915 (conv_isocbinding_subroutine): Set the 'span' field.
916 * trans-io.c (gfc_trans_transfer): Always scalarize pointer
917 array io.
918 * trans-stmt.c (trans_associate_var): Set the 'span' field.
919 * trans-types.c (gfc_get_array_descriptor_base): Add the 'span'
920 field to the array descriptor.
921 (gfc_get_derived_type): Pointer array components are marked as
922 GFC_DECL_PTR_ARRAY_P.
923 (gfc_get_array_descr_info): Replaced API breaking code for
924 descriptor offset calling gfc_get_descriptor_offsets_for_info.
925 * trans.c (get_array_span): New function.
926 (gfc_build_array_ref): Simplify by calling get_array_span and
927 obtain 'span' if 'decl' or 'vptr' present.
928 * trans.h : Rename DECL_LANG_FLAG_6, GFC_DECL_SUBREF_ARRAY_P,
929 as GFC_DECL_PTR_ARRAY_P.
930
931 2017-09-09 Paul Thomas <pault@gcc.gnu.org>
932
933 * decl.c : Add decl_type_param_list, type_param_spec_list as
934 static variables to hold PDT spec lists.
935 (build_sym): Copy 'type_param_spec_list' to symbol spec_list.
936 (build_struct): Copy the 'saved_kind_expr' to the component
937 'kind_expr'. Check that KIND or LEN components appear in the
938 decl_type_param_list. These should appear as symbols in the
939 f2k_derived namespace. If the component is itself a PDT type,
940 copy the decl_type_param_list to the component param_list.
941 (gfc_match_kind_spec): If the KIND expression is parameterized
942 set KIND to zero and store the expression in 'saved_kind_expr'.
943 (insert_parameter_exprs): New function.
944 (gfc_insert_kind_parameter_exprs): New function.
945 (gfc_insert_parameter_exprs): New function.
946 (gfc_get_pdt_instance): New function.
947 (gfc_match_decl_type_spec): Match the decl_type_spec_list if it
948 is present. If it is, call 'gfc_get_pdt_instance' to obtain the
949 specific instance of the PDT.
950 (match_attr_spec): Match KIND and LEN attributes. Check for the
951 standard and for type/kind of the parameter. They are also not
952 allowed outside a derived type definition.
953 (gfc_match_data_decl): Null the decl_type_param_list and the
954 type_param_spec_list on entry and free them on exit.
955 (gfc_match_formal_arglist): If 'typeparam' is true, add the
956 formal symbol to the f2k_derived namespace.
957 (gfc_match_derived_decl): Register the decl_type_param_list
958 if this is a PDT. If this is a type extension, gather up all
959 the type parameters and put them in the right order.
960 *dump-parse-tree.c (show_attr): Signal PDT templates and the
961 parameter attributes.
962 (show_components): Output parameter atrributes and component
963 parameter list.
964 (show_symbol): Show variable parameter lists.
965 * expr.c (expr.c): Copy the expression parameter list.
966 (gfc_is_constant_expr): Pass on symbols representing PDT
967 parameters.
968 (gfc_check_init_expr): Break on PDT KIND parameters and
969 PDT parameter expressions.
970 (gfc_check_assign): Assigning to KIND or LEN components is an
971 error.
972 (derived_parameter_expr): New function.
973 (gfc_derived_parameter_expr): New function.
974 (gfc_spec_list_type): New function.
975 * gfortran.h : Add enum gfc_param_spec_type. Add the PDT attrs
976 to the structure symbol_attr. Add the 'kind_expr' and
977 'param_list' field to the gfc_component structure. Comment on
978 the reuse of the gfc_actual_arglist structure as storage for
979 type parameter spec lists. Add the new field 'spec_type' to
980 this structure. Add 'param_list' fields to gfc_symbol and
981 gfc_expr. Add prototypes for gfc_insert_kind_parameter_exprs,
982 gfc_insert_parameter_exprs, gfc_add_kind, gfc_add_len,
983 gfc_derived_parameter_expr and gfc_spec_list_type.
984 * interface.c (gfc_compare_derived_types): Treat PDTs in the
985 same way as sequence types.
986 * match.c : Add variable 'type_param_spec_list'.
987 (gfc_op2string, gfc_match_member_sep, gfc_match_label): Remove
988 trailing whitespace.
989 (match_derived_type_spec): Match PDTs and find specific
990 instance.
991 (gfc_match_type_spec): Remove more trailing whitespace.
992 (gfc_match_allocate): Assumed or deferred parameters cannot
993 appear here. Copy the type parameter spec list to the expr for
994 the allocatable entity. Free 'type_param_spec_list'.
995 (gfc_match_common, gfc_match_namelist, gfc_match_module): Still
996 more trailing whitespace to remove.
997 (gfc_match_type_is): Allow PDT typespecs.
998 * match.h : Modify prototypes for gfc_match_formal_arglist and
999 gfc_match_actual_arglist.
1000 * module.c (ab_attribute, mstring attr_bits): PDT attributes
1001 added.
1002 (mio_symbol_attribute): PDT attributes handled.
1003 (mio_component): Deal with 'kind_expr' field.
1004 (mio_full_f2k_derived): For PDT templates, transfer the formal
1005 namespace symroot to the f2k_derived namespace.
1006 *primary.c (match_keyword_arg, gfc_match_actual_arglist): Add
1007 modifications to handle PDT spec lists. These are flagged in
1008 both cases by new boolean arguments, whose prototype defaults
1009 are false.
1010 (gfc_match_structure_constructor, match_variable): Remove yet
1011 more trailing whitespace.
1012 * resolve.c (get_pdt_spec_expr, get_pdt_constructor): New
1013 functions.
1014 (resolve_structure_cons): If the constructor is a PDT template,
1015 call get_pdt_constructor to build it using the parameter lists
1016 and then get the specific instance of the PDT.
1017 (resolve_component): PDT strings need a hidden string length
1018 component like deferred characters.
1019 (resolve_symbol): Dummy PDTs cannot have deferred parameters.
1020 * symbol.c (gfc_add_kind, gfc_add_len): New functions.
1021 (free_components): Free 'kind_expr' and 'param_list' fields.
1022 (gfc_free_symbol): Free the 'param_list' field.
1023 (gfc_find_sym_tree): If the current state is a PDT template,
1024 look for the symtree in the f2k_derived namspaces.
1025 trans-array.c (structure_alloc_comps): Allocate and deallocate
1026 PDTs. Check dummy arguments for compliance of LEN parameters.
1027 Add the new functions to the preceeding enum.
1028 (gfc_allocate_pdt_comp, gfc_deallocate_pdt_comp and
1029 gfc_check_pdt_dummy): New functions calling above.
1030 * trans-array.h : Add prototypes for these functions.
1031 trans-decl.c (gfc_get_symbol_decl): Call gfc_defer_symbol_init
1032 as appropriate for PDT symbols.
1033 (gfc_trans_deferred_vars): Allocate/deallocate PDT entities as
1034 they come into and out of scope. Exclude pdt_types from being
1035 'gcc_unreachable'.
1036 (gfc_trans_subcomponent_assign): PDT array components must be
1037 handles as if they are allocatable.
1038 * trans-stmt.c (gfc_trans_allocate): Handle initialization of
1039 PDT entities.
1040 (gfc_trans_deallocate): Likewise.
1041 * trans-types.c (gfc_get_derived_type): PDT templates must not
1042 arrive here. PDT string components are handles as if deferred.
1043 Similarly, PDT arrays are treated as if allocatable. PDT
1044 strings are pointer types.
1045 * trans.c (gfc_deferred_strlen): Handle PDT strings in the same
1046 way as deferred characters.
1047
1048 2017-09-01 Jakub Jelinek <jakub@redhat.com>
1049
1050 PR c/81887
1051 * parse.c (decode_omp_directive): Use matchs instead of matcho for
1052 end ordered and ordered directives, except for ordered depend. For
1053 -fopenmp-simd and ordered depend, reject the stmt.
1054 * trans-openmp.c (gfc_trans_omp_ordered): For -fopenmp-simd ignore
1055 threads clause and if simd clause isn't present, just translate the
1056 body.
1057
1058 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1059 Alan Hayward <alan.hayward@arm.com>
1060 David Sherwood <david.sherwood@arm.com>
1061
1062 * trans-types.c (gfc_init_kinds): Use opt_scalar_int_mode for
1063 the mode iterator.
1064
1065 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1066 Alan Hayward <alan.hayward@arm.com>
1067 David Sherwood <david.sherwood@arm.com>
1068
1069 * target-memory.c (size_integer): Use SCALAR_INT_TYPE_MODE.
1070 (size_logical): Likewise.
1071
1072 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1073 Alan Hayward <alan.hayward@arm.com>
1074 David Sherwood <david.sherwood@arm.com>
1075
1076 * trans-types.c (gfc_type_for_mode): Use is_a <scalar_int_mode>.
1077
1078 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1079 Alan Hayward <alan.hayward@arm.com>
1080 David Sherwood <david.sherwood@arm.com>
1081
1082 * trans-types.c (gfc_init_kinds): Use opt_scalar_float_mode
1083 and FOR_EACH_MODE_IN_CLASS.
1084
1085 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1086 Alan Hayward <alan.hayward@arm.com>
1087 David Sherwood <david.sherwood@arm.com>
1088
1089 * target-memory.c (size_float): Use SCALAR_FLOAT_TYPE_MODE
1090 instead of TYPE_MODE.
1091
1092 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
1093 Alan Hayward <alan.hayward@arm.com>
1094 David Sherwood <david.sherwood@arm.com>
1095
1096 * trans-types.c (gfc_init_kinds): Use machine_mode instead of int
1097 for "mode".
1098
1099 2017-08-28 Janus Weil <janus@gcc.gnu.org>
1100
1101 PR fortran/81770
1102 * expr.c (gfc_check_pointer_assign): Improve the check whether pointer
1103 may outlive pointer target.
1104
1105 2017-08-27 Thomas Koenig <tkoenig@gcc.gnu.org>
1106
1107 PR fortran/81974
1108 * frontend-passes (inline_matumul_assign): Explicity
1109 set typespec for call to CONJG.
1110
1111 2017-08-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1112
1113 PR fortran/81296
1114 * trans-io.c (get_dtio_proc): Add check for format label and set
1115 formatted flag accordingly. Reorganize the code a little.
1116
1117 2017-08-16 Thomas Koenig <tkoenig@gcc.gnu.org>
1118
1119 PR fortran/81116
1120 * frontend-passes.c (realloc_string_callback): If expression is a
1121 concatenation, also check for dependency.
1122 (constant_string_length): Check for presence of symtree.
1123
1124 2017-08-13 Thomas Koenig <tkoenig@gcc.gnu.org>
1125
1126 * gfortran.texi: Document format of unformatted sequential files.
1127
1128 2017-08-11 Thomas Koenig <tkoenig@gcc.gnu.org>
1129
1130 * invoke.texi: Actually commit change about -Ofast.
1131
1132 2017-08-11 Thomas Koenig <tkoenig@gcc.gnu.org>
1133
1134 PR fortran/60355
1135 * resolve.c (resolve_symbol): Adjust (and reformat)
1136 comment. Perform check if a BIND(C) is declared
1137 at module level regardless of whether it is typed
1138 implicitly or not.
1139
1140 2017-08-10 Fritz Reese <fritzoreese@gmail.com>
1141
1142 * options.c (set_dec_flags): Only set legacy standards when value
1143 is not zero.
1144
1145 2017-08-10 Fritz Reese <fritzoreese@gmail.com>
1146
1147 * options.c (set_dec_flags, gfc_post_options): Only set flag_d_lines
1148 with -fdec when not set by user.
1149
1150 2017-08-10 Fritz Reese <fritzoreese@gmail.com>
1151
1152 * decl.c (attr_seen): New static variable.
1153 * decl.c (variable_decl): Match %FILL in STRUCTURE body.
1154 * gfortran.texi: Update documentation.
1155
1156 2017-08-08 Martin Liska <mliska@suse.cz>
1157
1158 * trans-types.c: Include header files.
1159
1160 2017-08-07 Thomas Koenig <tkoenig@gcc.gnu.org>
1161
1162 PR fortran/68829
1163 PR fortran/81701
1164 * options.c: Make -Ofast honor -fmax-stack-var-size.
1165 * invoke.texi: Document change.
1166
1167 2017-08-01 Thomas König <tkoenig@gcc.gnu.org>
1168
1169 PR fortran/79312
1170 * intrisic.c (gfc_convert_type_warn): Only set typespec for
1171 empty array constructors which don't have it already.
1172
1173 2017-08-01 Thomas Koenig <tkoenig@gcc.gnu.org>
1174
1175 PR fortran/45435
1176 * lang.opt (fc-prototypes): Add option.
1177 * gfortran.h (gfc_typespec): Add interop_kind to struct.
1178 (gfc_dump_c_prototypes): Add prototype.
1179 * decl.c (gfc_match_kind_spec): Copy symbol used for kind to typespec.
1180 * parse.c (gfc_parse_file): Call gfc_dump_prototypes.
1181 * dump-parse-tree.c (gfc_dump_c_prototypes): New function.
1182 (type_return): New enum.
1183 (get_c_type_name): New function.
1184 (write_decl): New function.
1185 (write_type): New function.
1186 (write_variable): New function.
1187 (write_proc): New function.
1188 (write_interop_decl): New function.
1189 * invoke.texi: Document -fc-prototypes.
1190
1191 2017-08-01 Dominique d'Humieres <dominiq@lps.ens.fr>
1192
1193 PR fortran/53542
1194 * expr.c (gfc_check_init_expr): Use the renamed name.
1195
1196 2017-07-31 Jakub Jelinek <jakub@redhat.com>
1197
1198 * check.c (gfc_check_num_images): Fix a pasto.
1199
1200 2017-07-29 Jakub Jelinek <jakub@redhat.com>
1201
1202 * trans-decl.c (gfc_trans_use_stmts): Pass false as new argument to
1203 the imported_module_or_decl debug hook.
1204
1205 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
1206
1207 * resolve.c (find_reachable_labels): Adjust.
1208
1209 2017-07-25 Jakub Jelinek <jakub@redhat.com>
1210
1211 * ioparm.def: Use 1U << 31 instead of 1 << 31 as flags2 mask.
1212
1213 2017-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1214
1215 * dump-parse-tree.c (show_symbol): Show binding label if present.
1216
1217 2017-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1218 Mikael Morin <mikael@gcc.gnu.org>
1219
1220 PR fortran/66102
1221 * fortran/trans-array.c (gfc_conv_resolve_dependencies):
1222 Break if dependency has been found.
1223
1224 2017-07-23 Alexander Monakov <amonakov@ispras.ru>
1225
1226 * interface.c (pair_cmp): Fix gfc_symbol comparison. Adjust comment.
1227
1228 2017-07-18 Nathan Sidwell <nathan@acm.org>
1229
1230 * trans.c (gfc_build_array_ref): Use TYPE_MAX_VALUE.
1231
1232 2017-07-09 Dominique d'Humieres <dominiq@lps.ens.fr>
1233
1234 PR fortran/81341
1235 * class.c (class_array_ref_detected): Remove a redundant
1236 condition.
1237
1238 2017-07-06 Harald Anlauf <anlauf@gmx.de>
1239
1240 PR fortran/70071
1241 * array.c (gfc_ref_dimen_size): Handle bad subscript triplets.
1242
1243 2017-07-03 Dominique d'Humieres <dominiq@lps.ens.fr>
1244
1245 PR fortran/79866
1246 * resolve.c (resolve_symbol): Fix typo.
1247
1248 2017-07-03 Dominique d'Humieres <dominiq@lps.ens.fr>
1249
1250 PR fortran/79843
1251 * symbol.c (check_conflict): Add missing "conflicts".
1252
1253 2017-06-29 Cesar Philippidis <cesar@codesourcery.com>
1254
1255 PR fortran/77765
1256 * openmp.c (gfc_match_oacc_routine): Check if proc_name exist before
1257 comparing the routine name against it.
1258
1259 2017-06-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1260
1261 PR fortran/80164
1262 * trans-stmt.c (gfc_trans_call): If no code expr, use code->loc
1263 as warning/error locus.
1264
1265 2017-06-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1266
1267 PR fortran/81160
1268 * arith.c (wprecision_int_real): Set return value before
1269 mpz_clear and then return after it.
1270
1271 2017-06-15 Janus Weil <janus@gcc.gnu.org>
1272
1273 PR fortran/80983
1274 * trans-expr.c (gfc_conv_procedure_call): Deallocate the result of
1275 scalar allocatable procedure-pointer components.
1276
1277 2017-06-10 Thomas Koenig <tkoenig@gcc.gnu.org>
1278
1279 PR fortran/80988
1280 * frontend-passes.c (traverse_io_block): Also
1281 check for variables occurring as indices multiple
1282 time in a single implied DO loop.
1283
1284 2017-06-05 Janus Weil <janus@gcc.gnu.org>
1285
1286 PR fortran/70601
1287 * trans-expr.c (gfc_conv_procedure_call): Fix detection of allocatable
1288 function results.
1289
1290 2017-06-05 Nicolas Koenig <koenigni@student.ethz.ch>
1291
1292 PR fortran/35339
1293 * frontend-passes.c (traverse_io_block): New function.
1294 (simplify_io_impl_do): New function.
1295 (optimize_namespace): Invoke gfc_code_walker with
1296 simplify_io_impl_do.
1297
1298 2017-06-02 Jakub Jelinek <jakub@redhat.com>
1299
1300 PR fortran/80918
1301 * openmp.c (resolve_omp_clauses): Fix a typo.
1302
1303 2017-05-30 David Malcolm <dmalcolm@redhat.com>
1304
1305 * error.c (gfc_format_decoder): Update for new bool and
1306 const char ** params.
1307
1308 2017-05-29 Thomas Koenig <tkoenig@gcc.gnu.org>
1309
1310 PR fortran/37131
1311 * frontend-passes.c (check_conjg_transpose_variable):
1312 Add prototype.
1313 (has_dimen_vector_ref): Likewise
1314 (matmul_temp_args): New function. Add prototype.
1315 (optimize_namespace): Call matmul_temp_args.
1316
1317 2017-05-28 Thomas Koenig <tkoenig@gcc.gnu.org>
1318
1319 * frontend-passes.c (matmul_lhs_realloc): Correct
1320 allocation size for case A1B2.
1321
1322 2017-05-25 Thomas Koenig <tkoenig@gcc.gnu.org>
1323
1324 * dump-parse-tree.c (show_expr): Also replace
1325 with dumpfile for showing values for forgotten
1326 case.
1327
1328 2017-05-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1329
1330 * dump-parse-tree.c (show_expr): Replace stdout
1331 with dumpfile for showing values.
1332
1333 2017-05-24 Thomas Koenig <tkoenig@gcc.gnu.org>
1334
1335 PR fortran/66094
1336 * frontend-passes.c (matrix_case): Add A2TB2.
1337 (inline_limit_check): Handle MATMUL(TRANSPOSE(A),B)
1338 (inline_matmul_assign): Likewise.
1339
1340 2017-05-23 Thomas Schwinge <thomas@codesourcery.com>
1341
1342 * openmp.c (OACC_KERNELS_CLAUSES): Add "OMP_CLAUSE_NUM_GANGS",
1343 "OMP_CLAUSE_NUM_WORKERS", "OMP_CLAUSE_VECTOR_LENGTH".
1344
1345 2017-05-22 Janus Weil <janus@gcc.gnu.org>
1346
1347 PR fortran/80766
1348 * resolve.c (resolve_fl_derived): Make sure that vtype symbols are
1349 properly resolved.
1350
1351 2017-05-19 Paul Thomas <pault@gcc.gnu.org>
1352
1353 PR fortran/80333
1354 * trans-io.c (nml_get_addr_expr): If we are dealing with class
1355 type data set tmp tree to get that address.
1356 (transfer_namelist_element): Set the array spec to point to the
1357 the class data.
1358
1359 2017-05-19 David Malcolm <dmalcolm@redhat.com>
1360
1361 PR fortran/79852
1362 * bbt.c (insert): Remove trailing exclamation mark from message.
1363 * decl.c (gfc_match_final_decl): Likewise.
1364 * dump-parse-tree.c (show_expr): Likewise.
1365 * module.c (gfc_use_module): Likewise.
1366 * primary.c (build_actual_constructor): Likewise.
1367 (gfc_convert_to_structure_constructor): Likewise.
1368
1369 2017-05-19 Thomas Schwinge <thomas@codesourcery.com>
1370
1371 * gfortran.h (enum gfc_omp_default_sharing): Add
1372 "OMP_DEFAULT_PRESENT".
1373 * dump-parse-tree.c (show_omp_clauses): Handle it.
1374 * openmp.c (gfc_match_omp_clauses): Likewise.
1375 * trans-openmp.c (gfc_trans_omp_clauses): Likewise.
1376
1377 2017-05-18 Fritz Reese <fritzoreese@gmail.com>
1378
1379 PR fortran/79968
1380 * decl.c (match_attr_spec, gfc_match_automatic,
1381 gfc_match_static, gfc_match_structure_decl): Unify diagnostic
1382 errors regarding -fdec options.
1383 * io.c (match_dec_etag, match_dec_vtag, match_dec_ftag): Ditto.
1384
1385 2017-05-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1386
1387 PR fortran/80741
1388 * trans-io.c (transfer_namelist_element): Change check from
1389 NULL_TREE to null_pointer_node.
1390
1391 2017-05-17 Fritz Reese <fritzoreese@gmail.com>
1392
1393 PR fortran/80668
1394 * expr.c (component_initializer): Don't generate initializers for
1395 pointer components.
1396 * invoke.texi (-finit-derived): Document.
1397
1398 2017-05-16 Paul Thomas <pault@gcc.gnu.org>
1399
1400 PR fortran/80554
1401 * decl.c (build_sym): In a submodule allow overriding of host
1402 associated symbols from the ancestor module with a new
1403 declaration.
1404
1405 2017-05-15 Steven G. Kargl <kargl@gcc.gnu.org>
1406
1407 PR fortran/80674
1408 * trans-stmt.c (gfc_trans_integer_select): Remove redundant condition.
1409
1410 2017-05-15 Steven G. Kargl <kargl@gcc.gnu.org>
1411
1412 PR fortran/80752
1413 * expr.c (gfc_generate_initializer): If type conversion fails,
1414 check for error and return NULL.
1415
1416 2017-05-14 Nicolas Koenig <koenigni@student.ethz.ch>
1417
1418 PR fortran/80442
1419 * array.c (gfc_ref_dimen_size): Simplify stride
1420 expression
1421 * data.c (gfc_advance_section): Simplify start,
1422 end and stride expressions
1423 (gfc_advance_section): Simplify start and end
1424 expressions
1425 (gfc_get_section_index): Simplify start expression
1426
1427 2017-05-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1428
1429 * io.c (gfc_resolve_dt): Fix returns to bool type.
1430
1431 2017-05-11 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1432
1433 PR fortran/78659
1434 * io.c (dtio_procs_present): Add new function to check for DTIO
1435 procedures relative to I/O statement READ or WRITE.
1436 (gfc_resolve_dt): Add namelist checks using the new function.
1437 * resolve.c (dtio_procs_present): Remove function and related
1438 namelist checks. (resolve_fl_namelist): Add check specific to
1439 Fortran 95 restriction on namelist objects.
1440
1441 2017-05-11 Nathan Sidwell <nathan@acm.org>
1442
1443 * trans-decl.c: Include dumpfile.h not tree-dump.h,
1444
1445 2017-05-09 Janus Weil <janus@gcc.gnu.org>
1446
1447 PR fortran/79311
1448 * resolve.c (gfc_resolve_finalizers): Ensure that derived-type
1449 components have a their finalizers resolved, also if the superordinate
1450 type itself has a finalizer.
1451
1452 2017-05-08 Thomas Koenig <tkoenig@gcc.gnu.org>
1453
1454 PR fortran/79930
1455 * frontend-passes.c (matmul_to_var_expr): New function,
1456 add prototype.
1457 (matmul_to_var_code): Likewise.
1458 (optimize_namespace): Use them from gfc_code_walker.
1459
1460 2017-05-05 David Malcolm <dmalcolm@redhat.com>
1461
1462 * cpp.c (cb_cpp_error): Replace report_diagnostic
1463 with diagnostic_report_diagnostic.
1464 * error.c (gfc_warning): Likewise.
1465 (gfc_warning_now_at): Likewise.
1466 (gfc_warning_now): Likewise.
1467 (gfc_warning_internal): Likewise.
1468 (gfc_error_now): Likewise.
1469 (gfc_fatal_error): Likewise.
1470 (gfc_error_opt): Likewise.
1471 (gfc_internal_error): Likewise.
1472
1473 2017-05-01 Thomas Koenig <tkoenig@gcc.gnu.org>
1474
1475 PR fortran/37131
1476 * frontend-passes.c (inline_matmul_assign): Also check bounds
1477 for allocatable lhs and matrix-vector-multiplication.
1478
1479 2017-04-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1480
1481 PR fortran/80484
1482 * io.c (format_lex): Check for '/' and set token to FMT_SLASH.
1483 (check_format): Move FMT_DT checking code to data_desc section.
1484 * module.c (gfc_match_use): Include the case of INTERFACE_DTIO.
1485
1486 2017-04-22 Janus Weil <janus@gcc.gnu.org>
1487
1488 PR fortran/80121
1489 * trans-types.c (gfc_conv_procedure_call): Deallocate the components
1490 of allocatable intent(out) arguments.
1491
1492 2017-04-21 Janus Weil <janus@gcc.gnu.org>
1493
1494 PR fortran/80392
1495 * trans-types.c (gfc_get_derived_type): Prevent an infinite loop when
1496 building a derived type that includes a procedure pointer component
1497 with a polymorphic result.
1498
1499 2017-04-17 Paul Thomas <pault@gcc.gnu.org>
1500
1501 PR fortran/80440
1502 * module.c (find_symtree_for_symbol): Delete.
1503 (read_module): Remove the call to the above.
1504
1505 2017-04-14 Janus Weil <janus@gcc.gnu.org>
1506
1507 PR fortran/80361
1508 * class.c (generate_finalization_wrapper): Give the finalization wrapper
1509 the recursive attribute.
1510
1511 2017-04-10 Nicolas Koenig <koenigni@student.ethz.ch>
1512 Paul Thomas <pault@gcc.gnu.org>
1513
1514 PR fortran/69498
1515 * module.c (gfc_match_submodule): Add error
1516 if function is called in the wrong state.
1517
1518 2017-04-10 Janus Weil <janus@gcc.gnu.org>
1519
1520 PR fortran/80046
1521 * expr.c (gfc_check_pointer_assign): Check if procedure pointer
1522 components in a pointer assignment need an explicit interface.
1523
1524 2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch>
1525
1526 PR fortran/69498
1527 * symbol.c (gfc_delete_symtree): If there is a period in the name, ignore
1528 everything before it.
1529
1530 2017-03-28 Janus Weil <janus@gcc.gnu.org>
1531
1532 PR fortran/78661
1533 * trans-io.c (transfer_namelist_element): Perform a polymorphic call
1534 to a DTIO procedure if necessary.
1535
1536 2017-03-25 Paul Thomas <pault@gcc.gnu.org>
1537
1538 PR fortran/80156
1539 PR fortran/79382
1540 * decl.c (access_attr_decl): Remove the error for an absent
1541 generic DTIO interface and ensure that symbol has the flavor
1542 FL_PROCEDURE.
1543
1544 2017-03-22 Dominique d'Humieres <dominiq@lps.ens.fr>
1545
1546 PR fortran/79838
1547 * module.c: Remove trailing period.
1548
1549 2017-03-22 Dominique d'Humieres <dominiq@lps.ens.fr>
1550
1551 PR fortran/79602
1552 * decl.c: Replace '%s' with %qs.
1553 * expr.c: Likewise.
1554 * interface.c: Likewise.
1555 * match.c: Likewise.
1556 * primary.c: Likewise.
1557 * resolve.c: Likewise.
1558
1559 PR fortran/79844
1560 PR fortran/80011
1561 * io.c: Remove trailing spaces.
1562 * match.c: Likewise.
1563 * openmp.c: Likewise.
1564 * resolve.c: Likewise.
1565 * trans-intrinsic.c: Likewise.
1566
1567 PR fortran/79853
1568 * expr.c: Remove a double spaces.
1569
1570 PR fortran/79859
1571 * primary.c: Remove spurious quotes around %qs.
1572
1573 2017-03-22 Thomas Koenig <tkoenig@gcc.gnu.org>
1574
1575 PR fortran/80142
1576 * frontend-passes.c (combine_array_constructor): Take
1577 location of new expression from constructor expression instead
1578 of constructor.
1579
1580 2017-03-20 Nicolas Koenig <koenigni@student.ethz.ch>
1581
1582 PR fortran/39239
1583 * symbol.c (check_conflict): Report an error if an EQUIVALENCE
1584 object is BIND(C)
1585
1586 2017-03-18 Nicolas Koenig <koenigni@student.ethz.ch>
1587
1588 PR fortran/69498
1589 * decl.c (add_hidden_procptr_result): Fixed Refs count of the
1590 created "ppr@" symbol.
1591
1592 2017-03-18 Paul Thomas <pault@gcc.gnu.org>
1593
1594 PR fortran/79676
1595 * module.c (mio_symbol_attribute): Remove reset of the flag
1596 'no_module_procedures'.
1597 (check_for_module_procedures): New function. Move declaration
1598 of 'no_module_procedures' to above it.
1599 (gfc_dump_module): Traverse namespace calling new function.
1600
1601 2017-03-18 Paul Thomas <pault@gcc.gnu.org>
1602
1603 PR fortran/71838
1604 * symbol.c (check_conflict): A dummy procedure in a submodule,
1605 module procedure is not an error.
1606 (gfc_add_flavor): Ditto.
1607
1608 2017-03-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1609
1610 PR fortran/79841
1611 * openmp.c (check_symbol_not_pointer): Adjust diagnostics.
1612
1613 2017-03-16 Jakub Jelinek <jakub@redhat.com>
1614
1615 PR fortran/80010
1616 * parse.c (gfc_ascii_statement): Use !$ACC for ST_OACC_ATOMIC
1617 and ST_OACC_END_ATOMIC, instead of !ACC.
1618 * trans-decl.c (finish_oacc_declare): Use !$ACC instead of $!ACC.
1619 * openmp.c (gfc_match_oacc_declare, gfc_match_oacc_wait,
1620 gfc_resolve_oacc_declare): Likewise.
1621
1622 PR fortran/79886
1623 * error.c (gfc_format_decoder): Rename plus argument to set_locus,
1624 remove ATTRIBUTE_UNUSED from all arguments, call default_tree_printer
1625 if not a Fortran specific spec.
1626 * trans-io.c: Include options.h.
1627 (gfc_build_st_parameter): Temporarily disable -Wpadded around layout
1628 of artificial IO data structures.
1629
1630 2017-03-15 David Malcolm <dmalcolm@redhat.com>
1631
1632 PR fortran/79860
1633 * resolve.c (resolve_contained_fntype): Make error messages more
1634 amenable to translation.
1635
1636 2017-03-06 Richard Biener <rguenther@suse.de>
1637
1638 PR fortran/79894
1639 * trans.c (gfc_add_modify_loc): Weaken assert.
1640
1641 2017-03-05 Andre Vehreschild <vehre@gcc.gnu.org>,
1642 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
1643
1644 * check.c (positive_check): Add new function checking constant for
1645 being greater then zero.
1646 (gfc_check_image_status): Add checking of image_status arguments.
1647 (gfc_check_failed_or_stopped_images): Same but for failed_- and
1648 stopped_images function.
1649 * dump-parse-tree.c (show_code_node): Added output of FAIL IMAGE.
1650 * gfortran.h (enum gfc_statement): Added FAIL_IMAGE_ST.
1651 (enum gfc_isym_id): Added new intrinsic symbols.
1652 (enum gfc_exec_op): Added EXEC_FAIL_IMAGE.
1653 * gfortran.texi: Added description for the new API functions. Updated
1654 coverage of gfortran of TS18508.
1655 * intrinsic.c (add_functions): Added symbols to resolve new intrinsic
1656 functions.
1657 * intrinsic.h: Added prototypes.
1658 * iresolve.c (gfc_resolve_failed_images): Resolve the failed_images
1659 intrinsic.
1660 (gfc_resolve_image_status): Same for image_status.
1661 (gfc_resolve_stopped_images): Same for stopped_images.
1662 * libgfortran.h: Added prototypes.
1663 * match.c (gfc_match_if): Added matching of FAIL IMAGE statement.
1664 (gfc_match_fail_image): Match a FAIL IMAGE statement.
1665 * match.h: Added prototype.
1666 * parse.c (decode_statement): Added matching for FAIL IMAGE.
1667 (next_statement): Same.
1668 (gfc_ascii_statement): Same.
1669 * resolve.c: Same.
1670 * simplify.c (gfc_simplify_failed_or_stopped_images): For COARRAY=
1671 single a constant result can be returne.d
1672 (gfc_simplify_image_status): For COARRAY=single the result is constant.
1673 * st.c (gfc_free_statement): Added FAIL_IMAGE handling.
1674 * trans-decl.c (gfc_build_builtin_function_decls): Added decls of the
1675 new intrinsics.
1676 * trans-expr.c (gfc_conv_procedure_call): This is first time all
1677 arguments of a function are optional, which is now handled here
1678 correctly.
1679 * trans-intrinsic.c (conv_intrinsic_image_status): Translate
1680 image_status.
1681 (gfc_conv_intrinsic_function): Add support for image_status.
1682 (gfc_is_intrinsic_libcall): Add support for the remaining new
1683 intrinsics.
1684 * trans-stmt.c (gfc_trans_fail_image): Trans a fail image.
1685 * trans-stmt.h: Add the prototype for the above.
1686 * trans.c (trans_code): Dispatch for fail_image.
1687 * trans.h: Add the trees for the new intrinsics.
1688
1689 2017-03-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
1690
1691 PR fortran/79841
1692 * openmp.c (check_symbol_not_pointer): Adjust diagnostic.
1693
1694 2017-02-28 Paul Thomas <pault@gcc.gnu.org>
1695
1696 PR fortran/79739
1697 * resolve.c (resolve_fl_procedure): Deal with the case where
1698 'submodule_name' is NULL so that gfc_error does not ICE.
1699 Reformat the error message to make it more consistent.
1700
1701 2017-02-28 Jakub Jelinek <jakub@redhat.com>
1702
1703 * parse.c (parse_critical_block): Use cond ? G_("...") : G_("...")
1704 instead of just cond ? "..." : "...".
1705 * scanner.c (gfc_next_char_literal): Likewise.
1706 * match.c (match_exit_cycle): Likewise.
1707
1708 2017-02-26 Thomas Koenig <tkoenig@gcc.gnu.org>
1709
1710 PR fortran/51119
1711 * options.c (gfc_post_options): Set default limit for matmul
1712 inlining to 30.
1713 * invoke.texi: Document change.
1714
1715 2017-02-25 Dominique d'Humieres <dominiq@lps.ens.fr>
1716
1717 PR fortran/79601
1718 * interface.c (check_dtio_arg_TKR_intent): Change 'intent'
1719 to 'INTENT'.
1720
1721 2017-02-25 Dominique d'Humieres <dominiq@lps.ens.fr>
1722
1723 PR fortran/79597
1724 * interface.c (gfc_match_end_interface): Remove spurious comma
1725 and space, replace 'got %s' with 'got %qs'.
1726
1727 2017-02-20 Paul Thomas <pault@gcc.gnu.org>
1728
1729 PR fortran/79599
1730 * interface.c (check_dtio_arg_TKR_intent): Supply 'must'
1731 missing from error message.
1732
1733 2017-02-20 Paul Thomas <pault@gcc.gnu.org>
1734
1735 PR fortran/79523
1736 * interface.c (gfc_find_typebound_dtio_proc): Guard test for
1737 flavor attribute by checking that symbol is resolved.
1738
1739 2017-02-16 Paul Thomas <pault@gcc.gnu.org>
1740
1741 PR fortran/79382
1742 * decl.c (access_attr_decl): Test for presence of generic DTIO
1743 interface and emit error if not present.
1744
1745 2017-02-20 Paul Thomas <pault@gcc.gnu.org>
1746
1747 PR fortran/79434
1748 * parse.c (check_component, parse_union): Whitespace.
1749 (set_syms_host_assoc): For a derived type, check if the module
1750 in which it was declared is one of the submodule ancestors. If
1751 it is, make the components public. Otherwise, reset attribute
1752 'host_assoc' and set 'use-assoc' so that encapsulation is
1753 preserved.
1754
1755 2017-02-19 Paul Thomas <pault@gcc.gnu.org>
1756
1757 PR fortran/79447
1758 * decl.c (gfc_set_constant_character_len): Whitespace.
1759 (gfc_match_end): Catch case where a procedure is contained in
1760 a module procedure and ensure that 'end procedure' is the
1761 correct termination.
1762
1763 2017-02-19 Paul Thomas <pault@gcc.gnu.org>
1764
1765 PR fortran/79402
1766 * resolve.c (fixup_unique_dummy): New function.
1767 (gfc_resolve_expr): Call it for dummy variables with a unique
1768 symtree name.
1769
1770 2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
1771
1772 PR fortran/79229
1773 * trans-expr.c (gfc_trans_assignment_1): Deref indirect refs when
1774 compiling with -fcheck=mem to check the pointer and not the data.
1775
1776 2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
1777
1778 PR fortran/79335
1779 * trans-array.c (duplicate_allocatable_coarray): Ensure attributes
1780 passed are properly initialized.
1781 (structure_alloc_comps): Same.
1782 * trans-expr.c (gfc_trans_structure_assign): Same.
1783
1784 2017-02-13 Jakub Jelinek <jakub@redhat.com>
1785
1786 * trans-expr.c (gfc_conv_substring): Add missing space in diagnostics.
1787
1788 2017-02-12 Thomas Koenig <tkoenig@gcc.gnu.org>
1789
1790 PR fortran/65542
1791 * intrinsic.c (gfc_intrinsic_func_interface): Return an error
1792 for -std=f95 for disallowed transformational functions in
1793 initialization expressions.
1794
1795 2017-02-09 Cesar Philippidis <cesar@codesourcery.com>
1796 Joseph Myers <joseph@codesourcery.com>
1797
1798 * openmp.c (resolve_omp_clauses): Error on directives
1799 containing both tile and collapse clauses.
1800 (resolve_oacc_loop_blocks): Represent '*' tile arguments as zero.
1801 * trans-openmp.c (gfc_trans_omp_do): Lower tiled loops like
1802 collapsed loops.
1803
1804 2017-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
1805
1806 * trans-types.c (gfc_get_int_kind_from_width_isofortranen): Choose
1807 REAL type with the widest precision if two (or more) have the same
1808 storage size.
1809
1810 2017-02-05 Andre Vehreschild <vehre@gcc.gnu.org>
1811
1812 PR fortran/79344
1813 * trans-stmt.c (gfc_trans_allocate): Only deallocate the components of
1814 the temporary, when a new object was created for the temporary. Not
1815 when it is just an alias to an existing object.
1816
1817 2017-02-05 Andre Vehreschild <vehre@gcc.gnu.org>
1818
1819 PR fortran/79335
1820 * trans-decl.c (generate_coarray_sym_init): Retrieve the symbol's
1821 attributes before using them.
1822
1823 2017-02-05 Andre Vehreschild <vehre@gcc.gnu.org>
1824
1825 PR fortran/78958
1826 * trans-stmt.c (gfc_trans_allocate): Add the multiplying the _len
1827 component of unlimited polymorphic objects when source-allocating.
1828
1829 2017-02-05 Andre Vehreschild <vehre@gcc.gnu.org>
1830
1831 PR fortran/79230
1832 * trans-array.c (structure_alloc_comps): Ignore pointer components when
1833 freeing structures.
1834
1835 2017-01-25 Maxim Ostapenko <m.ostapenko@samsung.com>
1836
1837 PR lto/79061
1838 * f95-lang.c (gfc_create_decls): Include stringpool.h.
1839 Pass main_input_filename to build_translation_unit_decl.
1840
1841 2017-01-23 Thomas Koenig <tkoenig@netcologne.de>
1842
1843 * arith.c (arith_power): If simplifying integer power expression
1844 to zero, warn if -Winteger-division is given.
1845
1846 2017-01-22 Jakub Jelinek <jakub@redhat.com>
1847
1848 PR fortran/79154
1849 * parse.c (matchs, matcho, matchds, matchdo): Replace return st;
1850 with { ret = st; goto finish; }.
1851 (decode_omp_directive): Allow declare simd, declare target and
1852 simd directives in PURE/ELEMENTAL procedures. Only call
1853 gfc_unset_implicit_pure on successful match of other procedures.
1854
1855 2017-01-21 Gerald Pfeifer <gerald@pfeifer.com>
1856
1857 * gfc-internals.texi (Symbol Versioning): Change references
1858 to www.akkadia.org to https.
1859
1860 2017-01-21 Jakub Jelinek <jakub@redhat.com>
1861
1862 * gfortran.h (gfc_extract_int): Change return type to bool. Add
1863 int argument with = 0.
1864 * decl.c (gfc_match_kind_spec): Adjust gfc_extract_int caller, pass
1865 1 as new last argument to it, don't emit gfc_error.
1866 (match_char_kind): Likewise.
1867 (gfc_match_decl_type_spec): Use gfc_get_string ("%s", x) instead of
1868 gfc_get_string (x).
1869 (gfc_match_derived_decl, match_binding_attributes): Likewise.
1870 (gfc_match_structure_decl): Don't sprintf back to name, call
1871 get_struct_decl directly with gfc_dt_upper_string (name) result.
1872 * trans-stmt.c (gfc_trans_allocate): Use gfc_get_string ("%s", x)
1873 instead of gfc_get_string (x).
1874 * module.c (gfc_dt_lower_string, gfc_dt_upper_string,
1875 gfc_match_use, gfc_match_submodule, find_true_name, mio_pool_string,
1876 mio_symtree_ref, mio_expr, mio_omp_udr_expr, load_generic_interfaces,
1877 load_omp_udrs, load_needed, read_module, dump_module,
1878 create_intrinsic_function, import_iso_c_binding_module,
1879 create_int_parameter, create_int_parameter_array, create_derived_type,
1880 use_iso_fortran_env_module): Likewise.
1881 * error.c (gfc_diagnostic_starter, gfc_diagnostic_start_span): Use
1882 pp_verbatim (context->printer, "%s", x) instead of
1883 pp_verbatim (context->printer, x).
1884 * match.c (gfc_match_small_int): Adjust gfc_extract_int caller, pass
1885 1 as new last argument to it, don't emit gfc_error.
1886 (gfc_match_small_int_expr): Likewise.
1887 * iresolve.c (gfc_get_string): Optimize format "%s" case.
1888 (resolve_bound): Use gfc_get_string ("%s", x) instead of
1889 gfc_get_string (x).
1890 (resolve_transformational): Formatting fix.
1891 (gfc_resolve_char_achar): Change name argument to bool is_achar,
1892 use a single format string and if is_achar add "a" before "char".
1893 (gfc_resolve_achar, gfc_resolve_char): Adjust callers.
1894 * expr.c (gfc_extract_int): Change return type to bool, return true
1895 if some error occurred. Add REPORT_ERROR argument, if non-zero
1896 call either gfc_error or gfc_error_now depending on its sign.
1897 * arith.c (arith_power): Adjust gfc_extract_int caller.
1898 * symbol.c (gfc_add_component): Use gfc_get_string ("%s", x) instead
1899 of gfc_get_string (x).
1900 (gfc_new_symtree, gfc_delete_symtree, gfc_get_uop, gfc_new_symbol,
1901 gfc_get_gsymbol, generate_isocbinding_symbol): Likewise.
1902 * openmp.c (gfc_match_omp_clauses): Adjust gfc_extract_int caller, pass
1903 -1 as new last argument to it, don't emit gfc_error_now.
1904 (gfc_match_omp_declare_reduction): Use gfc_get_string ("%s", x)
1905 instead of gfc_get_string (x).
1906 * check.c (kind_check): Adjust gfc_extract_int caller.
1907 * intrinsic.c (add_sym, find_sym, make_alias): Use
1908 gfc_get_string ("%s", x) instead of gfc_get_string (x).
1909 * simplify.c (get_kind, gfc_simplify_btest, gfc_simplify_maskr,
1910 gfc_simplify_maskl, gfc_simplify_poppar, gfc_simplify_repeat,
1911 gfc_simplify_selected_int_kind, gfc_simplify_selected_real_kind):
1912 Adjust gfc_extract_int callers.
1913 * trans-decl.c (gfc_find_module): Use gfc_get_string ("%s", x)
1914 instead of gfc_get_string (x).
1915 * matchexp.c (expression_syntax): Add const.
1916 * primary.c (match_kind_param, match_hollerith_constant,
1917 match_string_constant): Adjust gfc_extract_int callers.
1918 (match_keyword_arg): Use gfc_get_string ("%s", x) instead of
1919 gfc_get_string (x).
1920 * frontend-passes.c (optimize_minmaxloc): Likewise.
1921
1922 2017-01-19 Andre Vehreschild <vehre@gcc.gnu.org>
1923
1924 PR fortran/70696
1925 * trans-decl.c (gfc_build_qualified_array): Add static decl to parent
1926 function only, when the decl-context is not the translation unit.
1927
1928 2017-01-18 Louis Krupp <louis.krupp@zoho.com>
1929
1930 PR fortran/50069
1931 PR fortran/55086
1932 * trans-expr.c (gfc_conv_variable): Don't treat temporary variables
1933 as function arguments.
1934 * trans-stmt.c (forall_make_variable_temp,
1935 generate_loop_for_temp_to_lhs, gfc_trans_assign_need_temp,
1936 gfc_trans_forall_1): Don't adjust offset of forall temporary
1937 for array sections, make forall temporaries work for substring
1938 expressions, improve test coverage by adding -ftest-forall-temp
1939 option to request usage of temporary array in forall code.
1940 * lang.opt: Add -ftest-forall-temp option.
1941 * invoke.texi: Add -ftest-forall-temp option.
1942
1943 2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
1944
1945 * primary.c (caf_variable_attr): Improve figuring whether the current
1946 component is the last one refed.
1947 * trans-stmt.c (gfc_trans_allocate): Do not generate sync_all calls
1948 when allocating pointer or allocatable components.
1949
1950 2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
1951
1952 * gfortran.texi: Add missing parameters to caf-API functions. Correct
1953 typos and clarify some descriptions.
1954
1955 2017-01-18 Andre Vehreschild <vehre@gcc.gnu.org>
1956
1957 PR fortran/70696
1958 Missed some cases, here they are:
1959 * trans-decl.c (gfc_build_qualified_array): Add static tokens to the
1960 parent function's scope.
1961 * trans-expr.c (gfc_get_tree_for_caf_expr): Shorten code. Remove
1962 unnecessary assert.
1963
1964 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
1965
1966 PR fortran/70697
1967 * resolve.c (resolve_lock_unlock_event): Resolve the expression for
1968 event's until_count.
1969
1970 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
1971
1972 PR fortran/70696
1973 * trans-expr.c (gfc_get_tree_for_caf_expr): Ensure the backend_decl
1974 is valid before accessing it.
1975
1976 2017-01-09 Jakub Jelinek <jakub@redhat.com>
1977
1978 PR translation/79019
1979 PR translation/79020
1980 * decl.c (attr_decl1): Fix spelling in translatable string.
1981 * intrinsic.texi: Fix spelling - invokation -> invocation.
1982 * lang.opt (faggressive-function-elimination, gfc_convert): Fix
1983 typos in descriptions.
1984 * openmp.c (resolve_omp_clauses): Add missing whitespace to
1985 translatable strings.
1986
1987 2017-01-08 Martin Sebor <msebor@redhat.com>
1988
1989 PR tree-optimization/78913
1990 PR middle-end/77708
1991 * trans-common.c (build_equiv_decl): Increase buffer size to avoid
1992 truncation for any argument.
1993 * trans-types.c (gfc_build_logical_type): Same.
1994
1995 2017-01-07 Andre Vehreschild <vehre@gcc.gnu.org>
1996
1997 PR fortran/78781
1998 PR fortran/78935
1999 * expr.c (gfc_check_pointer_assign): Return the same error message for
2000 rewritten coarray pointer assignments like for plain ones.
2001 * gfortran.h: Change prototype.
2002 * primary.c (caf_variable_attr): Set attributes used ones only only
2003 ones. Add setting of pointer_comp attribute.
2004 (gfc_caf_attr): Add setting of pointer_comp attribute.
2005 * trans-array.c (gfc_array_allocate): Add flag that the component to
2006 allocate is not an ultimate coarray component. Add allocation of
2007 pointer arrays.
2008 (structure_alloc_comps): Extend nullify to treat pointer components in
2009 coarrays correctly. Restructure nullify to remove redundant code.
2010 (gfc_nullify_alloc_comp): Allow setting caf_mode flags.
2011 * trans-array.h: Change prototype of gfc_nullify_alloc_comp ().
2012 * trans-decl.c (generate_coarray_sym_init): Call nullify_alloc_comp for
2013 derived type coarrays with pointer components.
2014 * trans-expr.c (gfc_trans_structure_assign): Also treat pointer
2015 components.
2016 (trans_caf_token_assign): Handle assignment of token of scalar pointer
2017 components.
2018 (gfc_trans_pointer_assignment): Call above routine.
2019 * trans-intrinsic.c (conv_expr_ref_to_caf_ref): Add treating pointer
2020 components.
2021 (gfc_conv_intrinsic_caf_get): Likewise.
2022 (conv_caf_send): Likewise.
2023 * trans-stmt.c (gfc_trans_allocate): After allocating a derived type in
2024 a coarray pre-register the tokens.
2025 (gfc_trans_deallocate): Simply determining the coarray type (scalar or
2026 array) and deregistering it correctly.
2027 * trans-types.c (gfc_typenode_for_spec): Replace in_coarray flag by the
2028 actual codim to allow lookup of array types in the cache.
2029 (gfc_build_array_type): Likewise.
2030 (gfc_get_array_descriptor_base): Likewise.
2031 (gfc_get_array_type_bounds): Likewise.
2032 (gfc_get_derived_type): Likewise.
2033 * trans-types.h: Likewise.
2034 * trans.c (gfc_deallocate_with_status): Enable deregistering of all kind
2035 of coarray components.
2036 (gfc_deallocate_scalar_with_status): Use free() in fcoarray_single mode
2037 instead of caf_deregister.
2038
2039 2017-01-06 Jakub Jelinek <jakub@redhat.com>
2040
2041 * simplify.c (simplify_transformation_to_array): Use
2042 GCC_DIAGNOSTIC_PUSH_IGNORED and GCC_DIAGNOSTIC_POP instead of
2043 #pragma GCC diagnostic {push,ignored,pop}.
2044
2045 2017-01-06 Alexandre Oliva <aoliva@redhat.com>
2046
2047 * simplify.c (simplify_transformation_to_array): Silence
2048 array bounds warning. Fix whitespace.
2049
2050 2017-01-04 Alexandre Oliva <aoliva@redhat.com>
2051
2052 * module.c (load_omp_udrs): Initialize name.
2053
2054 2017-01-02 Janne Blomqvist <jb@gcc.gnu.org>
2055
2056 PR fortran/78534
2057 * trans-expr.c (gfc_trans_string_copy): Rework string copy
2058 algorithm to avoid -Wstringop-overflow warning.
2059
2060 2017-01-01 Jakub Jelinek <jakub@redhat.com>
2061
2062 Update copyright years.
2063
2064 * gfortranspec.c (lang_specific_driver): Update copyright notice
2065 dates.
2066 * gfc-internals.texi: Bump @copying's copyright year.
2067 * gfortran.texi: Ditto.
2068 * intrinsic.texi: Ditto.
2069 * invoke.texi: Ditto.
2070 \f
2071 Copyright (C) 2017 Free Software Foundation, Inc.
2072
2073 Copying and distribution of this file, with or without modification,
2074 are permitted in any medium without royalty provided the copyright
2075 notice and this notice are preserved.