08e7d4cc72523fe93f053684d4c391cba15ef581
[platform/upstream/gcc.git] / gcc / fortran / ChangeLog
1 2021-09-20  Tobias Burnus  <tobias@codesourcery.com>
2
3         * gfortran.h (gfc_omp_clauses): Add order_unconstrained.
4         * dump-parse-tree.c (show_omp_clauses): Dump it.
5         * openmp.c (gfc_match_omp_clauses): Match unconstrained/reproducible
6         modifiers to ordered(concurrent).
7         (OMP_DISTRIBUTE_CLAUSES): Accept ordered clause.
8         (resolve_omp_clauses): Reject ordered + order on same directive.
9         * trans-openmp.c (gfc_trans_omp_clauses, gfc_split_omp_clauses): Pass
10         on unconstrained modifier of ordered(concurrent).
11
12 2021-09-17  Harald Anlauf  <anlauf@gmx.de>
13
14         PR fortran/102366
15         * trans-decl.c (gfc_finish_var_decl): Disable the warning message
16         for variables moved from stack to static storange if they are
17         declared in the main, but allow the move to happen.
18
19 2021-09-17  Sandra Loosemore  <sandra@codesourcery.com>
20
21         * intrinsic.texi (ISO_C_BINDING): Change C_FLOAT128 to correspond
22         to _Float128 rather than __float128.
23         * iso-c-binding.def (c_float128): Update comments.
24         * trans-intrinsic.c (gfc_builtin_decl_for_float_kind): Likewise.
25         (build_round_expr): Likewise.
26         (gfc_build_intrinsic_lib_fndcecls): Likewise.
27         * trans-types.h (gfc_real16_is_float128): Likewise.
28
29 2021-09-16  Harald Anlauf  <anlauf@gmx.de>
30
31         PR fortran/102287
32         * trans-expr.c (gfc_conv_procedure_call): Wrap deallocation of
33         allocatable components of optional allocatable derived type
34         procedure arguments with INTENT(OUT) into a presence check.
35
36 2021-09-14  Harald Anlauf  <anlauf@gmx.de>
37
38         PR fortran/102311
39         * resolve.c (resolve_entries): Attempt to recover cleanly after
40         rejecting mismatched function entries.
41
42 2021-09-14  Tobias Burnus  <tobias@codesourcery.com>
43
44         PR fortran/102313
45         * parse.c (gfc_ascii_statement): Add missing ST_OMP_END_SCOPE.
46
47 2021-09-13  Harald Anlauf  <anlauf@gmx.de>
48
49         PR fortran/82314
50         * decl.c (add_init_expr_to_sym): For proper initialization of
51         array-valued named constants the array bounds need to be
52         simplified before adding the initializer.
53
54 2021-09-13  Harald Anlauf  <anlauf@gmx.de>
55
56         PR fortran/85130
57         * expr.c (find_substring_ref): Handle given substring start and
58         end indices as signed integers, not unsigned.
59
60 2021-09-09  Harald Anlauf  <anlauf@gmx.de>
61
62         PR fortran/98490
63         * trans-expr.c (gfc_conv_substring): Do not generate substring
64         bounds check for implied do loop index variable before it actually
65         becomes defined.
66
67 2021-09-08  liuhongt  <hongtao.liu@intel.com>
68
69         * options.c (gfc_post_options): Issue an error for
70         -fexcess-precision=16.
71
72 2021-09-07  Harald Anlauf  <anlauf@gmx.de>
73
74         PR fortran/101327
75         * expr.c (find_array_element): When bounds cannot be determined as
76         constant, return error instead of aborting.
77
78 2021-09-07  Marcel Vollweiler  <marcel@codesourcery.com>
79
80         * openmp.c (gfc_match_omp_flush): Parse 'seq_cst' clause on 'flush'
81         directive.
82         * trans-openmp.c (gfc_trans_omp_flush): Handle OMP_MEMORDER_SEQ_CST.
83
84 2021-09-03  Tobias Burnus  <tobias@codesourcery.com>
85
86         * decl.c (gfc_verify_c_interop_param): Reject pointer with
87         CONTIGUOUS attributes as dummy arg. Reject character len > 1
88         when passed as byte stream.
89
90 2021-09-01  Harald Anlauf  <anlauf@gmx.de>
91
92         PR fortran/56985
93         * resolve.c (resolve_common_vars): Fix grammar and improve wording
94         of error message rejecting an unlimited polymorphic in COMMON.
95
96 2021-08-31  Harald Anlauf  <anlauf@gmx.de>
97
98         PR fortran/100950
99         * simplify.c (substring_has_constant_len): Minimize checks for
100         substring expressions being allowed.
101
102 2021-08-31  Marcel Vollweiler  <marcel@codesourcery.com>
103
104         * gfortran.h: Add variable for 'ancestor' in struct gfc_omp_clauses.
105         * openmp.c (gfc_match_omp_clauses): Parse device-modifiers 'device_num'
106         and 'ancestor' in 'target device' clauses.
107         * trans-openmp.c (gfc_trans_omp_clauses): Set OMP_CLAUSE_DEVICE_ANCESTOR.
108
109 2021-08-30  Harald Anlauf  <anlauf@gmx.de>
110
111         PR fortran/102113
112         * match.c (gfc_match_goto): Allow for whitespace in parsing list
113         of labels.
114
115 2021-08-30  Harald Anlauf  <anlauf@gmx.de>
116
117         PR fortran/101349
118         * resolve.c (resolve_allocate_expr): An unlimited polymorphic
119         argument to ALLOCATE must be ALLOCATABLE or a POINTER.  Fix the
120         corresponding check.
121
122 2021-08-28  Harald Anlauf  <anlauf@gmx.de>
123
124         PR fortran/87737
125         * resolve.c (resolve_entries): For functions of type CHARACTER
126         tighten the checks for matching characteristics.
127
128 2021-08-25  Lewis Hyatt  <lhyatt@gmail.com>
129
130         PR other/93067
131         * cpp.c (gfc_cpp_post_options): Call new function
132         diagnostic_initialize_input_context().
133
134 2021-08-24  Harald Anlauf  <anlauf@gmx.de>
135
136         PR fortran/98411
137         * trans-decl.c (gfc_finish_var_decl): Adjust check to handle
138         implicit SAVE as well as variables in the main program.  Improve
139         warning message text.
140
141 2021-08-23  Tobias Burnus  <tobias@codesourcery.com>
142
143         * openmp.c (gfc_match_dupl_check, gfc_match_dupl_memorder,
144         gfc_match_dupl_atomic): New.
145         (gfc_match_omp_clauses): Use them; remove duplicate
146         'release'/'relaxed' clause matching; improve error dignostic
147         for 'default'.
148
149 2021-08-23  Tobias Burnus  <tobias@codesourcery.com>
150
151         * dump-parse-tree.c (show_omp_clauses): Handle 'strict' modifier
152         on grainsize/num_tasks
153         * gfortran.h (gfc_omp_clauses): Add grainsize_strict
154         and num_tasks_strict.
155         * trans-openmp.c (gfc_trans_omp_clauses, gfc_split_omp_clauses):
156         Handle 'strict' modifier on grainsize/num_tasks.
157         * openmp.c (gfc_match_omp_clauses): Likewise.
158
159 2021-08-20  Tobias Burnus  <tobias@codesourcery.com>
160
161         * error.c
162         (error_uinteger): Take 'long long unsigned' instead
163         of 'long unsigned' as argumpent.
164         (error_integer): Take 'long long' instead of 'long'.
165         (error_hwuint, error_hwint): New.
166         (error_print): Update to handle 'll' and 'w'
167         length modifiers.
168         * simplify.c (substring_has_constant_len): Use '%wd'
169         in gfc_error.
170
171 2021-08-20  Harald Anlauf  <anlauf@gmx.de>
172
173         PR fortran/100950
174         * simplify.c (substring_has_constant_len): Fix format string of
175         gfc_error, pass HOST_WIDE_INT bounds values via char buffer.
176
177 2021-08-20  Tobias Burnus  <tobias@codesourcery.com>
178
179         * dump-parse-tree.c (show_omp_clauses): Handle 'at', 'severity'
180         and 'message' clauses.
181         (show_omp_node, show_code_node): Handle EXEC_OMP_ERROR.
182         * gfortran.h (gfc_statement): Add ST_OMP_ERROR.
183         (gfc_omp_severity_type, gfc_omp_at_type): New.
184         (gfc_omp_clauses): Add 'at', 'severity' and 'message' clause;
185         use more bitfields + ENUM_BITFIELD.
186         (gfc_exec_op): Add EXEC_OMP_ERROR.
187         * match.h (gfc_match_omp_error): New.
188         * openmp.c (enum omp_mask1): Add OMP_CLAUSE_(AT,SEVERITY,MESSAGE).
189         (gfc_match_omp_clauses): Handle new clauses.
190         (OMP_ERROR_CLAUSES, gfc_match_omp_error): New.
191         (resolve_omp_clauses): Resolve new clauses.
192         (omp_code_to_statement, gfc_resolve_omp_directive): Handle
193         EXEC_OMP_ERROR.
194         * parse.c (decode_omp_directive, next_statement,
195         gfc_ascii_statement): Handle 'omp error'.
196         * resolve.c (gfc_resolve_blocks): Likewise.
197         * st.c (gfc_free_statement): Likewise.
198         * trans-openmp.c (gfc_trans_omp_error): Likewise.
199         (gfc_trans_omp_directive): Likewise.
200         * trans.c (trans_code): Likewise.
201
202 2021-08-20  Jakub Jelinek  <jakub@redhat.com>
203
204         * types.def (BT_FN_VOID_CONST_PTR_SIZE): New DEF_FUNCTION_TYPE_2.
205         * f95-lang.c (ATTR_COLD_NORETURN_NOTHROW_LEAF_LIST): Define.
206
207 2021-08-19  Harald Anlauf  <anlauf@gmx.de>
208
209         PR fortran/100950
210         * simplify.c (substring_has_constant_len): New.
211         (gfc_simplify_len): Handle case of substrings with constant
212         bounds.
213
214 2021-08-18  Tobias Burnus  <tobias@codesourcery.com>
215
216         * match.h (gfc_match_omp_nothing): New.
217         * openmp.c (gfc_match_omp_nothing): New.
218         * parse.c (decode_omp_directive): Match 'nothing' directive.
219
220 2021-08-17  Tobias Burnus  <tobias@codesourcery.com>
221
222         * dump-parse-tree.c (show_omp_node, show_code_node): Handle
223         EXEC_OMP_SCOPE.
224         * gfortran.h (enum gfc_statement): Add ST_OMP_(END_)SCOPE.
225         (enum gfc_exec_op): Add EXEC_OMP_SCOPE.
226         * match.h (gfc_match_omp_scope): New.
227         * openmp.c (OMP_SCOPE_CLAUSES): Define
228         (gfc_match_omp_scope): New.
229         (gfc_match_omp_cancellation_point, gfc_match_omp_end_nowait):
230         Improve error diagnostic.
231         (omp_code_to_statement): Handle ST_OMP_SCOPE.
232         (gfc_resolve_omp_directive): Handle EXEC_OMP_SCOPE.
233         * parse.c (decode_omp_directive, next_statement,
234         gfc_ascii_statement, parse_omp_structured_block,
235         parse_executable): Handle OpenMP's scope construct.
236         * resolve.c (gfc_resolve_blocks): Likewise
237         * st.c (gfc_free_statement): Likewise
238         * trans-openmp.c (gfc_trans_omp_scope): New.
239         (gfc_trans_omp_directive): Call it.
240         * trans.c (trans_code): handle EXEC_OMP_SCOPE.
241
242 2021-08-16  Tobias Burnus  <tobias@codesourcery.com>
243
244         * dump-parse-tree.c (show_omp_clauses): Handle 'filter' clause.
245         (show_omp_node, show_code_node): Handle (combined) omp masked construct.
246         * frontend-passes.c (gfc_code_walker): Likewise.
247         * gfortran.h (enum gfc_statement): Add ST_OMP_*_MASKED*.
248         (enum gfc_exec_op): Add EXEC_OMP_*_MASKED*.
249         * match.h (gfc_match_omp_masked, gfc_match_omp_masked_taskloop,
250         gfc_match_omp_masked_taskloop_simd, gfc_match_omp_parallel_masked,
251         gfc_match_omp_parallel_masked_taskloop,
252         gfc_match_omp_parallel_masked_taskloop_simd): New prototypes.
253         * openmp.c (enum omp_mask1): Add OMP_CLAUSE_FILTER.
254         (gfc_match_omp_clauses): Match it.
255         (OMP_MASKED_CLAUSES, gfc_match_omp_parallel_masked,
256         gfc_match_omp_parallel_masked_taskloop,
257         gfc_match_omp_parallel_masked_taskloop_simd,
258         gfc_match_omp_masked, gfc_match_omp_masked_taskloop,
259         gfc_match_omp_masked_taskloop_simd): New.
260         (resolve_omp_clauses): Resolve filter clause.
261         (gfc_resolve_omp_parallel_blocks, resolve_omp_do,
262         omp_code_to_statement, gfc_resolve_omp_directive): Handle
263         omp masked constructs.
264         * parse.c (decode_omp_directive, case_exec_markers,
265         gfc_ascii_statement, parse_omp_do, parse_omp_structured_block,
266         parse_executable): Likewise.
267         * resolve.c (gfc_resolve_blocks, gfc_resolve_code): Likewise.
268         * st.c (gfc_free_statement): Likewise.
269         * trans-openmp.c (gfc_trans_omp_clauses): Handle filter clause.
270         (GFC_OMP_SPLIT_MASKED, GFC_OMP_MASK_MASKED): New enum values.
271         (gfc_trans_omp_masked): New.
272         (gfc_split_omp_clauses): Handle combined masked directives.
273         (gfc_trans_omp_master_taskloop): Rename to ...
274         (gfc_trans_omp_master_masked_taskloop): ... this; handle also
275         combined masked directives.
276         (gfc_trans_omp_parallel_master): Rename to ...
277         (gfc_trans_omp_parallel_master_masked): ... this; handle
278         combined masked directives.
279         (gfc_trans_omp_directive): Handle EXEC_OMP_*_MASKED*.
280         * trans.c (trans_code): Likewise.
281
282 2021-08-15  Harald Anlauf  <anlauf@gmx.de>
283
284         PR fortran/99351
285         * match.c (sync_statement): Replace %v code by %e in gfc_match to
286         allow for function references as STAT and ERRMSG arguments.
287         * resolve.c (resolve_sync): Adjust checks of STAT= and ERRMSG= to
288         being definable arguments.  Function references with a data
289         pointer result are accepted.
290         * trans-stmt.c (gfc_trans_sync): Adjust assertion.
291
292 2021-08-12  Tobias Burnus  <tobias@codesourcery.com>
293
294         * gfortran.h (gfc_omp_proc_bind_kind): Add OMP_PROC_BIND_PRIMARY.
295         * dump-parse-tree.c (show_omp_clauses): Add TODO comment to
296         change 'master' to 'primary' in proc_bind for OpenMP 5.1.
297         * intrinsic.texi (OMP_LIB): Mention OpenMP 5.1; add
298         omp_proc_bind_primary.
299         * openmp.c (gfc_match_omp_clauses): Accept
300         'primary' as alias for 'master'.
301         * trans-openmp.c (gfc_trans_omp_clauses): Handle
302         OMP_PROC_BIND_PRIMARY.
303
304 2021-08-11  Sandra Loosemore  <sandra@codesourcery.com>
305
306         * iso-c-binding.def (c_float128, c_float128_complex): Check
307         float128_type_node instead of gfc_float128_type_node.
308         * trans-types.c (gfc_init_kinds, gfc_build_real_type):
309         Update comments re supported 128-bit floating-point types.
310
311 2021-08-11  Richard Biener  <rguenther@suse.de>
312
313         * trans-common.c (create_common): Set TREE_THIS_VOLATILE on the
314         COMPONENT_REF if the field is volatile.
315
316 2021-08-07  Harald Anlauf  <anlauf@gmx.de>
317
318         PR fortran/68568
319         * primary.c (gfc_expr_attr): Variable attribute can only be
320         inquired when symtree is non-NULL.
321
322 2021-07-28  Harald Anlauf  <anlauf@gmx.de>
323
324         PR fortran/101564
325         * expr.c (gfc_check_vardef_context): Add check for KIND and LEN
326         parameter inquiries.
327         * match.c (gfc_match): Fix comment for %v code.
328         (gfc_match_allocate, gfc_match_deallocate): Replace use of %v code
329         by %e in gfc_match to allow for function references as STAT and
330         ERRMSG arguments.
331         * resolve.c (resolve_allocate_deallocate): Avoid NULL pointer
332         dereferences and shortcut for bad STAT and ERRMSG argument to
333         (DE)ALLOCATE.  Remove bogus parts of checks for STAT and ERRMSG.
334
335 2021-07-26  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
336             Tobias Burnus  <tobias@codesourcery.com>
337
338         PR fortran/93308
339         PR fortran/93963
340         PR fortran/94327
341         PR fortran/94331
342         PR fortran/97046
343         * trans-decl.c (convert_CFI_desc): Only copy out the descriptor
344         if necessary.
345         * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Updated attribute
346         handling which reflect a previous intermediate version of the
347         standard. Only copy out the descriptor if necessary.
348
349 2021-07-23  Harald Anlauf  <anlauf@gmx.de>
350
351         PR fortran/101536
352         * check.c (array_check): Adjust check for the case of CLASS
353         arrays.
354
355 2021-07-21  Thomas Schwinge  <thomas@codesourcery.com>
356             Joseph Myers  <joseph@codesourcery.com>
357             Cesar Philippidis  <cesar@codesourcery.com>
358
359         * dump-parse-tree.c (show_attr): Update.
360         * gfortran.h (symbol_attribute): Add 'oacc_routine_nohost' member.
361         (gfc_omp_clauses): Add 'nohost' member.
362         * module.c (ab_attribute): Add 'AB_OACC_ROUTINE_NOHOST'.
363         (attr_bits, mio_symbol_attribute): Update.
364         * openmp.c (omp_mask2): Add 'OMP_CLAUSE_NOHOST'.
365         (gfc_match_omp_clauses): Handle 'OMP_CLAUSE_NOHOST'.
366         (OACC_ROUTINE_CLAUSES): Add 'OMP_CLAUSE_NOHOST'.
367         (gfc_match_oacc_routine): Update.
368         * trans-decl.c (add_attributes_to_decl): Update.
369         * trans-openmp.c (gfc_trans_omp_clauses): Likewise.
370
371 2021-07-21  Harald Anlauf  <anlauf@gmx.de>
372
373         PR fortran/101514
374         * target-memory.c (gfc_interpret_derived): Size of array component
375         of derived type can only be computed here for explicit shape.
376         * trans-types.c (gfc_get_nodesc_array_type): Do not dereference
377         NULL pointers.
378
379 2021-07-21  Tobias Burnus  <tobias@codesourcery.com>
380
381         * decl.c (gfc_verify_c_interop_param): Update for F2008 + F2018
382         changes; reject unsupported bits with 'Error: Sorry,'.
383         * trans-expr.c (gfc_conv_procedure_call): Fix condition to
384         For using CFI descriptor with characters.
385
386 2021-07-18  Harald Anlauf  <anlauf@gmx.de>
387
388         PR fortran/101084
389         * io.c (resolve_tag_format): Extend FORMAT check to unknown type.
390
391 2021-07-14  Harald Anlauf  <anlauf@gmx.de>
392
393         PR fortran/100949
394         * trans-expr.c (gfc_trans_class_init_assign): Call
395         gfc_conv_expr_present only for dummy variables.
396
397 2021-07-06  Thomas Koenig  <tkoenig@gcc.gnu.org>
398
399         PR fortran/100227
400         * frontend-passes.c (traverse_io_block): Adjust test for
401         when a variable is eligible for the transformation to
402         array slice.
403
404 2021-06-28  Martin Sebor  <msebor@redhat.com>
405
406         * trans-array.c (trans_array_constructor): Replace direct uses
407         of TREE_NO_WARNING with warning_suppressed_p, and suppress_warning.
408         * trans-decl.c (gfc_build_qualified_array): Same.
409         (gfc_build_dummy_array_decl): Same.
410         (generate_local_decl): Same.
411         (gfc_generate_function_code): Same.
412         * trans-openmp.c (gfc_omp_clause_default_ctor): Same.
413         (gfc_omp_clause_copy_ctor): Same.
414         * trans-types.c (get_dtype_type_node): Same.
415         (gfc_get_desc_dim_type): Same.
416         (gfc_get_array_descriptor_base): Same.
417         (gfc_get_caf_vector_type): Same.
418         (gfc_get_caf_reference_type): Same.
419         * trans.c (gfc_create_var_np): Same.
420
421 2021-06-23  Tobias Burnus  <tobias@codesourcery.com>
422
423         * dump-parse-tree.c (show_omp_clauses): Fix enum type used
424         for dumping gfc_omp_defaultmap_category.
425
426 2021-06-23  Andre Vehreschild  <vehre@gcc.gnu.org>
427
428         PR fortran/100337
429         * trans-intrinsic.c (conv_co_collective): Check stat for null ptr
430         before dereferrencing.
431
432 2021-06-18  Harald Anlauf  <anlauf@gmx.de>
433
434         PR fortran/100283
435         PR fortran/101123
436         * trans-intrinsic.c (gfc_conv_intrinsic_minmax): Unconditionally
437         convert result of min/max to result type.
438
439 2021-06-16  Harald Anlauf  <anlauf@gmx.de>
440
441         PR fortran/95501
442         PR fortran/95502
443         * expr.c (gfc_check_pointer_assign): Avoid NULL pointer
444         dereference.
445         * match.c (gfc_match_pointer_assignment): Likewise.
446         * parse.c (gfc_check_do_variable): Avoid comparison with NULL
447         symtree.
448
449 2021-06-16  Harald Anlauf  <anlauf@gmx.de>
450
451         Revert:
452         2021-06-16  Harald Anlauf  <anlauf@gmx.de>
453
454         PR fortran/95501
455         PR fortran/95502
456         * expr.c (gfc_check_pointer_assign): Avoid NULL pointer
457         dereference.
458         * match.c (gfc_match_pointer_assignment): Likewise.
459         * parse.c (gfc_check_do_variable): Avoid comparison with NULL
460         symtree.
461
462 2021-06-16  Harald Anlauf  <anlauf@gmx.de>
463
464         PR fortran/95501
465         PR fortran/95502
466         * expr.c (gfc_check_pointer_assign): Avoid NULL pointer
467         dereference.
468         * match.c (gfc_match_pointer_assignment): Likewise.
469         * parse.c (gfc_check_do_variable): Avoid comparison with NULL
470         symtree.
471
472 2021-06-15  Tobias Burnus  <tobias@codesourcery.com>
473
474         PR fortran/92568
475         * dump-parse-tree.c (show_omp_clauses): Update for defaultmap.
476         * f95-lang.c (LANG_HOOKS_OMP_ALLOCATABLE_P,
477         LANG_HOOKS_OMP_SCALAR_TARGET_P): New.
478         * gfortran.h (enum gfc_omp_defaultmap,
479         enum gfc_omp_defaultmap_category): New.
480         * openmp.c (gfc_match_omp_clauses): Update defaultmap matching.
481         * trans-decl.c (gfc_finish_decl_attrs): Set GFC_DECL_SCALAR_TARGET.
482         * trans-openmp.c (gfc_omp_allocatable_p, gfc_omp_scalar_target_p): New.
483         (gfc_omp_scalar_p): Take 'ptr_alloc_ok' argument.
484         (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
485         defaultmap changes.
486         * trans.h (gfc_omp_scalar_p): Update prototype.
487         (gfc_omp_allocatable_p, gfc_omp_scalar_target_p): New.
488         (struct lang_decl): Add scalar_target.
489         (GFC_DECL_SCALAR_TARGET, GFC_DECL_GET_SCALAR_TARGET): New.
490
491 2021-06-14  Tobias Burnus  <tobias@codesourcery.com>
492
493         * resolve.c (resolve_variable): Remove *XCNEW used to
494         nullify nullified memory.
495
496 2021-06-09  Martin Liska  <mliska@suse.cz>
497
498         * intrinsic.texi: Add missing @headitem to tables with a header.
499
500 2021-06-09  Jakub Jelinek  <jakub@redhat.com>
501
502         PR fortran/100965
503         * trans-openmp.c (gfc_omp_finish_clause): Gimplify OMP_CLAUSE_SIZE.
504
505 2021-06-08  Tobias Burnus  <tobias@codesourcery.com>
506
507         PR middle-end/99928
508         * trans-openmp.c (gfc_add_clause_implicitly): New.
509         (gfc_split_omp_clauses): Use it.
510         (gfc_free_split_omp_clauses): New.
511         (gfc_trans_omp_do_simd, gfc_trans_omp_parallel_do,
512         gfc_trans_omp_parallel_do_simd, gfc_trans_omp_distribute,
513         gfc_trans_omp_teams, gfc_trans_omp_target, gfc_trans_omp_taskloop,
514         gfc_trans_omp_master_taskloop, gfc_trans_omp_parallel_master): Use it.
515
516 2021-06-08  Martin Liska  <mliska@suse.cz>
517
518         * intrinsic.texi: Fix typo.
519         * trans-expr.c (gfc_trans_pointer_assignment): Likewise.
520
521 2021-06-05  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
522
523         PR fortran/100120
524         PR fortran/100816
525         PR fortran/100818
526         PR fortran/100819
527         PR fortran/100821
528         * trans-array.c (gfc_get_array_span): rework the way character
529         array "span" was calculated.
530         (gfc_conv_expr_descriptor): improve handling of character sections
531         and unlimited polymorphic objects.
532         * trans-expr.c (gfc_get_character_len): new function to calculate
533         character string length.
534         (gfc_get_character_len_in_bytes): new function to calculate
535         character string length in bytes.
536         (gfc_conv_scalar_to_descriptor): add call to set the "span".
537         (gfc_trans_pointer_assignment): set "_len" and antecipate the
538         initialization of the deferred character length hidden argument.
539         * trans-intrinsic.c (gfc_conv_associated): set "force_no_tmp" to
540         avoid the creation of a temporary.
541         * trans-types.c (gfc_get_dtype_rank_type): rework type detection
542         so that unlimited polymorphic objects get proper type infomation,
543         also important for bind(c).
544         (gfc_get_dtype): add argument to pass the rank if necessary.
545         (gfc_get_array_type_bounds): cosmetic change to have character
546         arrays called character instead of unknown.
547         * trans-types.h (gfc_get_dtype): modify prototype.
548         * trans.c (get_array_span): rework the way character array "span"
549         was calculated.
550         * trans.h (gfc_get_character_len): new prototype.
551         (gfc_get_character_len_in_bytes): new prototype.
552         Add "unlimited_polymorphic" flag to "gfc_se" type to signal when
553         expression carries an unlimited polymorphic object.
554
555 2021-06-04  Harald Anlauf  <anlauf@gmx.de>
556
557         PR fortran/99839
558         * frontend-passes.c (inline_matmul_assign): Do not inline matmul
559         if the assignment to the resulting array if it is not of canonical
560         type (real/integer/complex/logical).
561
562 2021-06-04  Tobias Burnus  <tobias@codesourcery.com>
563
564         * dump-parse-tree.c (show_code_node): Handle
565         EXEC_OMP_(TARGET_)(,PARALLEL_,TEAMS_)LOOP.
566
567 2021-06-04  Tobias Burnus  <tobias@codesourcery.com>
568
569         * scanner.c (skip_fixed_omp_sentinel): Set openacc_flag if
570         this is not an (OpenMP) continuation line.
571         (skip_fixed_oacc_sentinel): Likewise for openmp_flag and OpenACC.
572         (gfc_next_char_literal): gfc_error_now to force error for mixed OMP/ACC
573         continuation once per location and return '\n'.
574
575 2021-06-04  Tobias Burnus  <tobias@codesourcery.com>
576
577         PR middle-end/99928
578         * openmp.c (gfc_match_omp_clauses): Fix typo in error message.
579
580 2021-06-04  Tobias Burnus  <tobias@codesourcery.com>
581
582         PR middle-end/99928
583         * dump-parse-tree.c (show_omp_clauses): Handle bind clause.
584         (show_omp_node): Handle loop directive.
585         * frontend-passes.c (gfc_code_walker): Likewise.
586         * gfortran.h (enum gfc_statement): Add
587         ST_OMP_(END_)(TARGET_)(|PARALLEL_|TEAMS_)LOOP.
588         (enum gfc_omp_bind_type): New.
589         (gfc_omp_clauses): Use it.
590         (enum gfc_exec_op): Add EXEC_OMP_(TARGET_)(|PARALLEL_|TEAMS_)LOOP.
591         * match.h (gfc_match_omp_loop, gfc_match_omp_parallel_loop,
592         gfc_match_omp_target_parallel_loop, gfc_match_omp_target_teams_loop,
593         gfc_match_omp_teams_loop): New.
594         * openmp.c (enum omp_mask1): Add OMP_CLAUSE_BIND.
595         (gfc_match_omp_clauses): Handle it.
596         (OMP_LOOP_CLAUSES, gfc_match_omp_loop, gfc_match_omp_teams_loop,
597         gfc_match_omp_target_teams_loop, gfc_match_omp_parallel_loop,
598         gfc_match_omp_target_parallel_loop): New.
599         (resolve_omp_clauses, resolve_omp_do, omp_code_to_statement,
600         gfc_resolve_omp_directive): Handle omp loop.
601         * parse.c (decode_omp_directive case_exec_markers, gfc_ascii_statement,
602         parse_omp_do, parse_executable): Likewise.
603         (parse_omp_structured_block): Remove ST_ which use parse_omp_do.
604         * resolve.c (gfc_resolve_blocks): Add omp loop.
605         * st.c (gfc_free_statement): Likewise.
606         * trans-openmp.c (gfc_trans_omp_clauses): Handle bind clause.
607         (gfc_trans_omp_do, gfc_trans_omp_parallel_do, gfc_trans_omp_distribute,
608         gfc_trans_omp_teams, gfc_trans_omp_target, gfc_trans_omp_directive):
609         Handle loop directive.
610         (gfc_split_omp_clauses): Likewise; fix firstprivate/lastprivate
611         and (in_)reduction for taskloop.
612         * trans.c (trans_code): Handle omp loop directive.
613
614 2021-06-01  Tobias Burnus  <tobias@codesourcery.com>
615
616         PR middle-end/99928
617         * dump-parse-tree.c (show_omp_node, show_code_node): Handle
618         (parallel) master taskloop (simd).
619         * frontend-passes.c (gfc_code_walker): Set in_omp_workshare
620         to false for parallel master taskloop (simd).
621         * gfortran.h (enum gfc_statement):
622         Add ST_OMP_(END_)(PARALLEL_)MASTER_TASKLOOP(_SIMD).
623         (enum gfc_exec_op): EXEC_OMP_(PARALLEL_)MASTER_TASKLOOP(_SIMD).
624         * match.h (gfc_match_omp_master_taskloop,
625         gfc_match_omp_master_taskloop_simd,
626         gfc_match_omp_parallel_master_taskloop,
627         gfc_match_omp_parallel_master_taskloop_simd): New prototype.
628         * openmp.c (gfc_match_omp_parallel_master_taskloop,
629         gfc_match_omp_parallel_master_taskloop_simd,
630         gfc_match_omp_master_taskloop,
631         gfc_match_omp_master_taskloop_simd): New.
632         (gfc_match_omp_taskloop_simd): Permit 'reduction' clause.
633         (resolve_omp_clauses): Handle new combined directives; remove
634         inscan-reduction check to reduce multiple errors; add
635         task-reduction error for 'taskloop simd'.
636         (gfc_resolve_omp_parallel_blocks,
637         resolve_omp_do, omp_code_to_statement,
638         gfc_resolve_omp_directive): Handle new combined constructs.
639         * parse.c (decode_omp_directive, next_statement,
640         gfc_ascii_statement, parse_omp_do, parse_omp_structured_block,
641         parse_executable): Likewise.
642         * resolve.c (gfc_resolve_blocks, gfc_resolve_code): Likewise.
643         * st.c (gfc_free_statement): Likewise.
644         * trans.c (trans_code): Likewise.
645         * trans-openmp.c (gfc_split_omp_clauses,
646         gfc_trans_omp_directive): Likewise.
647         (gfc_trans_omp_parallel_master): Move after gfc_trans_omp_master_taskloop;
648         handle parallel master taskloop (simd) as well.
649         (gfc_trans_omp_taskloop): Take gfc_exec_op as arg.
650         (gfc_trans_omp_master_taskloop): New.
651
652 2021-05-30  Gerald Pfeifer  <gerald@pfeifer.com>
653
654         * gfortran.texi (BOZ literal constants): Fix typo.
655
656 2021-05-28  Tobias Burnus  <tobias@codesourcery.com>
657
658         * dump-parse-tree.c (show_iterator): New.
659         (show_omp_namelist): Handle iterators.
660         (show_omp_clauses): Handle affinity.
661         * gfortran.h (gfc_free_omp_namelist): New union with 'udr' and new 'ns'.
662         * match.c (gfc_free_omp_namelist): Add are to choose union element.
663         * openmp.c (gfc_free_omp_clauses, gfc_match_omp_detach,
664         gfc_match_omp_clause_reduction, gfc_match_omp_flush): Update
665         call to gfc_free_omp_namelist.
666         (gfc_match_omp_variable_list): Likewise; permit preceeding whitespace.
667         (enum omp_mask1): Add OMP_CLAUSE_AFFINITY.
668         (gfc_match_iterator): New.
669         (gfc_match_omp_clauses): Use it; update call to gfc_free_omp_namelist.
670         (OMP_TASK_CLAUSES): Add OMP_CLAUSE_AFFINITY.
671         (gfc_match_omp_taskwait): Match depend clause.
672         (resolve_omp_clauses): Handle affinity; update for udr/union change.
673         (gfc_resolve_omp_directive): Resolve clauses of taskwait.
674         * st.c (gfc_free_statement): Update gfc_free_omp_namelist call.
675         * trans-openmp.c (gfc_trans_omp_array_reduction_or_udr): Likewise
676         (handle_iterator): New.
677         (gfc_trans_omp_clauses): Handle iterators for depend/affinity clause.
678         (gfc_trans_omp_taskwait): Handle depend clause.
679         (gfc_trans_omp_directive): Update call.
680
681 2021-05-27  Harald Anlauf  <anlauf@gmx.de>
682
683         PR fortran/100602
684         * trans-intrinsic.c (gfc_conv_intrinsic_size): Use CLASS data
685         attributes for CLASS arrays for generation of runtime error.
686
687 2021-05-27  Harald Anlauf  <anlauf@gmx.de>
688
689         PR fortran/100656
690         * trans-array.c (gfc_conv_ss_startstride): Do not call check for
691         presence of a dummy argument when a symbol actually refers to a
692         non-dummy.
693
694 2021-05-25  Tobias Burnus  <tobias@codesourcery.com>
695             Johannes Nendwich  <a08727063@unet.univie.ac.at>
696
697         * intrinsic.texi (GERROR, GETARGS, GETLOG, NORM2, PARITY, RANDOM_INIT,
698         RANDOM_NUMBER): Fix typos and copy'n'paste errors.
699
700 2021-05-24  Tobias Burnus  <tobias@codesourcery.com>
701
702         PR fortran/86470
703         * trans-expr.c (gfc_copy_class_to_class): Add unshare_expr.
704         * trans-openmp.c (gfc_is_polymorphic_nonptr,
705         gfc_is_unlimited_polymorphic_nonptr): New.
706         (gfc_omp_clause_copy_ctor, gfc_omp_clause_dtor): Handle
707         polymorphic scalars.
708
709 2021-05-23  Harald Anlauf  <anlauf@gmx.de>
710
711         PR fortran/100551
712         * trans-expr.c (gfc_conv_procedure_call): Adjust check for
713         implicit conversion of actual argument to an unlimited polymorphic
714         procedure argument.
715
716 2021-05-23  Tobias Burnus  <tobias@codesourcery.com>
717
718         * intrinsic.texi (ATOMIC_ADD, ATOMIC_FETCH_ADD): Use the
719         proper variable name in the description.
720
721 2021-05-22  Andre Vehreschild  <vehre@gcc.gnu.org>
722             Steve Kargl  <kargl@gcc.gnu.org>
723
724         PR fortran/98301
725         * trans-decl.c (gfc_build_builtin_function_decls): Move decl.
726         * trans-intrinsic.c (conv_intrinsic_random_init): Use bool for
727         lib-call of caf_random_init instead of logical (4-byte).
728         * trans.h: Add tree var for random_init.
729
730 2021-05-20  Marcel Vollweiler  <marcel@codesourcery.com>
731
732         * openmp.c (gfc_match_omp_clauses): Support map-type-modifier 'close'.
733
734 2021-05-18  Tobias Burnus  <tobias@codesourcery.com>
735
736         PR fortran/100642
737         * openmp.c (omp_code_to_statement): Add missing EXEC_OMP_DEPOBJ.
738
739 2021-05-17  Harald Anlauf  <anlauf@gmx.de>
740
741         PR fortran/98411
742         * trans-decl.c (gfc_finish_var_decl): Add check for explicit SAVE
743         attribute.
744
745 2021-05-17  Tobias Burnus  <tobias@codesourcery.com>
746
747         PR fortran/100633
748         * resolve.c (gfc_resolve_code): Reject nonintrinsic assignments in
749         OMP WORKSHARE.
750
751 2021-05-14  Tobias Burnus  <tobias@codesourcery.com>
752
753         * dump-parse-tree.c (show_omp_node, show_code_node): Handle
754         EXEC_OMP_PARALLEL_MASTER.
755         * frontend-passes.c (gfc_code_walker): Likewise.
756         * gfortran.h (enum gfc_statement): Add ST_OMP_PARALLEL_MASTER and
757         ST_OMP_END_PARALLEL_MASTER.
758         (enum gfc_exec_op): Add EXEC_OMP_PARALLEL_MASTER..
759         * match.h (gfc_match_omp_parallel_master): Handle it.
760         * openmp.c (gfc_match_omp_parallel_master, resolve_omp_clauses,
761         omp_code_to_statement, gfc_resolve_omp_directive): Likewise.
762         * parse.c (decode_omp_directive, case_exec_markers,
763         gfc_ascii_statement, parse_omp_structured_block,
764         parse_executable): Likewise.
765         * resolve.c (gfc_resolve_blocks, gfc_resolve_code): Likewise.
766         * st.c (gfc_free_statement): Likewise.
767         * trans-openmp.c (gfc_trans_omp_parallel_master,
768         gfc_trans_omp_workshare, gfc_trans_omp_directive): Likewise.
769         * trans.c (trans_code): Likewise.
770
771 2021-05-14  Tobias Burnus  <tobias@codesourcery.com>
772
773         * resolve.c (resolve_symbol): Handle implicit SAVE of main-program
774         for vars in 'omp threadprivate' and 'omp declare target'.
775
776 2021-05-10  Martin Liska  <mliska@suse.cz>
777
778         * decl.c (variable_decl): Use startswith
779         function instead of strncmp.
780         (gfc_match_end): Likewise.
781         * gfortran.h (gfc_str_startswith): Likewise.
782         * module.c (load_omp_udrs): Likewise.
783         (read_module): Likewise.
784         * options.c (gfc_handle_runtime_check_option): Likewise.
785         * primary.c (match_arg_list_function): Likewise.
786         * trans-decl.c (gfc_get_symbol_decl): Likewise.
787         * trans-expr.c (gfc_conv_procedure_call): Likewise.
788         * trans-intrinsic.c (gfc_conv_ieee_arithmetic_function): Likewise.
789
790 2021-05-06  Paul Thomas  <pault@gcc.gnu.org>
791
792         PR fortran/46991
793         PR fortran/99819
794         * class.c (gfc_build_class_symbol): Remove the error that
795         disables assumed size class arrays. Class array types that are
796         not deferred shape or assumed rank are given a unique name and
797         placed in the procedure namespace.
798         * trans-array.c (gfc_trans_g77_array): Obtain the data pointer
799         for class arrays.
800         (gfc_trans_dummy_array_bias): Suppress the runtime error for
801         extent violations in explicit shape class arrays because it
802         always fails.
803         * trans-expr.c (gfc_conv_procedure_call): Handle assumed size
804         class actual arguments passed to non-descriptor formal args by
805         using the data pointer, stored as the symbol's backend decl.
806
807 2021-05-05  Harald Anlauf  <anlauf@gmx.de>
808
809         PR fortran/100274
810         * interface.c (gfc_compare_actual_formal): Continue checks after
811         emitting warning for argument length mismatch.
812         * trans-expr.c (gfc_conv_procedure_call): Check for NULL pointer
813         dereference.
814
815 2021-05-04  Tobias Burnus  <tobias@codesourcery.com>
816
817         PR testsuite/100397
818         * trans-openmp.c (gfc_trans_omp_depobj): Fix pasto in enum values.
819
820 2021-04-28  Tobias Burnus  <tobias@codesourcery.com>
821
822         * openmp.c (gfc_match_omp_variable_list): Gobble whitespace before
823         checking whether a '%' or parenthesis-open follows as next character.
824
825 2021-04-28  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
826
827         PR fortran/82376
828         * trans-expr.c (gfc_conv_procedure_call): Evaluate function result
829         and then pass a pointer.
830
831 2021-04-26  Thomas Schwinge  <thomas@codesourcery.com>
832             Nathan Sidwell  <nathan@codesourcery.com>
833             Tom de Vries  <vries@codesourcery.com>
834             Julian Brown  <julian@codesourcery.com>
835             Kwok Cheung Yeung  <kcy@codesourcery.com>
836
837         * lang.opt (Wopenacc-parallelism): New.
838
839 2021-04-24  Harald Anlauf  <anlauf@gmx.de>
840
841         PR fortran/100154
842         * check.c (variable_check): Allow function reference having a data
843         pointer result.
844         (arg_strlen_is_zero): New function.
845         (gfc_check_fgetputc_sub): Add static check of character and status
846         arguments.
847         (gfc_check_fgetput_sub): Likewise.
848         * intrinsic.c (add_subroutines): Fix argument name for the
849         character argument to intrinsic subroutines fget[c], fput[c].
850
851 2021-04-24  Harald Anlauf  <anlauf@gmx.de>
852
853         PR fortran/100218
854         * expr.c (gfc_check_vardef_context): Extend check to allow pointer
855         from a function reference.
856
857 2021-04-22  Martin Liska  <mliska@suse.cz>
858
859         PR testsuite/100159
860         PR testsuite/100192
861         * frontend-passes.c (optimize_expr): Fix typos and missing comments.
862
863 2021-04-22  Michael Meissner  <meissner@linux.ibm.com>
864
865         PR fortran/96983
866         * trans-intrinsic.c (build_round_expr): If int type is larger than
867         long long, do the round and convert to the integer type.  Do not
868         try to find a floating point type the exact size of the integer
869         type.
870
871 2021-04-21  Tobias Burnus  <tobias@codesourcery.com>
872
873         * dump-parse-tree.c (show_omp_namelist): Handle depobj + mutexinoutset
874         in the depend clause.
875         (show_omp_clauses, show_omp_node, show_code_node): Handle depobj.
876         * gfortran.h (enum gfc_statement): Add ST_OMP_DEPOBJ.
877         (enum gfc_omp_depend_op): Add OMP_DEPEND_UNSET,
878         OMP_DEPEND_MUTEXINOUTSET and OMP_DEPEND_DEPOBJ.
879         (gfc_omp_clauses): Add destroy, depobj_update and depobj.
880         (enum gfc_exec_op): Add EXEC_OMP_DEPOBJ
881         * match.h (gfc_match_omp_depobj): Match 'omp depobj'.
882         * openmp.c (gfc_match_omp_clauses): Add depobj + mutexinoutset
883         to depend clause.
884         (gfc_match_omp_depobj, resolve_omp_clauses, gfc_resolve_omp_directive):
885         Handle 'omp depobj'.
886         * parse.c (decode_omp_directive, next_statement, gfc_ascii_statement):
887         Likewise.
888         * resolve.c (gfc_resolve_code): Likewise.
889         * st.c (gfc_free_statement): Likewise.
890         * trans-openmp.c (gfc_trans_omp_clauses): Handle depobj + mutexinoutset
891         in the depend clause.
892         (gfc_trans_omp_depobj, gfc_trans_omp_directive): Handle EXEC_OMP_DEPOBJ.
893         * trans.c (trans_code): Likewise.
894
895 2021-04-20  Paul Thomas  <pault@gcc.gnu.org>
896
897         PR fortran/100110
898         * trans-decl.c (gfc_get_symbol_decl): Replace test for host
899         association with a check that the current and symbol namespaces
900         are the same.
901
902 2021-04-19  Thomas Schwinge  <thomas@codesourcery.com>
903
904         * lang.opt (fopenacc-kernels=): Remove.
905
906 2021-04-16  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
907
908         PR fortran/100094
909         * trans-array.c (gfc_trans_deferred_array): Add code to initialize
910         pointers and allocatables with correct TKR parameters.
911
912 2021-04-16  José Rui Faustino de Sousa  <jrfsousa@gmail.com>
913
914         PR fortran/100018
915         * resolve.c: Add association check before de-referencing pointer.
916
917 2021-04-16  Harald Anlauf  <anlauf@gmx.de>
918             Paul Thomas  <pault@gcc.gnu.org>
919
920         PR fortran/63797
921         * module.c (write_symtree): Do not write interface of intrinsic
922         procedure to module file for F2003 and newer.
923
924 2021-04-15  Paul Thomas  <pault@gcc.gnu.org>
925
926         PR fortran/99307
927         * symbol.c: Remove trailing white space.
928         * trans-array.c (gfc_trans_create_temp_array): Create a class
929         temporary for class expressions and assign the new descriptor
930         to the data field.
931         (build_class_array_ref): If the class expr can be extracted,
932         then use that for 'decl'. Class function results are reliably
933         handled this way. Call gfc_find_and_cut_at_last_class_ref to
934         eliminate largely redundant code. Remove dead code and recast
935         the rest of the code to extract 'decl' for remaining cases.
936         Call gfc_build_spanned_array_ref.
937         (gfc_alloc_allocatable_for_assignment): Use class descriptor
938         element length for 'elemsize1'. Eliminate repeat set of dtype
939         for class expressions.
940         * trans-expr.c (gfc_find_and_cut_at_last_class_ref): Include
941         additional code from build_class_array_ref, and use optional
942         gfc_typespec pointer argument.
943         (gfc_trans_scalar_assign): Make use of pre and post blocks for
944         all class expressions.
945         * trans.c (get_array_span): For unlimited polymorphic exprs
946         multiply the span by the value of the _len field.
947         (gfc_build_spanned_array_ref): New function.
948         (gfc_build_array_ref): Call gfc_build_spanned_array_ref and
949         eliminate repeated code.
950         * trans.h: Add arg to gfc_find_and_cut_at_last_class_ref and
951         add prototype for gfc_build_spanned_array_ref.
952
953 2021-04-14  Martin Liska  <mliska@suse.cz>
954
955         * intrinsic.texi: The table has first column empty and it makes
956         trouble when processing makeinfo --xml output.
957
958 2021-04-09  Tobias Burnus  <tobias@codesourcery.com>
959
960         PR fortran/99817
961         * trans-types.c (gfc_get_function_type): Also generate hidden
962         coarray argument for character arguments.
963
964 2021-04-03  Paul Thomas  <pault@gcc.gnu.org>
965
966         PR fortran/99818
967         * interface.c (compare_parameter): The codimension attribute is
968         applied to the _data field of class formal arguments.
969
970 2021-04-01  Harald Anlauf  <anlauf@gmx.de>
971
972         PR fortran/99840
973         * simplify.c (gfc_simplify_transpose): Properly initialize
974         resulting shape.
975
976 2021-03-28  Paul Thomas  <pault@gcc.gnu.org>
977
978         PR fortran/99602
979         * trans-expr.c (gfc_conv_procedure_call): Use the _data attrs
980         for class expressions and detect proc pointer evaluations by
981         the non-null actual argument list.
982
983 2021-03-27  Steve Kargl  <kargl@gcc.gnu.org>
984
985         * misc.c (gfc_typename): Fix off-by-one in buffer sizes.
986
987 2021-03-26  Tobias Burnus  <tobias@codesourcery.com>
988
989         PR fortran/99651
990         * intrinsic.c (gfc_intrinsic_func_interface): Set
991         attr.proc = PROC_INTRINSIC if FL_PROCEDURE.
992
993 2021-03-24  Tobias Burnus  <tobias@codesourcery.com>
994
995         PR fortran/99369
996         * resolve.c (resolve_operator): Make 'msg' buffer larger
997         and use snprintf.
998
999 2021-03-23  Tobias Burnus  <tobias@codesourcery.com>
1000
1001         PR fortran/93660
1002         * trans-decl.c (build_function_decl): Add comment;
1003         increment hidden_typelist for caf_token/caf_offset.
1004         * trans-types.c (gfc_get_function_type): Add comment;
1005         add missing caf_token/caf_offset args.
1006
1007 2021-03-22  Tobias Burnus  <tobias@codesourcery.com>
1008
1009         PR fortran/99688
1010         * match.c (select_type_set_tmp, gfc_match_select_type,
1011         gfc_match_select_rank): Fix 'name' buffersize to avoid out of bounds.
1012         * resolve.c (resolve_select_type): Likewise.
1013
1014 2021-03-19  Thomas Koenig  <tkoenig@gcc.gnu.org>
1015
1016         * frontend-passes.c (inline_limit_check): Add rank_a
1017         argument. If a is rank 1, set the second dimension to 1.
1018         (inline_matmul_assign): Pass rank_a argument to inline_limit_check.
1019         (call_external_blas): Likewise.
1020
1021 2021-03-15  Thomas Koenig  <tkoenig@gcc.gnu.org>
1022
1023         PR fortran/99345
1024         * frontend-passes.c (doloop_contained_procedure_code):
1025         Properly handle EXEC_IOLENGTH.
1026
1027 2021-03-15  Paul Thomas  <pault@gcc.gnu.org>
1028
1029         PR fortran/99545
1030         * trans-stmt.c (gfc_trans_allocate): Mark the initialization
1031         assignment by setting init_flag.
1032
1033 2021-03-14  Harald Anlauf  <anlauf@gmx.de>
1034             Paul Thomas  <pault@gcc.gnu.org>
1035
1036         * trans-expr.c (gfc_conv_procedure_call): Fix runtime checks for
1037         CLASS arguments.
1038         * trans-intrinsic.c (gfc_conv_intrinsic_size): Likewise.
1039
1040 2021-03-13  Paul Thomas  <pault@gcc.gnu.org>
1041
1042         PR fortran/99125
1043         * trans-array.c (gfc_conv_expr_descriptor): For deferred length
1044         length components use the ss_info string length instead of
1045         gfc_get_expr_charlen. Make sure that the deferred string length
1046         is a variable before assigning to it. Otherwise use the expr.
1047         * trans-expr.c (gfc_conv_string_length): Make sure that the
1048         deferred string length is a variable before assigning to it.
1049
1050 2021-03-12  Tobias Burnus  <tobias@codesourcery.com>
1051
1052         PR fortran/99514
1053         * resolve.c (resolve_symbol): Accept vars which are in DATA
1054         and hence (either) implicit SAVE (or in common).
1055
1056 2021-03-10  Harald Anlauf  <anlauf@gmx.de>
1057
1058         PR fortran/99205
1059         * data.c (gfc_assign_data_value): Reject non-constant character
1060         length for lvalue.
1061         * trans-array.c (gfc_conv_array_initializer): Restrict loop to
1062         elements which are defined to avoid NULL pointer dereference.
1063
1064 2021-03-10  Tobias Burnus  <tobias@codesourcery.com>
1065
1066         * intrinsic.texi (MIN): Correct 'maximum' to 'minimum'.
1067
1068 2021-03-10  Eric Botcazou  <ebotcazou@adacore.com>
1069
1070         PR fortran/96983
1071         * trans-intrinsic.c (build_round_expr): Do not implicitly assume
1072         that __float128 is the 128-bit floating-point type.
1073
1074 2021-03-08  Harald Anlauf  <anlauf@gmx.de>
1075
1076         PR fortran/49278
1077         * data.c (gfc_assign_data_value): Reject variable with PARAMETER
1078         attribute in DATA statement.
1079
1080 2021-03-05  Tobias Burnus  <tobias@codesourcery.com>
1081
1082         PR fortran/99355
1083         PR fortran/57871
1084         * invoke.texi (-freal{4,8}-real-*): Extend description.
1085         * primary.c (match_real_constant): Also promote real literals
1086         with '_kind' number.
1087
1088 2021-03-04  Tobias Burnus  <tobias@codesourcery.com>
1089
1090         PR fortran/99355
1091         * decl.c (gfc_match_old_kind_spec, gfc_match_kind_spec): Avoid
1092         redoing kind conversions.
1093         * primary.c (match_real_constant): Likewise.
1094
1095 2021-02-28  Jakub Jelinek  <jakub@redhat.com>
1096
1097         PR fortran/99303
1098         * openmp.c (gfc_omp_requires_add_clause): Fix up diagnostic message
1099         wordings.
1100         (resolve_omp_clauses): Likewise.
1101
1102 2021-02-28  Jakub Jelinek  <jakub@redhat.com>
1103
1104         PR fortran/99300
1105         * frontend-passes.c (doloop_code): Replace double space in diagnostics
1106         with a single space.
1107
1108 2021-02-24  Paul Thomas  <pault@gcc.gnu.org>
1109
1110         PR fortran/98342
1111         * trans-expr.c (gfc_conv_derived_to_class): Add optional arg.
1112         'derived_array' to hold the fixed, parmse expr in the case of
1113         assumed rank formal arguments. Deal with optional arguments.
1114         (gfc_conv_procedure_call): Null 'derived' array for each actual
1115         argument. Add its address to the call to gfc_conv_derived_to_
1116         class. Access the 'data' field of scalar descriptors before
1117         deallocating allocatable components. Also strip NOPs before the
1118         calls to gfc_deallocate_alloc_comp. Use 'derived' array as the
1119         input to gfc_deallocate_alloc_comp if it is available.
1120         * trans.h : Include the optional argument 'derived_array' to
1121         the prototype of gfc_conv_derived_to_class. The default value
1122         is NULL_TREE.
1123
1124 2021-02-23  Paul Thomas  <pault@gcc.gnu.org>
1125
1126         PR fortran/99124
1127         * resolve.c (resolve_fl_procedure): Include class results in
1128         the test for F2018, C15100.
1129         * trans-array.c (get_class_info_from_ss): Do not use the saved
1130         descriptor to obtain the class expression for variables. Use
1131         gfc_get_class_from_expr instead.
1132
1133 2021-02-23  Harald Anlauf  <anlauf@gmx.de>
1134
1135         PR fortran/99206
1136         * simplify.c (gfc_simplify_reshape): Set string length for
1137         character arguments.
1138
1139 2021-02-22  Tobias Burnus  <tobias@codesourcery.com>
1140
1141         PR fortran/99171
1142         * trans-openmp.c (gfc_omp_is_optional_argument): Regard optional
1143         dummy procs as nonoptional as no special treatment is needed.
1144
1145 2021-02-21  Harald Anlauf  <anlauf@gmx.de>
1146
1147         * trans-expr.c (gfc_conv_procedure_call): Do not add clobber to
1148         allocatable intent(out) argument.
1149
1150 2021-02-19  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
1151
1152         PR fortran/98686
1153         * match.c (gfc_match_namelist): If BT_UNKNOWN, check for
1154         IMPLICIT NONE and and issue an error, otherwise set the type
1155         to its IMPLICIT type so that any subsequent use of objects will
1156         will confirm their types.
1157
1158 2021-02-19  Harald Anlauf  <anlauf@gmx.de>
1159
1160         * symbol.c (gfc_add_flavor): Reverse order of conditions.
1161
1162 2021-02-19  Tobias Burnus  <tobias@codesourcery.com>
1163
1164         PR fortran/99010
1165         * dependency.c (gfc_dep_resolver): Fix coarray handling.
1166
1167 2021-02-19  Tobias Burnus  <tobias@codesourcery.com>
1168
1169         PR fortran/99146
1170         * interface.c:
1171
1172 2021-02-19  Tobias Burnus  <tobias@codesourcery.com>
1173
1174         PR fortran/99027
1175         * simplify.c (simplify_bound_dim): Honor DIMEN_ELEMENT
1176         when using dim=.
1177
1178 2021-02-17  Julian Brown  <julian@codesourcery.com>
1179
1180         * openmp.c (resolve_omp_clauses): Disallow selecting components
1181         of arrays of derived type.
1182
1183 2021-02-17  Julian Brown  <julian@codesourcery.com>
1184
1185         * trans-openmp.c (gfc_trans_omp_clauses): Handle element selection
1186         for arrays of derived types.
1187
1188 2021-02-16  Tobias Burnus  <tobias@codesourcery.com>
1189
1190         * expr.c (gfc_is_simplify_contiguous): Handle REF_INQUIRY, i.e.
1191         %im and %re which are EXPR_VARIABLE.
1192         * openmp.c (resolve_omp_clauses): Diagnose %re/%im explicitly.
1193
1194 2021-02-16  Tobias Burnus  <tobias@codesourcery.com>
1195
1196         PR fortran/99111
1197         * io.c (resolve_tag_format): Reject BT_DERIVED/CLASS/VOID
1198         as (array-valued) FORMAT tag.
1199
1200 2021-02-12  Tobias Burnus  <tobias@codesourcery.com>
1201
1202         PR fortran/99043
1203         * trans-expr.c (gfc_conv_procedure_call): Don't reset
1204         rank of assumed-rank array.
1205
1206 2021-02-11  Paul Thomas  <pault@gcc.gnu.org>
1207
1208         PR fortran/98897
1209         * match.c (gfc_match_call): Include associate names as possible
1210         entities with typebound subroutines. The target needs to be
1211         resolved for the type.
1212
1213 2021-02-11  Paul Thomas  <pault@gcc.gnu.org>
1214
1215         PR fortran/99060
1216         * primary.c (gfc_match_varspec): Test for non-null 'previous'
1217         before using its name in the error message.
1218
1219 2021-02-11  Tobias Burnus  <tobias@codesourcery.com>
1220
1221         * intrinsic.texi (FINDLOC): Add 'MASK' to argument table.
1222         (MAXLOC, MAXVAL, MINLOC, MINVAL): For 'MASK', remove 'an
1223         array' as scalars are also permitted.
1224
1225 2021-02-10  Julian Brown  <julian@codesourcery.com>
1226
1227         PR fortran/98979
1228         * openmp.c (resolve_omp_clauses): Omit OpenACC update in
1229         contiguity check and stride-specified error.
1230
1231 2021-02-04  Julian Brown  <julian@codesourcery.com>
1232
1233         * openmp.c (resolve_omp_clauses): Omit OpenACC update in
1234         contiguity check and stride-specified error.
1235
1236 2021-02-04  Julian Brown  <julian@codesourcery.com>
1237
1238         * trans-openmp.c (gfc_trans_omp_clauses): Use class_pointer attribute
1239         for BT_CLASS.
1240
1241 2021-02-04  Julian Brown  <julian@codesourcery.com>
1242
1243         * trans-openmp.c (gfc_trans_omp_clauses): Fix dereferencing for
1244         BT_DERIVED members.
1245
1246 2021-02-04  Tobias Burnus  <tobias@codesourcery.com>
1247
1248         * openmp.c (resolve_omp_clauses): Explicitly diagnose
1249         substrings as not permitted.
1250
1251 2021-02-03  Jeff Law  <law@redhat.com>
1252
1253         * intrinsic.texi (ANINT): Fix typo.
1254
1255 2021-02-03  Tobias Burnus  <tobias@codesourcery.com>
1256
1257         PR fortran/98913
1258         * dependency.c (gfc_dep_resolver): Treat local access
1259         to coarrays like any array access in dependency analysis.
1260
1261 2021-01-28  Harald Anlauf  <anlauf@gmx.de>
1262
1263         PR fortran/86470
1264         * trans.c (gfc_call_malloc): Allocate area of size 1 if passed
1265         size is NULL (as documented).
1266
1267 2021-01-27  Paul Thomas  <pault@gcc.gnu.org>
1268
1269         PR fortran/93924
1270         PR fortran/93925
1271         * trans-expr.c (gfc_conv_procedure_call): Suppress the call to
1272         gfc_conv_intrinsic_to_class for unlimited polymorphic procedure
1273         pointers.
1274         (gfc_trans_assignment_1): Similarly suppress class assignment
1275         for class valued procedure pointers.
1276
1277 2021-01-27  Paul Thomas  <pault@gcc.gnu.org>
1278
1279         PR fortran/98472
1280         * trans-array.c (gfc_conv_expr_descriptor): Include elemental
1281         procedure pointers in the assert under the comment 'elemental
1282         function' and eliminate the second, spurious assert.
1283
1284 2021-01-25  Harald Anlauf  <anlauf@gmx.de>
1285
1286         PR fortran/70070
1287         * data.c (create_character_initializer): Check substring indices
1288         against bounds.
1289         (gfc_assign_data_value): Catch error returned from
1290         create_character_initializer.
1291
1292 2021-01-25  Tobias Burnus  <tobias@codesourcery.com>
1293
1294         * intrinsic.texi (CO_BROADCAST, CO_MIN, CO_REDUCE, CO_SUM): Fix typos.
1295
1296 2021-01-25  Steve Kargl  <kargl@gcc.gnu.org>
1297
1298         PR fortran/98517
1299         * resolve.c (resolve_charlen): Check that length expression is
1300         present before testing for scalar/integer..
1301
1302 2021-01-22  Paul Thomas  <pault@gcc.gnu.org>
1303
1304         PR fortran/98565
1305         * trans-intrinsic.c (gfc_conv_associated): Do not add a _data
1306         component for scalar class function targets. Instead, fix the
1307         function result and access the _data from that.
1308
1309 2021-01-21  Jorge D'Elia  <jdelia@cimec.unl.edu.ar>
1310
1311         * intrinsic.texi (CO_MAX): Fix typo.
1312
1313 2021-01-21  Paul Thomas  <pault@gcc.gnu.org>
1314
1315         PR fortran/96320
1316         * decl.c (gfc_match_modproc): It is not an error to find a
1317         module procedure declaration within a contains block.
1318         * expr.c (gfc_check_vardef_context): Pure procedure result is
1319         assignable. Change 'own_scope' accordingly.
1320         * resolve.c (resolve_typebound_procedure): A procedure that
1321         has the module procedure attribute is almost certainly a
1322         module procedure, whatever its interface.
1323
1324 2021-01-19  Tobias Burnus  <tobias@codesourcery.com>
1325
1326         PR fortran/98476
1327         * openmp.c (resolve_omp_clauses): Change use_device_ptr
1328         to use_device_addr for unless type(c_ptr); check all
1329         list item for is_device_ptr.
1330
1331 2021-01-16  Kwok Cheung Yeung  <kcy@codesourcery.com>
1332
1333         * dump-parse-tree.c (show_omp_clauses): Handle detach clause.
1334         * frontend-passes.c (gfc_code_walker): Walk detach expression.
1335         * gfortran.h (struct gfc_omp_clauses): Add detach field.
1336         (gfc_c_intptr_kind): New.
1337         * openmp.c (gfc_free_omp_clauses): Free detach clause.
1338         (gfc_match_omp_detach): New.
1339         (enum omp_mask1): Add OMP_CLAUSE_DETACH.
1340         (enum omp_mask2): Remove OMP_CLAUSE_DETACH.
1341         (gfc_match_omp_clauses): Handle OMP_CLAUSE_DETACH for OpenMP.
1342         (OMP_TASK_CLAUSES): Add OMP_CLAUSE_DETACH.
1343         (resolve_omp_clauses): Prevent use of detach with mergeable and
1344         overriding the data sharing mode of the event handle.
1345         * trans-openmp.c (gfc_trans_omp_clauses): Handle detach clause.
1346         * trans-types.c (gfc_c_intptr_kind): New.
1347         (gfc_init_kinds): Initialize gfc_c_intptr_kind.
1348         * types.def
1349         (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT): Rename
1350         to...
1351         (BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR_INT_PTR):
1352         ...this.  Add extra argument.
1353
1354 2021-01-14  Harald Anlauf  <anlauf@gmx.de>
1355
1356         * gfortran.h (gfc_resolve_substring): Add prototype.
1357         * primary.c (match_string_constant): Simplify substrings with
1358         constant starting and ending points.
1359         * resolve.c: Rename resolve_substring to gfc_resolve_substring.
1360         (gfc_resolve_ref): Use renamed function gfc_resolve_substring.
1361
1362 2021-01-14  Harald Anlauf  <anlauf@gmx.de>
1363
1364         PR fortran/98661
1365         * resolve.c (resolve_component): Derived type components with
1366         ALLOCATABLE or POINTER attribute shall have a deferred shape.
1367
1368 2021-01-14  Harald Anlauf  <anlauf@gmx.de>
1369
1370         Revert:
1371         2021-01-14  Harald Anlauf  <anlauf@gmx.de>
1372
1373         PR fortran/98661
1374         * resolve.c (resolve_component): Derived type components with
1375         ALLOCATABLE or POINTER attribute shall have a deferred shape.
1376
1377 2021-01-14  Harald Anlauf  <anlauf@gmx.de>
1378
1379         PR fortran/98661
1380         * resolve.c (resolve_component): Derived type components with
1381         ALLOCATABLE or POINTER attribute shall have a deferred shape.
1382
1383 2021-01-08  Paul Thomas  <pault@gcc.gnu.org>
1384
1385         PR fortran/93794
1386         * trans-expr.c (gfc_conv_component_ref): Remove the condition
1387         that deferred character length components only be allocatable.
1388
1389 2021-01-08  Paul Thomas  <pault@gcc.gnu.org>
1390
1391         PR fortran/98458
1392         * simplify.c (is_constant_array_expr): If an array constructor
1393         expression has elements other than constants or structures, try
1394         fixing the expression with gfc_reduce_init_expr. Also, if shape
1395         is NULL, obtain the array size and set it.
1396
1397 2021-01-07  Paul Thomas  <pault@gcc.gnu.org>
1398
1399         PR fortran/93701
1400         * resolve.c (find_array_spec): Put static prototype for
1401         resolve_assoc_var before this function and call for associate
1402         variables.
1403
1404 2021-01-06  Harald Anlauf  <anlauf@gmx.de>
1405
1406         * resolve.c (resolve_component): Add check for valid CLASS
1407         reference before trying to access CLASS data.
1408
1409 2021-01-04  Martin Liska  <mliska@suse.cz>
1410
1411         * ChangeLog-2018: Remove duplicate ChangeLog entries.
1412
1413 2021-01-01  Harald Anlauf  <anlauf@gmx.de>
1414
1415         * class.c (gfc_find_vtab): Add check on attribute is_class.
1416
1417 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
1418
1419         * gfortranspec.c (lang_specific_driver): Update copyright notice
1420         dates.
1421         * gfc-internals.texi: Bump @copying's copyright year.
1422         * gfortran.texi: Ditto.
1423         * intrinsic.texi: Ditto.
1424         * invoke.texi: Ditto.
1425
1426 2021-01-01  Jakub Jelinek  <jakub@redhat.com>
1427
1428         * ChangeLog-2020: Rotate ChangeLog.  New file.
1429
1430 \f
1431 Copyright (C) 2021 Free Software Foundation, Inc.
1432
1433 Copying and distribution of this file, with or without modification,
1434 are permitted in any medium without royalty provided the copyright
1435 notice and this notice are preserved.