c++: diagnose this specifier in requires expr [PR116798]
[official-gcc.git] / gcc / fortran / ChangeLog
blob0e1ff28bdfd43584ed28d7141e09413955852a3e
1 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
3         PR fortran/90608
4         * invoke.texi(finline-intrinsics): Document new flag.
5         * lang.opt (finline-intrinsics, finline-intrinsics=,
6         fno-inline-intrinsics): New flags.
7         * options.cc (gfc_post_options): If the option variable controlling
8         the inlining of MAXLOC (respectively MINLOC) has not been set, set
9         it or clear it depending on the optimization option variables.
10         * trans-intrinsic.cc (gfc_inline_intrinsic_function_p): Return false
11         if inlining for the intrinsic is disabled according to the option
12         variable.
14 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
16         PR fortran/90608
17         * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Generate a set
18         of index variables.  Set them using the loop indexes before leaving
19         the first set of loops.  Generate a new loop entry predicate.
20         Initialize it.  Set it before leaving the first set of loops.  Clear
21         it in the body of the second set of loops.  For the second set of
22         loops, update each loop lower bound to use the corresponding index
23         variable if the predicate variable is set.
25 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
27         PR fortran/90608
28         * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Initialize
29         and update all the variables.  Put the label and goto in the
30         outermost scalarizer loop.  Don't start the second loop where the
31         first stopped.
32         (gfc_inline_intrinsic_function_p): Also return TRUE for array MASK
33         or for any REAL type.
35 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
37         PR fortran/90608
38         * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Generate
39         variable initialization for each dimension in the else branch of
40         the toplevel condition.
41         (gfc_inline_intrinsic_function_p): Return TRUE for scalar MASK.
43 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
45         PR fortran/90608
46         * trans-array.cc (gfc_conv_ss_startstride): Set the MINLOC/MAXLOC
47         result upper bound using the rank of the ARRAY argument.  Ajdust
48         the error message for intrinsic result arrays.  Only check array
49         bounds for array references.  Move bound check decision code...
50         (bounds_check_needed): ... here as a new predicate.  Allow bound
51         check for MINLOC/MAXLOC intrinsic results.
52         * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Change the
53         result array upper bound to the rank of ARRAY.  Update the NONEMPTY
54         variable to depend on the non-empty extent of every dimension.  Use
55         one variable per dimension instead of a single variable for the
56         position and the offset.  Update their declaration, initialization,
57         and update to affect the variable of each dimension.  Use the first
58         variable only in areas only accessed with rank 1 ARRAY argument.
59         Set every element of the result using its corresponding variable.
60         (gfc_inline_intrinsic_function_p): Return true for integral ARRAY
61         and absent DIM and MASK.
63 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
65         * trans-array.cc (gfc_conv_ss_startstride): Move array bound check
66         generation code...
67         (add_check_section_in_array_bounds): ... here as a new function.
69 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
71         * frontend-passes.cc (optimize_minmaxloc): Remove.
72         (optimize_expr): Remove dispatch to optimize_minmaxloc.
74 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
76         PR fortran/90608
77         * trans-array.cc (gfc_conv_ss_startstride): Set the scalarization
78         rank based on the MINLOC/MAXLOC rank if needed.  Call the inline
79         code generation and setup the scalarizer array descriptor info
80         in the MINLOC and MAXLOC cases.
81         * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Return the
82         result array element if the scalarizer is setup and we are inside
83         the loops.  Restrict library function call dispatch to the case
84         where inline expansion is not supported.  Declare an array result
85         if the expression isn't scalar.  Initialize the array result single
86         element and return the result variable if the expression isn't
87         scalar.
88         (walk_inline_intrinsic_minmaxloc): New function.
89         (walk_inline_intrinsic_function): Add MINLOC and MAXLOC cases,
90         dispatching to walk_inline_intrinsic_minmaxloc.
91         (gfc_add_intrinsic_ss_code): Add MINLOC and MAXLOC cases.
92         (gfc_inline_intrinsic_function_p): Return true if ARRAY has rank 1,
93         regardless of DIM.
95 2024-09-21  Mikael Morin  <mikael@gcc.gnu.org>
97         PR fortran/90608
98         * frontend-passes.cc (optimize_minmaxloc): Skip if we can generate
99         inline code for the unmodified expression.
100         * trans-intrinsic.cc (gfc_inline_intrinsic_function_p): Add
101         MINLOC and MAXLOC cases.
103 2024-09-20  David Malcolm  <dmalcolm@redhat.com>
105         PR other/116613
106         * error.cc: Include "diagnostic-format-text.h".
107         (gfc_diagnostic_starter): Rename to...
108         (gfc_diagnostic_text_starter): ...this.  Convert first
109         param from diagnostic_context * to diagnostic_text_output_format &
110         and update accordingly.
111         (gfc_diagnostic_finalizer, gfc_diagnostic_text_finalizer):
112         Likewise.
113         (gfc_diagnostics_init): Update for renamings.
114         (gfc_diagnostics_finish): Likewise.
116 2024-09-19  Andre Vehreschild  <vehre@gcc.gnu.org>
118         PR fortran/106606
119         * trans-types.cc (gfc_get_derived_type): Only build non-pointer
120         derived types as component's types when they are not yet built.
122 2024-09-19  Andre Vehreschild  <vehre@gcc.gnu.org>
124         PR fortran/85002
125         * trans-array.cc (duplicate_allocatable_coarray): Allow adding
126         of deep copy code in the when-allocated case.  Add bounds
127         computation before condition, because coarrays need the bounds
128         also when not allocated.
129         (structure_alloc_comps): Duplication in the coarray case is done
130         already, omit it.  Add the deep-code when duplication a coarray.
131         * trans-expr.cc (gfc_trans_structure_assign): Fix comment.
133 2024-09-15  Mikael Morin  <mikael@gcc.gnu.org>
135         * trans-expr.cc (gfc_advance_se_ss_chain): Don't use an element
136         from the parent scalarization chain when the current chain reaches
137         its end.
139 2024-09-13  Tobias Burnus  <tburnus@baylibre.com>
141         PR fortran/116661
142         * gfortran.h (gfc_omp_namelist): Rename 'init' members for clarity.
143         * match.cc (gfc_free_omp_namelist): Handle renaming.
144         * dump-parse-tree.cc (show_omp_namelist): Update for new format
145         and features.
146         * openmp.cc (gfc_match_omp_prefer_type): Parse list to 'fr' and 'attr';
147         store 'fr' values as integer.
148         (gfc_match_omp_init): Rename variable names.
150 2024-09-12  Steven G. Kargl  <kargl@gcc.gnu.org>
152         * module.cc (bt_types): Add BT_UNSIGNED.
154 2024-09-11  Tobias Burnus  <tburnus@baylibre.com>
156         PR fortran/116661
157         * openmp.cc (gfc_match_omp_prefer_type): NULL init a gfc_expr
158         variable and use right locus in gfc_error.
160 2024-09-09  David Malcolm  <dmalcolm@redhat.com>
162         * cpp.cc (cb_cpp_diagnostic_cpp_option): Convert return type from
163         "int" to "diagnostic_option_id".
164         (cb_cpp_diagnostic): Update for renaming of
165         diagnostic_override_option_index to diagnostic_set_option_id.
166         * error.cc (gfc_warning): Update for renaming of diagnostic_info
167         field.
168         (gfc_warning_now_at): Likewise.
169         (gfc_warning_now): Likewise.
170         (gfc_warning_internal): Likewise.
172 2024-09-09  David Malcolm  <dmalcolm@redhat.com>
174         PR other/116613
175         * error.cc (gfc_clear_pp_buffer): Rename diagnostic_context's
176         "printer" field to "m_printer".
177         (gfc_warning): Likewise.
178         (gfc_diagnostic_build_kind_prefix): Likewise.
179         (gfc_diagnostic_build_locus_prefix): Likewise.
180         (gfc_diagnostic_starter): Likewise.
181         (gfc_diagnostic_starter): Likewise.
182         (gfc_diagnostic_start_span): Likewise.
183         (gfc_diagnostic_finalizer): Likewise.
184         (gfc_warning_check): Likewise.
185         (gfc_error_opt): Likewise.
186         (gfc_error_check): Likewise.
188 2024-09-07  Thomas Koenig  <tkoenig@gcc.gnu.org>
190         * arith.cc (gfc_reduce_unsigned): New function.
191         (gfc_arith_error): Add ARITH_UNSIGNED_TRUNCATED and
192         ARITH_UNSIGNED_NEGATIVE.
193         (gfc_arith_init_1): Initialize unsigned types.
194         (gfc_check_unsigned_range): New function.
195         (gfc_range_check): Handle unsigned types.
196         (gfc_arith_uminus): Likewise.
197         (gfc_arith_plus): Likewise.
198         (gfc_arith_minus): Likewise.
199         (gfc_arith_times): Likewise.
200         (gfc_arith_divide): Likewise.
201         (gfc_compare_expr): Likewise.
202         (eval_intrinsic): Likewise.
203         (gfc_int2int): Also convert unsigned.
204         (gfc_uint2uint): New function.
205         (gfc_int2uint): New function.
206         (gfc_uint2int): New function.
207         (gfc_uint2real): New function.
208         (gfc_uint2complex): New function.
209         (gfc_real2uint): New function.
210         (gfc_complex2uint): New function.
211         (gfc_log2uint): New function.
212         (gfc_uint2log): New function.
213         * arith.h (gfc_int2uint, gfc_uint2uint, gfc_uint2int, gfc_uint2real):
214         Add prototypes.
215         (gfc_uint2complex, gfc_real2uint, gfc_complex2uint, gfc_log2uint):
216         Likewise.
217         (gfc_uint2log): Likewise.
218         * check.cc (gfc_boz2uint): New function
219         (type_check2): New function.
220         (int_or_real_or_unsigned_check): New function.
221         (less_than_bitsizekind): Adjust for unsingeds.
222         (less_than_bitsize2): Likewise.
223         (gfc_check_allocated): Likewise.
224         (gfc_check_mod): Likewise.
225         (gfc_check_bge_bgt_ble_blt): Likewise.
226         (gfc_check_bitfcn): Likewise.
227         (gfc_check_digits): Likewise.
228         (gfc_check_dshift): Likewise.
229         (gfc_check_huge): Likewise.
230         (gfc_check_iu): New function.
231         (gfc_check_iand_ieor_ior): Adjust for unsigneds.
232         (gfc_check_ibits): Likewise.
233         (gfc_check_uint): New function.
234         (gfc_check_ishft): Adjust for unsigneds.
235         (gfc_check_ishftc): Likewise.
236         (gfc_check_min_max): Likewise.
237         (gfc_check_merge_bits): Likewise.
238         (gfc_check_selected_int_kind): Likewise.
239         (gfc_check_shift): Likewise.
240         (gfc_check_mvbits): Likewise.
241         (gfc_invalid_unsigned_ops): Likewise.
242         * decl.cc (gfc_match_decl_type_spec): Likewise.
243         * dump-parse-tree.cc (show_expr): Likewise.
244         * expr.cc (gfc_get_constant_expr): Likewise.
245         (gfc_copy_expr): Likewise.
246         (gfc_extract_int): Likewise.
247         (numeric_type): Likewise.
248         * gfortran.h (enum arith): Extend with ARITH_UNSIGNED_TRUNCATED
249         and ARITH_UNSIGNED_NEGATIVE.
250         (enum gfc_isym_id): Extend with GFC_ISYM_SU_KIND and GFC_ISYM_UINT.
251         (gfc_check_unsigned_range): New prototype-
252         (gfc_arith_error): Likewise.
253         (gfc_reduce_unsigned): Likewise.
254         (gfc_boz2uint): Likewise.
255         (gfc_invalid_unsigned_ops): Likewise.
256         (gfc_convert_mpz_to_unsigned): Likewise.
257         * gfortran.texi: Add some rudimentary documentation.
258         * intrinsic.cc (gfc_type_letter): Adjust for unsigneds.
259         (add_functions): Add uint and adjust functions to be called.
260         (add_conversions): Add unsigned conversions.
261         (gfc_convert_type_warn): Adjust for unsigned.
262         * intrinsic.h (gfc_check_iu, gfc_check_uint, gfc_check_mod, gfc_simplify_uint,
263         gfc_simplify_selected_unsigned_kind, gfc_resolve_uint): New prototypes.
264         * invoke.texi: Add -funsigned.
265         * iresolve.cc (gfc_resolve_dshift): Handle unsigneds.
266         (gfc_resolve_iand): Handle unsigneds.
267         (gfc_resolve_ibclr): Handle unsigneds.
268         (gfc_resolve_ibits): Handle unsigneds.
269         (gfc_resolve_ibset): Handle unsigneds.
270         (gfc_resolve_ieor): Handle unsigneds.
271         (gfc_resolve_ior): Handle unsigneds.
272         (gfc_resolve_uint): Handle unsigneds.
273         (gfc_resolve_merge_bits): Handle unsigneds.
274         (gfc_resolve_not): Handle unsigneds.
275         * lang.opt: Add -funsigned.
276         * libgfortran.h: Add BT_UNSIGNED.
277         * match.cc (gfc_match_type_spec): Match UNSIGNED.
278         * misc.cc (gfc_basic_typename): Add UNSIGNED.
279         (gfc_typename): Likewise.
280         * primary.cc (convert_unsigned): New function.
281         (match_unsigned_constant): New function.
282         (gfc_match_literal_constant): Handle unsigned.
283         * resolve.cc (resolve_operator): Handle unsigned.
284         (resolve_ordinary_assign): Likewise.
285         * simplify.cc (convert_mpz_to_unsigned): Renamed to...
286         (gfc_convert_mpz_to_unsigned): and adjusted.
287         (gfc_simplify_bit_size): Adjusted for unsigned.
288         (compare_bitwise): Likewise.
289         (gfc_simplify_bge): Likewise.
290         (gfc_simplify_bgt): Likewise.
291         (gfc_simplify_ble): Likewise.
292         (gfc_simplify_blt): Likewise.
293         (simplify_cmplx): Likewise.
294         (gfc_simplify_digits): Likewise.
295         (simplify_dshift): Likewise.
296         (gfc_simplify_huge): Likewise.
297         (gfc_simplify_iand): Likewise.
298         (gfc_simplify_ibclr): Likewise.
299         (gfc_simplify_ibits): Likewise.
300         (gfc_simplify_ibset): Likewise.
301         (gfc_simplify_ieor): Likewise.
302         (gfc_simplify_uint): Likewise.
303         (gfc_simplify_ior): Likewise.
304         (simplify_shift): Likewise.
305         (gfc_simplify_ishftc): Likewise.
306         (gfc_simplify_merge_bits): Likewise.
307         (min_max_choose): Likewise.
308         (gfc_simplify_mod): Likewise.
309         (gfc_simplify_modulo): Likewise.
310         (gfc_simplify_popcnt): Likewise.
311         (gfc_simplify_range): Likewise.
312         (gfc_simplify_selected_unsigned_kind): Likewise.
313         (gfc_convert_constant): Likewise.
314         * target-memory.cc (size_unsigned): New function.
315         (gfc_element_size): Adjust for unsigned.
316         * trans-const.h (gfc_conv_mpz_unsigned_to_tree): Add prototype.
317         * trans-const.cc (gfc_conv_mpz_unsigned_to_tree): Handle unsigneds.
318         (gfc_conv_constant_to_tree): Likewise.
319         * trans-decl.cc (gfc_conv_cfi_to_gfc): Put in "not yet implemented".
320         * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Likewise.
321         * trans-stmt.cc (gfc_trans_integer_select): Handle unsigned.
322         (gfc_trans_select): Likewise.
323         * trans-intrinsic.cc (gfc_conv_intrinsic_mod): Handle unsigned.
324         (gfc_conv_intrinsic_shift): Likewise.
325         (gfc_conv_intrinsic_function): Add GFC_ISYM_UINT.
326         * trans-io.cc (enum iocall): Add IOCALL_X_UNSIGNED and IOCALL_X_UNSIGNED_WRITE.
327         (gfc_build_io_library_fndecls): Add transfer_unsigned and transfer_unsigned_write.
328         (transfer_expr): Handle unsigneds.
329         * trans-types.cc (gfc_unsinged_kinds): New array.
330         (gfc_unsigned_types): Likewise.
331         (gfc_init_kinds): Handle them.
332         (validate_unsigned): New function.
333         (gfc_validate_kind): Use it.
334         (gfc_build_unsigned_type): New function.
335         (gfc_init_types): Use it.
336         (gfc_get_unsigned_type): New function.
337         (gfc_typenode_for_spec): Handle unsigned.
338         * trans-types.h (gfc_get_unsigned_type): New prototype.
340 2024-09-06  Tobias Burnus  <tburnus@baylibre.com>
342         * dump-parse-tree.cc (show_omp_namelist): Handle OMP_LIST_INIT.
343         (show_omp_clauses): Handle OMP_LIST_{INIT,USE,DESTORY}; move 'nowait'
344         from end-directive to the directive dump.
345         (show_omp_node, show_code_node): Handle EXEC_OMP_INTEROP.
346         * gfortran.h (enum gfc_statement): Add ST_OMP_INTEROP.
347         (OMP_LIST_INIT, OMP_LIST_USE, OMP_LIST_DESTROY): Add.
348         (enum gfc_exec_op): Add EXEC_OMP_INTEROP.
349         (struct gfc_omp_namelist): Add interop items to union.
350         (gfc_free_omp_namelist): Add boolean arg.
351         * match.cc (gfc_free_omp_namelist): Update to free
352         interop union members.
353         * match.h (gfc_match_omp_interop): New.
354         * openmp.cc (gfc_omp_directives): Uncomment 'interop' entry.
355         (gfc_free_omp_clauses, gfc_match_omp_allocate,
356         gfc_match_omp_flush, gfc_match_omp_clause_reduction): Update
357         call.
358         (enum omp_mask2): Add OMP_CLAUSE_{INIT,USE,DESTROY}.
359         (OMP_INTEROP_CLAUSES): Use it.
360         (gfc_match_omp_clauses): Match those clauses.
361         (gfc_match_omp_prefer_type, gfc_match_omp_init,
362         gfc_match_omp_interop): New.
363         (resolve_omp_clauses): Handle interop clauses.
364         (omp_code_to_statement): Add ST_OMP_INTEROP.
365         (gfc_resolve_omp_directive): Add EXEC_OMP_INTEROP.
366         * parse.cc (decode_omp_directive): Parse 'interop' directive.
367         (next_statement, gfc_ascii_statement): Handle ST_OMP_INTEROP.
368         * st.cc (gfc_free_statement): Likewise
369         * resolve.cc (gfc_resolve_code): Handle EXEC_OMP_INTEROP.
370         * trans.cc (trans_code): Likewise.
371         * trans-openmp.cc (gfc_trans_omp_directive): Print 'sorry'
372         for EXEC_OMP_INTEROP.
374 2024-09-05  Harald Anlauf  <anlauf@gmx.de>
376         PR fortran/100273
377         * trans-decl.cc (gfc_create_module_variable): Handle module
378         variable also when it is needed for the result specification
379         of a contained function.
381 2024-09-03  David Malcolm  <dmalcolm@redhat.com>
383         * error.cc (gfc_move_error_buffer_from_to): Prefix all
384         output_buffer fields with "m_".
385         (gfc_diagnostics_init): Likewise.
387 2024-08-31  Harald Anlauf  <anlauf@gmx.de>
389         * match.cc (gfc_match_namelist): Downgrade feature from GNU to
390         legacy extension.
392 2024-08-30  Harald Anlauf  <anlauf@gmx.de>
394         PR fortran/98454
395         * resolve.cc (resolve_symbol): Add default-initialization of
396         non-allocatable, non-pointer derived-type function results.
398 2024-08-29  David Malcolm  <dmalcolm@redhat.com>
400         * error.cc (gfc_format_decoder): Convert final param from
401         const char **buffer_ptr to pp_token_list &formatted_token_list,
402         and update call to default_tree_printer accordingly.
404 2024-08-29  Harald Anlauf  <anlauf@gmx.de>
406         PR fortran/116530
407         * trans-io.cc (transfer_namelist_element): Prevent NULL pointer
408         dereference.
410 2024-08-23  Paul Thomas  <pault@gcc.gnu.org>
412         Revert:
413         2024-08-06  Paul Thomas  <pault@gcc.gnu.org>
415         PR fortran/102689
416         * trans-array.cc (get_array_ref_dim_for_loop_dim): Use the arg1
417         class container carried in ss->info as the seed for a lhs in
418         class valued transformational intrinsic calls that are not the
419         rhs of an assignment. Otherwise, the lhs variable expression is
420         taken from the loop chain. For this latter case, the _vptr and
421         _len fields are set.
422         (gfc_trans_create_temp_array): Use either the lhs expression
423         seeds to build a class variable that will take the returned
424         descriptor as its _data field. In the case that the arg1 expr.
425         is used, a class typespec must be built with the correct rank
426         and the _vptr and _len fields set. The element size is provided
427         for the temporary allocation and to set the descriptor span.
428         (gfc_array_init_size): When an intrinsic type scalar expr3 is
429         used in allocation of a class array, use its element size in
430         the descriptor dtype.
431         * trans-expr.cc (gfc_conv_class_to_class): Class valued
432         transformational intrinsics return the pointer to the array
433         descriptor as the _data field of a class temporary. Extract
434         directly and return the address of the class temporary.
435         (gfc_conv_procedure_call): store the expression for the first
436         argument of a class valued transformational intrinsic function
437         in the ss info class_container field. Later, use its type  as
438         the element type in the call to gfc_trans_create_temp_array.
439         (fcncall_realloc_result): Add a dtype argument and use it in
440         the descriptor, when available.
441         (gfc_trans_arrayfunc_assign): For class lhs, build a dtype with
442         the lhs rank and the rhs element size and use it in the call to
443         fcncall_realloc_result.
445 2024-08-23  Gerald Pfeifer  <gerald@pfeifer.com>
447         * invoke.texi (Code Gen Options): Add a missing word.
449 2024-08-23  Andre Vehreschild  <vehre@gcc.gnu.org>
451         PR fortran/86468
452         * trans-stmt.cc (trans_associate_var): Remove superfluous
453         view_convert.
455 2024-08-21  Andre Vehreschild  <vehre@gcc.gnu.org>
457         PR fortran/86468
458         * trans-intrinsic.cc (conv_intrinsic_move_alloc): Correct
459         comment.
460         * trans-types.cc (gfc_sym_type): Pass coarray rank, not false.
461         (gfc_get_derived_type): Only propagate  codimension for coarrays
462         and pointers to array components in derived typed coarrays.
464 2024-08-21  Andre Vehreschild  <vehre@gcc.gnu.org>
466         PR fortran/77518
467         * trans-intrinsic.cc (gfc_conv_intrinsic_sizeof): Use
468         class_container of se when set.
470 2024-08-20  Andre Vehreschild  <vehre@gcc.gnu.org>
472         PR fortran/84246
473         * resolve.cc (caf_possible_reallocate): Detect arrays that may
474         be reallocated by caf_send.
475         (resolve_ordinary_assign): More reliably detect assignments
476         where a rewrite to caf_send is needed.
477         * trans-expr.cc (gfc_trans_assignment_1): Remove rewrite to
478         caf_send, because this is done by resolve now.
479         * trans-intrinsic.cc (conv_caf_send): Prevent unneeded temporary
480         arrays.
482 2024-08-19  Andre Vehreschild  <vehre@gcc.gnu.org>
484         PR fortran/46371
485         PR fortran/56496
486         * expr.cc (gfc_is_coindexed): Detect is coindexed also when
487         rewritten to caf_get.
488         * trans-stmt.cc (trans_associate_var): Always accept a
489         descriptor for coarrays.
491 2024-08-19  Andre Vehreschild  <vehre@gcc.gnu.org>
493         PR fortran/84244
494         * trans-types.cc (gfc_get_derived_type): When a caf_sub_token is
495         generated for a component, link it to the component it is
496         generated for (the previous one).
498 2024-08-16  Harald Anlauf  <anlauf@gmx.de>
500         PR fortran/114146
501         * intrinsic.texi: Fix documentation of arguments of RANDOM_INIT,
502         which is conforming to the F2018 standard.
504 2024-08-15  Jakub Jelinek  <jakub@redhat.com>
506         PR bootstrap/116387
507         * resolve.cc (resolve_operator): Use %L rather than %%L in format
508         string.
510 2024-08-15  Andre Vehreschild  <vehre@gcc.gnu.org>
512         PR fortran/110033
513         * class.cc (gfc_is_class_scalar_expr): Coarray refs that ref
514         only self, aka this image, are regarded as scalar, too.
515         * resolve.cc (resolve_assoc_var): Ignore this image coarray refs
516         and do not build a new class type.
517         * trans-expr.cc (gfc_get_caf_token_offset): Get the caf token
518         from the descriptor for associated variables.
519         (gfc_conv_variable): Same.
520         (gfc_trans_pointer_assignment): Assign token to temporary
521         associate variable, too.
522         (gfc_trans_scalar_assign): Add flag that assign is for associate
523         and use it to assign the token.
524         (is_assoc_assign): Detect that expressions are for associate
525         assign.
526         (gfc_trans_assignment_1): Treat associate assigns like pointer
527         assignments where possible.
528         * trans-stmt.cc (trans_associate_var): Set same_class only for
529         class-targets.
530         * trans.h (gfc_trans_scalar_assign): Add flag to
531         trans_scalar_assign for marking associate assignments.
533 2024-08-15  Andre Vehreschild  <vehre@gcc.gnu.org>
535         * arith.cc (reduce_unary): Use expr.corank.
536         (reduce_binary_ac): Same.
537         (reduce_binary_ca): Same.
538         (reduce_binary_aa): Same.
539         * array.cc (gfc_match_array_ref): Same.
540         * check.cc (dim_corank_check): Same.
541         (gfc_check_move_alloc): Same.
542         (gfc_check_image_index): Same.
543         * class.cc (gfc_add_class_array_ref): Same.
544         (finalize_component): Same.
545         * data.cc (gfc_assign_data_value): Same.
546         * decl.cc (match_clist_expr): Same.
547         (add_init_expr_to_sym): Same.
548         * expr.cc (simplify_intrinsic_op): Same.
549         (simplify_parameter_variable): Same.
550         (gfc_check_assign_symbol): Same.
551         (gfc_get_variable_expr): Same.
552         (gfc_add_full_array_ref): Same.
553         (gfc_lval_expr_from_sym): Same.
554         (gfc_get_corank): Removed.
555         * frontend-passes.cc (callback_reduction): Use expr.corank.
556         (create_var): Same.
557         (combine_array_constructor): Same.
558         (optimize_minmaxloc): Same.
559         * gfortran.h (gfc_get_corank): Add corank to gfc_expr.
560         * intrinsic.cc (gfc_get_intrinsic_function_symbol): Use
561         expr.corank.
562         (gfc_convert_type_warn): Same.
563         (gfc_convert_chartype): Same.
564         * iresolve.cc (resolve_bound): Same.
565         (gfc_resolve_cshift): Same.
566         (gfc_resolve_eoshift): Same.
567         (gfc_resolve_logical): Same.
568         (gfc_resolve_matmul): Same.
569         * match.cc (copy_ts_from_selector_to_associate): Same.
570         * matchexp.cc (gfc_get_parentheses): Same.
571         * parse.cc (parse_associate): Same.
572         * primary.cc (gfc_match_rvalue): Same.
573         * resolve.cc (resolve_structure_cons): Same.
574         (resolve_actual_arglist): Same.
575         (resolve_elemental_actual): Same.
576         (resolve_generic_f0): Same.
577         (resolve_unknown_f): Same.
578         (resolve_operator): Same.
579         (gfc_expression_rank): Same and set dimen_type for coarray to
580         default.
581         (gfc_op_rank_conformable): Use expr.corank.
582         (add_caf_get_intrinsic): Same.
583         (resolve_variable): Same.
584         (gfc_fixup_inferred_type_refs): Same.
585         (check_host_association): Same.
586         (resolve_compcall): Same.
587         (resolve_expr_ppc): Same.
588         (resolve_assoc_var): Same.
589         (fixup_array_ref): Same.
590         (resolve_select_type): Same.
591         (add_comp_ref): Same.
592         (get_temp_from_expr): Same.
593         (resolve_fl_var_and_proc): Same.
594         (resolve_symbol): Same.
595         * symbol.cc (gfc_is_associate_pointer): Same.
596         * trans-array.cc (walk_coarray): Same.
597         (gfc_conv_expr_descriptor): Same.
598         (gfc_walk_array_ref): Same.
599         * trans-array.h (gfc_walk_array_ref): Same.
600         * trans-expr.cc (gfc_get_ultimate_alloc_ptr_comps_caf_token):
601         Same.
602         * trans-intrinsic.cc (trans_this_image): Same.
603         (trans_image_index): Same.
604         (conv_intrinsic_cobound): Same.
605         (gfc_walk_intrinsic_function): Same.
606         (conv_intrinsic_move_alloc): Same.
607         * trans-stmt.cc (gfc_trans_lock_unlock): Same.
608         (trans_associate_var): Same and adapt to slightly different
609         behaviour of expr.corank and gfc_get_corank.
610         (gfc_trans_allocate): Same.
611         * trans.cc (gfc_add_finalizer_call): Same.
613 2024-08-14  Harald Anlauf  <anlauf@gmx.de>
615         * simplify.cc (gfc_simplify_sizeof): Clear used gmp variable.
616         * target-memory.cc (gfc_target_expr_size): Likewise.
618 2024-08-14  Andre Vehreschild  <vehre@gcc.gnu.org>
620         PR fortran/102973
621         * match.cc (gfc_match_associate): Reset proc_ptr parsing flag on
622         error.
624 2024-08-14  Andre Vehreschild  <vehre@gcc.gnu.org>
626         PR fortran/116292
627         * trans-intrinsic.cc (conv_intrinsic_move_alloc): Get the vtab
628         only for derived types and classes and adjust _len for class
629         types.
631 2024-08-13  Harald Anlauf  <anlauf@gmx.de>
632             Steven G. Kargl  <kargl@gcc.gnu.org>
634         PR fortran/114308
635         * array.cc (resolve_array_list): Reject array constructor value if
636         its declared type is abstract (F2018:C7114).
638 2024-08-12  Andre Vehreschild  <vehre@gcc.gnu.org>
640         PR fortran/85510
641         * resolve.cc (resolve_variable): Mark the variable as host
642         associated only, when it is not in an associate block.
643         * trans-decl.cc (generate_coarray_init): Remove incorrect unused
644         flag on parameter.
646 2024-08-11  Harald Anlauf  <anlauf@gmx.de>
648         PR fortran/116221
649         * intrinsic.cc (gfc_get_intrinsic_sub_symbol): Initialize variable.
650         * symbol.cc (gfc_get_ha_symbol): Likewise.
652 2024-08-07  Julian Brown  <julian@codesourcery.com>
653             Tobias Burnus  <tobias@baylibre.com>
655         * gfortran.h (gfc_option_t): Add disable_omp_is_initial_device.
656         * lang.opt (fbuiltin-): Add.
657         * options.cc (gfc_handle_option): Handle
658         -fno-builtin-omp_is_initial_device.
659         * f95-lang.cc (gfc_init_builtin_functions): Handle
660         DEF_GOMP_BUILTIN_COMPILER.
661         * trans-decl.cc (gfc_get_extern_function_decl): Add code to use
662         DEF_GOMP_BUILTIN_COMPILER for 'omp_is_initial_device'.
664 2024-08-06  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
666         PR fortran/109105
667         * resolve.cc (CHECK_INTERFACES): New helper macro.
668         (resolve_operator): Replace use of snprintf with
669         gfc_error.
671 2024-08-06  Paul Thomas  <pault@gcc.gnu.org>
673         PR fortran/102689
674         * trans-array.cc (get_array_ref_dim_for_loop_dim): Use the arg1
675         class container carried in ss->info as the seed for a lhs in
676         class valued transformational intrinsic calls that are not the
677         rhs of an assignment. Otherwise, the lhs variable expression is
678         taken from the loop chain. For this latter case, the _vptr and
679         _len fields are set.
680         (gfc_trans_create_temp_array): Use either the lhs expression
681         seeds to build a class variable that will take the returned
682         descriptor as its _data field. In the case that the arg1 expr.
683         is used, a class typespec must be built with the correct rank
684         and the _vptr and _len fields set. The element size is provided
685         for the temporary allocation and to set the descriptor span.
686         (gfc_array_init_size): When an intrinsic type scalar expr3 is
687         used in allocation of a class array, use its element size in
688         the descriptor dtype.
689         * trans-expr.cc (gfc_conv_class_to_class): Class valued
690         transformational intrinsics return the pointer to the array
691         descriptor as the _data field of a class temporary. Extract
692         directly and return the address of the class temporary.
693         (gfc_conv_procedure_call): store the expression for the first
694         argument of a class valued transformational intrinsic function
695         in the ss info class_container field. Later, use its type  as
696         the element type in the call to gfc_trans_create_temp_array.
697         (fcncall_realloc_result): Add a dtype argument and use it in
698         the descriptor, when available.
699         (gfc_trans_arrayfunc_assign): For class lhs, build a dtype with
700         the lhs rank and the rhs element size and use it in the call to
701         fcncall_realloc_result.
703 2024-08-03  Steve Kargl  <kargls@comcast.net>
705         PR fortran/104626
706         * symbol.cc (gfc_add_save): Add checks for SAVE attribute
707         conflicts and duplicate SAVE attribute.
709 2024-08-02  Mikael Morin  <mikael@gcc.gnu.org>
711         * trans-intrinsic.cc (maybe_absent_optional_variable): New function.
712         (gfc_conv_intrinsic_minmaxloc): Remove BACK from scalarization and
713         evaluate it before.  Add a check that BACK is not null if the
714         expression is an optional dummy.  Save the resulting expression to a
715         variable.  Use the variable in the generated inline code.
717 2024-08-01  Jakub Jelinek  <jakub@redhat.com>
719         * trans-types.cc (gfc_get_array_descr_info): Don't test if
720         !integer_zerop (dtype_off), use fold_build_pointer_plus
721         unconditionally.
723 2024-07-29  Tobias Burnus  <tburnus@baylibre.com>
725         PR fortran/115559
726         * trans-common.cc (build_common_decl): Add 'omp declare target' and
727         'omp declare target link' variables to offload_vars.
728         * trans-decl.cc (add_attributes_to_decl): Likewise; update args and
729         call decl_attributes.
730         (get_proc_pointer_decl, gfc_get_extern_function_decl,
731         build_function_decl): Update calls.
732         (gfc_get_symbol_decl): Likewise; move after 'DECL_STATIC (t)=1'
733         to avoid errors with symtab_node::get_create.
735 2024-07-22  Andre Vehreschild  <vehre@gcc.gnu.org>
737         PR fortran/88624
738         * trans-expr.cc (gfc_conv_procedure_call): Treat
739         pointers/references (e.g. from parameters) correctly by derefing
740         them.
742 2024-07-21  Paul Thomas  <pault@gcc.gnu.org>
744         PR fortran/59104
745         * gfortran.h : Add decl_order to gfc_symbol.
746         * symbol.cc : Add static next_decl_order..
747         (gfc_set_sym_referenced): Set symbol decl_order.
748         * trans-decl.cc : Include dependency.h.
749         (decl_order): Replace symbol declared_at.lb->location with
750         decl_order.
752 2024-07-19  Harald Anlauf  <anlauf@gmx.de>
754         PR fortran/103115
755         * trans-array.cc (gfc_trans_array_constructor_value): If the first
756         element of an array constructor is deferred-length character and
757         therefore does not have an element size known at compile time, do
758         not try to collect subsequent constant elements into a constructor
759         for optimization.
761 2024-07-18  Andre Vehreschild  <vehre@gcc.gnu.org>
763         PR fortran/78466
764         PR fortran/80774
765         * array.cc (gfc_compare_array_spec): Take cotype into account.
766         * class.cc (gfc_build_class_symbol): Coarrays are also arrays.
767         * gfortran.h (IS_CLASS_COARRAY_OR_ARRAY): New macro to detect
768         regular and coarray class arrays.
769         * interface.cc (compare_components): Take codimension into
770         account.
771         * resolve.cc (resolve_symbol): Improve error message.
772         * simplify.cc (simplify_bound_dim): Remove duplicate.
773         * trans-array.cc (gfc_trans_array_cobounds): Coarrays are also
774         arrays.
775         (gfc_trans_array_bounds): Same.
776         (gfc_trans_dummy_array_bias): Same.
777         (get_coarray_as): Get the as having a non-zero codim.
778         (is_explicit_coarray): Detect explicit coarrays.
779         (gfc_conv_expr_descriptor): Create a new descriptor for explicit
780         coarrays.
781         * trans-decl.cc (gfc_build_qualified_array): Coarrays are also
782         arrays.
783         (gfc_build_dummy_array_decl): Same.
784         (gfc_get_symbol_decl): Same.
785         (gfc_trans_deferred_vars): Same.
786         * trans-expr.cc (class_scalar_coarray_to_class): Get the
787         descriptor from the correct location.
788         (gfc_conv_variable): Pick up the descriptor when needed.
789         * trans-types.cc (gfc_is_nodesc_array): Coarrays are also
790         arrays.
791         (gfc_get_nodesc_array_type): Indentation fix only.
792         (cobounds_match_decl): Match a tree's bounds to the expr's
793         bounds and return true, when they match.
794         (gfc_get_derived_type): Create a new type tree/descriptor, when
795         the cobounds of the existing declaration and expr to not
796         match.  This happends for class arrays in parameter list, when
797         there are different cobound declarations.
799 2024-07-18  Paul Thomas  <pault@gcc.gnu.org>
801         PR fortran/108889
802         * gfortran.h: Add bit field 'allocated_in_scope' to gfc_symbol.
803         * trans-array.cc (gfc_array_allocate): Set 'allocated_in_scope'
804         after allocation if not a component reference.
805         (gfc_alloc_allocatable_for_assignment): If 'allocated_in_scope'
806         not set, not a component ref and not allocated, set the array
807         bounds and offset to give zero length in all dimensions. Then
808         set allocated_in_scope.
810 2024-07-18  Andre Vehreschild  <vehre@gcc.gnu.org>
812         PR fortran/82904
813         * trans-types.cc (gfc_sym_type): Use type `char*` for saved
814         deferred length char arrays.
815         * trans.cc (get_array_span): Get `.span` also for `char*` typed
816         arrays, i.e. for those that have INTEGER_TYPE instead of
817         ARRAY_TYPE.
819 2024-07-17  Kewen Lin  <linkw@linux.ibm.com>
821         PR target/112993
822         * trans-types.cc (get_real_kind_from_node): Consider the case where
823         more than one modes have the same precision.
825 2024-07-16  Paul Thomas  <pault@gcc.gnu.org>
827         PR fortran/84868
828         * simplify.cc (gfc_simplify_len_trim): If the argument is an
829         element of a parameter array, simplify all the elements and
830         build a new parameter array to hold the result, after checking
831         that it doesn't already exist.
832         * trans-expr.cc (gfc_get_interface_mapping_array) if a string
833         length is available, use it for the typespec.
834         (gfc_add_interface_mapping): Supply the se string length.
836 2024-07-16  Prathamesh Kulkarni  <prathameshk@nvidia.com>
838         * trans-expr.cc (gfc_trans_zero_assign): Handle allocatable arrays.
840 2024-07-13  Mikael Morin  <mikael@gcc.gnu.org>
842         * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Add the
843         preliminary code generated for MASK to the preliminary code of
844         MINLOC/MAXLOC.
846 2024-07-12  Mikael Morin  <morin-mikael@orange.fr>
848         * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Create a new
849         scalar scalarization chain element if BACK is present.  Add it to
850         the loop.  Set the scalarization chain before evaluating the
851         argument.
853 2024-07-11  Andre Vehreschild  <vehre@gcc.gnu.org>
855         * trans-array.cc (gfc_conv_array_parameter): Init variable to
856         NULL_TREE to fix bootstrap.
858 2024-07-11  Andre Vehreschild  <vehre@gcc.gnu.org>
860         PR fortran/96992
861         * trans-array.cc (gfc_trans_array_bounds): Set a starting
862         stride, when descriptor expects a variable for the stride.
863         (gfc_trans_dummy_array_bias): Allow storage association for
864         dummy class arrays, when they are not elemental.
865         (gfc_conv_array_parameter): Add more general class support
866         and packing for classes, too.
867         * trans-array.h (gfc_conv_array_parameter): Add lbound shift
868         for class arrays.
869         * trans-decl.cc (gfc_build_builtin_function_decls): Add decls
870         for internal_un-/pack_class.
871         * trans-expr.cc (gfc_reset_vptr): Allow supplying a type-tree
872         to generate the vtab from.
873         (gfc_class_set_vptr): Allow supplying a class-tree to take the
874         vptr from.
875         (class_array_data_assign): Rename to gfc_class_array_data_assign
876         and make usable from other compile units.
877         (gfc_class_array_data_assign): Renamed from class_array_data_
878         assign.
879         (gfc_conv_derived_to_class): Remove assert to
880         allow converting derived to class type arrays with assumed
881         rank.  Reduce code base and use gfc_conv_array_parameter also
882         for classes.
883         (gfc_conv_class_to_class): Use gfc_class_data_assign.
884         (gfc_conv_procedure_call): Adapt to new signature of
885         gfc_conv_derived_to_class.
886         * trans-io.cc (transfer_expr): Same.
887         * trans-stmt.cc (trans_associate_var): Same.
888         * trans.h (gfc_conv_derived_to_class): Signature changed.
889         (gfc_class_array_data_assign): Made public.
890         (gfor_fndecl_in_pack_class): Added declaration.
891         (gfor_fndecl_in_unpack_class): Same.
893 2024-07-08  Mikael Morin  <mikael@gcc.gnu.org>
895         * trans-array.cc (gfc_trans_preloop_setup): Use a separate variable
896         for iteration.  Use directly the value of variable I if it is known.
897         Move the definition of the variable to the branch where the
898         remaining uses are.
900 2024-07-03  Harald Anlauf  <anlauf@gmx.de>
902         PR fortran/115700
903         * trans-stmt.cc (trans_associate_var): When the associate target
904         is an array-valued character variable, the length is known at entry
905         of the associate block.  Move setting of string length of the
906         selector to the initialization part of the block.
908 2024-07-01  Andrew Stubbs  <ams@baylibre.com>
909             Thomas Schwinge  <thomas@codesourcery.com>
911         * openmp.cc (is_predefined_allocator): Update valid ranges to
912         incorporate ompx_gnu_pinned_mem_alloc.
914 2024-06-29  Harald Anlauf  <anlauf@gmx.de>
916         PR fortran/114019
917         * trans-stmt.cc (gfc_trans_allocate): Fix handling of case of
918         scalar character expression being used for SOURCE.
920 2024-06-28  Andre Vehreschild  <vehre@gcc.gnu.org>
922         * trans-expr.cc (gfc_class_set_vptr): Add setting of _vptr
923         member.
924         * trans-intrinsic.cc (conv_intrinsic_move_alloc): First use
925         of gfc_class_set_vptr and refactor very similar code.
926         * trans.h (gfc_class_set_vptr): Declare the new function.
928 2024-06-28  Andre Vehreschild  <vehre@gcc.gnu.org>
930         * trans-array.cc (structure_alloc_comps): Use reset_vptr.
931         * trans-decl.cc (gfc_trans_deferred_vars): Same.
932         (gfc_generate_function_code): Same.
933         * trans-expr.cc (gfc_reset_vptr): Allow supplying the class
934         type.
935         (gfc_conv_procedure_call): Use reset_vptr.
936         * trans-intrinsic.cc (gfc_conv_intrinsic_transfer): Same.
938 2024-06-24  Harald Anlauf  <anlauf@gmx.de>
940         PR fortran/55978
941         * trans-array.cc (gfc_conv_array_parameter): Do not dereference
942         data component of a missing allocatable dummy array argument for
943         passing as actual to optional dummy.  Harden logic of presence
944         check for optional pointer dummy by using TRUTH_ANDIF_EXPR instead
945         of TRUTH_AND_EXPR.
947 2024-06-20  Paul Thomas  <pault@gcc.gnu.org>
949         PR fortran/59104
950         * dependency.cc (dependency_fcn, gfc_function_dependency): New
951         functions to detect dependency in array bounds and character
952         lengths on old style function results.
953         * dependency.h : Add prototype for gfc_function_dependency.
954         * error.cc (error_print): Remove trailing space.
955         * gfortran.h : Remove dummy_order and add fn_result_spec.
956         * symbol.cc : Remove declaration of next_dummy_order..
957         (gfc_set_sym_referenced): remove setting of symbol dummy order.
958         * trans-array.cc (gfc_trans_auto_array_allocation): Detect
959         non-dummy symbols with function dependencies and put the
960         allocation at the end of the initialization code.
961         * trans-decl.cc : Include dependency.h.
962         (decl_order): New function that determines uses the location
963         field of the symbol 'declared_at' to determine the order of two
964         declarations.
965         (gfc_defer_symbol_init): Call gfc_function_dependency to put
966         dependent symbols in the right part of the tlink chain. Use
967         the location field of the symbol declared_at to determine the
968         order of declarations.
969         (gfc_trans_auto_character_variable): Put character length
970         initialization of dependent symbols at the end of the chain.
971         * trans.cc (gfc_add_init_cleanup): Add boolean argument with
972         default false that determines whther an expression is placed at
973         the back or the front of the initialization chain.
974         * trans.h : Update the prototype for gfc_add_init_cleanup.
976 2024-06-19  Harald Anlauf  <anlauf@gmx.de>
978         PR fortran/115390
979         * trans-decl.cc (gfc_conv_cfi_to_gfc): Move derivation of type sizes
980         for character via gfc_trans_vla_type_sizes to after character length
981         has been set.
983 2024-06-19  Andre Vehreschild  <vehre@gcc.gnu.org>
985         PR fortran/90076
986         * trans-decl.cc (gfc_generate_function_code): Set vptr for
987         results to declared class type.
988         * trans-expr.cc (gfc_reset_vptr): Allow to provide the typespec
989         instead of the expression.
990         * trans.h (gfc_reset_vptr): Same.
992 2024-06-17  Andre Vehreschild  <vehre@gcc.gnu.org>
994         * trans.cc (gfc_deallocate_with_status): Check that object to deref
995         is an array, before applying array deref.
997 2024-06-12  David Malcolm  <dmalcolm@redhat.com>
999         * error.cc (gfc_clear_pp_buffer): Likewise.
1000         (gfc_warning): Likewise.
1001         (gfc_warning_check): Likewise.
1002         (gfc_error_opt): Likewise.
1003         (gfc_error_check): Likewise.
1005 2024-06-07  Andre Vehreschild  <vehre@gcc.gnu.org>
1007         PR fortran/90068
1008         * trans-array.cc (gfc_trans_array_ctor_element): Eval non-
1009         variable expressions once only.
1010         (gfc_trans_array_constructor_value): Add statements of
1011         final block.
1012         (trans_array_constructor): Detect when final block is required.
1014 2024-06-07  Andre Vehreschild  <vehre@gcc.gnu.org>
1016         PR fortran/90072
1017         * expr.cc (gfc_is_alloc_class_scalar_function): Detect
1018         allocatable class return types also for user-defined
1019         functions.
1020         * trans-expr.cc (gfc_conv_procedure_call): Same.
1021         (trans_class_vptr_len_assignment): Compute vptr len
1022         assignment correctly for user-defined functions.
1024 2024-06-05  Jakub Jelinek  <jakub@redhat.com>
1025             Frederik Harwath  <frederik@codesourcery.com>
1026             Sandra Loosemore  <sandra@codesourcery.com>
1028         * gfortran.h (enum gfc_statement): Add ST_OMP_UNROLL,
1029         ST_OMP_END_UNROLL, ST_OMP_TILE and ST_OMP_END_TILE.
1030         (struct gfc_omp_clauses): Add sizes_list, partial, full and erroneous
1031         members.
1032         (enum gfc_exec_op): Add EXEC_OMP_UNROLL and EXEC_OMP_TILE.
1033         (gfc_expr_list_len): Declare.
1034         * match.h (gfc_match_omp_tile, gfc_match_omp_unroll): Declare.
1035         * openmp.cc (gfc_get_location): Declare.
1036         (gfc_free_omp_clauses): Free sizes_list.
1037         (match_oacc_expr_list): Rename to ...
1038         (match_omp_oacc_expr_list): ... this.  Add is_omp argument and
1039         change diagnostic wording if it is true.
1040         (enum omp_mask2): Add OMP_CLAUSE_{FULL,PARTIAL,SIZES}.
1041         (gfc_match_omp_clauses): Parse full, partial and sizes clauses.
1042         (gfc_match_oacc_wait): Use match_omp_oacc_expr_list instead of
1043         match_oacc_expr_list.
1044         (OMP_UNROLL_CLAUSES, OMP_TILE_CLAUSES): Define.
1045         (gfc_match_omp_tile, gfc_match_omp_unroll): New functions.
1046         (resolve_omp_clauses): Diagnose full vs. partial clause conflict.
1047         Resolve sizes clause arguments.
1048         (find_nested_loop_in_chain): Use switch instead of series of ifs.
1049         Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1050         (gfc_resolve_omp_do_blocks): Set omp_current_do_collapse to
1051         list length of sizes_list if present.
1052         (gfc_resolve_do_iterator): Return for EXEC_OMP_TILE or
1053         EXEC_OMP_UNROLL.
1054         (restructure_intervening_code): Remove spurious ()s around & operands.
1055         (is_outer_iteration_variable): Handle EXEC_OMP_TILE and
1056         EXEC_OMP_UNROLL.
1057         (check_nested_loop_in_chain): Likewise.
1058         (expr_is_invariant): Likewise.
1059         (resolve_omp_do): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.  Diagnose
1060         tile without sizes clause.  Use sizes_list length for count if
1061         non-NULL.  Set code->ext.omp_clauses->erroneous on loops where we've
1062         reported diagnostics.  Sorry for mixing non-rectangular loops with
1063         generated loops.
1064         (omp_code_to_statement): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1065         (gfc_resolve_omp_directive): Likewise.
1066         * parse.cc (decode_omp_directive): Parse end tile, end unroll, tile
1067         and unroll.  Move nothing entry alphabetically.
1068         (case_exec_markers): Add ST_OMP_TILE and ST_OMP_UNROLL.
1069         (gfc_ascii_statement): Handle ST_OMP_END_TILE, ST_OMP_END_UNROLL,
1070         ST_OMP_TILE and ST_OMP_UNROLL.
1071         (parse_omp_do): Add nested argument.  Handle ST_OMP_TILE and
1072         ST_OMP_UNROLL.
1073         (parse_omp_structured_block): Adjust parse_omp_do caller.
1074         (parse_executable): Likewise.  Handle ST_OMP_TILE and ST_OMP_UNROLL.
1075         * resolve.cc (gfc_resolve_blocks): Handle EXEC_OMP_TILE and
1076         EXEC_OMP_UNROLL.
1077         (gfc_resolve_code): Likewise.
1078         * st.cc (gfc_free_statement): Likewise.
1079         * trans.cc (trans_code): Likewise.
1080         * trans-openmp.cc (gfc_trans_omp_clauses): Handle full, partial and
1081         sizes clauses.  Use tree_cons + nreverse instead of
1082         temporary vector and build_tree_list_vec for tile_list handling.
1083         (gfc_expr_list_len): New function.
1084         (gfc_trans_omp_do): Rename tile to oacc_tile.  Handle sizes clause.
1085         Don't assert code->op is EXEC_DO.  Handle EXEC_OMP_TILE and
1086         EXEC_OMP_UNROLL.
1087         (gfc_trans_omp_directive): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1088         * dump-parse-tree.cc (show_omp_clauses): Dump full, partial and
1089         sizes clauses.
1090         (show_omp_node): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1091         (show_code_node): Likewise.
1093 2024-06-05  Kewen Lin  <linkw@linux.ibm.com>
1095         * trans-intrinsic.cc (build_round_expr): Use TYPE_PRECISION of
1096         long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE.
1097         * trans-types.cc (gfc_build_real_type): Use TYPE_PRECISION of
1098         {float,double,long_double}_type_node to replace
1099         {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE.
1101 2024-06-04  Harald Anlauf  <anlauf@gmx.de>
1103         PR fortran/83865
1104         * trans-stmt.cc (gfc_trans_allocate): Restrict special case for
1105         source-expression with zero-length character to rank 0, so that
1106         the array shape is not discarded.
1108 2024-05-29  Andre Vehreschild  <vehre@gcc.gnu.org>
1110         PR fortran/90069
1111         * trans-expr.cc (gfc_conv_procedure_call): Evaluate
1112         expressions with side-effects only ones and ensure
1113         old is freeed.
1115 2024-05-24  Harald Anlauf  <anlauf@gmx.de>
1116             Steven G. Kargl  <kargl@gcc.gnu.org>
1118         PR fortran/93635
1119         * symbol.cc (conflict_std): Helper function for reporting attribute
1120         conflicts depending on the Fortran standard version.
1121         (conf_std): Helper macro for checking standard-dependent conflicts.
1122         (gfc_check_conflict): Use it.
1124 2024-05-24  Harald Anlauf  <anlauf@gmx.de>
1126         PR fortran/86100
1127         * trans-array.cc (gfc_conv_ss_startstride): Use abridged_ref_name
1128         to generate a more user-friendly name for bounds-check messages.
1129         * trans-expr.cc (gfc_copy_class_to_class): Fix bounds check for
1130         rank>1 by looping over the dimensions.
1132 2024-05-23  Paul Thomas  <pault@gcc.gnu.org>
1134         PR fortran/103312
1135         * dependency.cc (gfc_dep_compare_expr): Handle component call
1136         expressions. Return -2 as default and return 0 if compared with
1137         a function expression that is from an interface body and has
1138         the same name.
1139         * expr.cc (gfc_reduce_init_expr): If the expression is a comp
1140         call do not attempt to reduce, defer to resolution and return
1141         false.
1142         * trans-types.cc (gfc_get_dtype_rank_type,
1143         gfc_get_nodesc_array_type): Fix whitespace.
1145 2024-05-20  Mikael Morin  <mikael@gcc.gnu.org>
1147         PR fortran/99798
1148         * symbol.cc (gfc_release_symbol): Move the condition guarding
1149         the handling cyclic references...
1150         (cyclic_reference_break_needed): ... here as a new predicate.
1151         Remove superfluous parts.  Add a condition preventing any premature
1152         release with submodule symbols.
1154 2024-05-20  Tobias Burnus  <tburnus@baylibre.com>
1156         PR fortran/115150
1157         * trans-intrinsic.cc (gfc_conv_intrinsic_bound): Fix SHAPE
1158         for zero-size arrays
1160 2024-05-20  Tobias Burnus  <tburnus@baylibre.com>
1162         * invoke.texi (fcoarray): Link to OpenCoarrays.org;
1163         mention libcaf_single.
1165 2024-05-17  Paul Thomas  <pault@gcc.gnu.org>
1167         PR fortran/114874
1168         * gfortran.h: Add 'assoc_name_inferred' to gfc_namespace.
1169         * match.cc (gfc_match_select_type): Set 'assoc_name_inferred'
1170         in select type namespace if the selector has inferred type.
1171         * primary.cc (gfc_match_varspec): If a select type temporary
1172         is apparently scalar and a left parenthesis has been detected,
1173         check the current namespace has 'assoc_name_inferred' set. If
1174         so, set inferred_type.
1175         * resolve.cc (resolve_variable): If the namespace of a select
1176         type temporary is marked with 'assoc_name_inferred' call
1177         gfc_fixup_inferred_type_refs to ensure references are OK.
1178         (gfc_fixup_inferred_type_refs): Catch invalid array refs..
1180 2024-05-15  Jakub Jelinek  <jakub@redhat.com>
1182         PR c/115103
1183         * openmp.cc (resolve_omp_clauses): Diagnose grainsize
1184         used together with num_tasks or nogroup used together with
1185         reduction.
1187 2024-05-13  Paul Thomas  <pault@gcc.gnu.org>
1189         PR fortran/113363
1190         * trans-array.cc (gfc_array_init_size): Use the expr3 dtype so
1191         that the correct element size is used.
1192         * trans-expr.cc (gfc_conv_procedure_call): Remove restriction
1193         that ss and ss->loop be present for the finalization of class
1194         array function results.
1195         (trans_class_assignment): Use free and malloc, rather than
1196         realloc, for character expressions assigned to unlimited poly
1197         entities.
1198         * trans-stmt.cc (gfc_trans_allocate): Build a correct rhs for
1199         the assignment of an unlimited polymorphic 'source'.
1201 2024-05-12  Harald Anlauf  <anlauf@gmx.de>
1203         * primary.cc (gfc_match_varspec): Replace 'ref' argument to
1204         is_inquiry_ref() by NULL when the result is not needed to avoid
1205         a memleak.
1207 2024-05-12  Paul Thomas  <pault@gcc.gnu.org>
1209         PR fortran/84006
1210         PR fortran/100027
1211         PR fortran/98534
1212         * iresolve.cc (gfc_resolve_transfer): Emit a TODO error for
1213         unlimited polymorphic mold.
1214         * trans-expr.cc (gfc_resize_class_size_with_len): Use the fold
1215         even if a block is not available in which to fix the result.
1216         (trans_class_assignment): Enable correct assignment of
1217         character expressions to unlimited polymorphic variables using
1218         lhs _len field and rse string_length.
1219         * trans-intrinsic.cc (gfc_conv_intrinsic_storage_size): Extract
1220         the class expression so that the unlimited polymorphic class
1221         expression can be used in gfc_resize_class_size_with_len to
1222         obtain the storage size for character payloads. Guard the use
1223         of GFC_DECL_SAVED_DESCRIPTOR by testing for DECL_LANG_SPECIFIC
1224         to prevent the ICE. Also, invert the order to use the class
1225         expression extracted from the argument.
1226         (gfc_conv_intrinsic_transfer): In same way as 'storage_size',
1227         use the _len field to obtaining the correct length for arg 1.
1228         Add a branch for the element size in bytes of class expressions
1229         with provision to make use of the unlimited polymorphic _len
1230         field. Again, the class references are explicitly identified.
1231         'mold_expr' was already declared. Use it instead of 'arg'. Do
1232         not fix 'dest_word_len' for deferred character sources because
1233         reallocation on assign makes use of it before it is assigned.
1235 2024-05-11  Harald Anlauf  <anlauf@gmx.de>
1237         PR fortran/115039
1238         * expr.cc (gfc_traverse_expr): An inquiry ref does not constitute
1239         a dependency and cannot collide with a symbol.
1241 2024-05-05  Harald Anlauf  <anlauf@gmx.de>
1243         PR fortran/114827
1244         * trans-array.cc (gfc_alloc_allocatable_for_assignment): Take into
1245         account _len of unlimited polymorphic entities when calculating
1246         the effective element size for allocation size and array span.
1247         Set _len of lhs to _len of rhs.
1248         * trans-expr.cc (trans_class_assignment): Take into account _len
1249         of unlimited polymorphic entities for allocation size.
1251 2024-04-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1253         * expr.cc (check_transformational): Add SELECTED_LOGICAL_KIND
1254         to allowed functions for Fortran 2023.
1255         * gfortran.h (GFC_ISYM_SL_KIND): New.
1256         * gfortran.texi: Mention SELECTED_LOGICAL_KIND.
1257         * intrinsic.cc (add_functions): Add SELECTED_LOGICAL_KIND.
1258         (gfc_intrinsic_func_interface): Allow it in initialization
1259         expressions.
1260         * intrinsic.h (gfc_simplify_selected_logical_kind): New proto.
1261         * intrinsic.texi: Add SELECTED_LOGICAL_KIND.
1262         * simplify.cc (gfc_simplify_selected_logical_kind): New
1263         function.
1264         * trans-decl.cc (gfc_build_intrinsic_function_decls): Initialize
1265         gfor_fndecl_sl_kind.
1266         * trans-intrinsic.cc (gfc_conv_intrinsic_sl_kind): New function.
1267         (gfc_conv_intrinsic_function): Call it for GFC_ISYM_SL_KIND.
1268         * trans.h (gfor_fndecl_sl_kind): New symbol.
1270 2024-04-29  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
1272         * iso-fortran-env.def: Add logical{8,16,32,64} and
1273         real16 named constants.
1275 2024-04-29  Paul Thomas  <pault@gcc.gnu.org>
1277         PR fortran/114959
1278         * trans-expr.cc (gfc_trans_class_init_assign): Return NULL_TREE
1279         if the default initializer has all NULL fields. Guard this
1280         by a requirement that the code not be EXEC_INIT_ASSIGN and that
1281         the object be an INTENT_OUT dummy.
1282         * trans-stmt.cc (gfc_trans_allocate): Change the initializer
1283         code for allocate with mold to EXEC_ALLOCATE to allow an
1284         initializer with all NULL fields.
1286 2024-04-25  Paul Thomas  <pault@gcc.gnu.org>
1288         PR fortran/93678
1289         * trans-expr.cc (gfc_conv_procedure_call): Use the interface,
1290         where possible, to obtain the type of character procedure
1291         pointers of class entities.
1293 2024-04-25  Paul Thomas  <pault@gcc.gnu.org>
1294             Jakub Jelinek  <jakub@gcc.gnu.org>
1296         PR fortran/89462
1297         * decl.cc (build_sym): Add an extra argument 'elem'. If 'elem'
1298         is greater than 1, gfc_new_charlen is called to generate a new
1299         charlen, registered in the symbol namespace.
1300         (variable_decl, enumerator_decl): Set the new argument in the
1301         calls to build_sym.
1303 2024-04-21  Paul Thomas  <pault@gcc.gnu.org>
1305         PR fortran/103471
1306         * resolve.cc (resolve_actual_arglist): Catch variables silently
1307         set as untyped, resetting the flag so that gfc_resolve_expr can
1308         generate the no implicit type error.
1309         (gfc_resolve_index_1): Block index expressions of unknown type
1310         from being converted to default integer, avoiding the fatal
1311         error in trans-decl.cc.
1312         * symbol.cc (gfc_set_default_type): Remove '(symbol)' from the
1313         'no IMPLICIT type' error message.
1314         * trans-decl.cc (gfc_get_symbol_decl): Change fatal error locus
1315         to that of the symbol declaration.
1316         (gfc_trans_deferred_vars): Remove two trailing tabs.
1318 2024-04-18  Paul Thomas  <pault@gcc.gnu.org>
1320         PR fortran/114739
1321         * primary.cc (gfc_match_varspec): Check for default type before
1322         checking for derived types with the right component name.
1324 2024-04-16  Harald Anlauf  <anlauf@gmx.de>
1326         PR fortran/113793
1327         * resolve.cc (resolve_allocate_expr): Reject ALLOCATE with SOURCE=
1328         or MOLD= specifier for unequal length.
1329         * trans-stmt.cc (gfc_trans_allocate): If an allocatable character
1330         variable has fixed length, use it and do not use the source length.
1331         With bounds-checking enabled, add a runtime check for same length.
1333 2024-04-10  Harald Anlauf  <anlauf@gmx.de>
1335         PR fortran/106500
1336         * check.cc (is_c_interoperable): Fix checks for C_SIZEOF.
1337         (gfc_check_c_f_pointer): Reject function returning a pointer as FPTR,
1338         and improve an error message.
1340 2024-04-09  Paul Thomas  <pault@gcc.gnu.org>
1342         PR fortran/114535
1343         * resolve.cc (resolve_symbol): Remove last chunk that checked
1344         for finalization of unreferenced symbols.
1346 2024-04-09  Paul Thomas  <pault@gcc.gnu.org>
1348         PR fortran/113956
1349         * trans-expr.cc (gfc_trans_pointer_assignment): Remove assert
1350         causing the ICE since it was unnecesary.
1352 2024-04-02  Paul Thomas  <pault@gcc.gnu.org>
1354         PR fortran/106999
1355         * interface.cc (gfc_compare_interfaces): Add error for a
1356         subroutine proc pointer passed to a variable formal.
1357         (compare_parameter): If a procedure pointer is being passed to
1358         a non-procedure formal arg, and there is an an interface, use
1359         gfc_compare_interfaces to check and provide a more useful error
1360         message.
1362 2024-04-02  Paul Thomas  <pault@gcc.gnu.org>
1364         PR fortran/112407
1365         * resolve.cc (resolve_procedure_expression): Change the test for
1366         for recursion in the case of hidden procedures from modules.
1367         (resolve_typebound_static): Add warning for possible recursive
1368         calls to typebound procedures.
1369         * trans-expr.cc (gfc_trans_class_init_assign): Do not apply
1370         default initializer to class dummy where component initializers
1371         are all null.
1373 2024-03-29  Harald Anlauf  <anlauf@gmx.de>
1375         PR fortran/50410
1376         * trans-expr.cc (gfc_conv_structure): Check for NULL pointer.
1378 2024-03-29  Paul Thomas  <pault@gcc.gnu.org>
1380         PR fortran/36337
1381         PR fortran/110987
1382         PR fortran/113885
1383         * trans-expr.cc (gfc_trans_assignment_1): Place finalization
1384         block before rhs post block for elemental rhs.
1385         * trans.cc (gfc_finalize_tree_expr): Check directly if a type
1386         has no components, rather than the zero components attribute.
1387         Treat elemental zero component expressions in the same way as
1388         scalars.
1390 2024-03-28  Harald Anlauf  <anlauf@gmx.de>
1392         PR fortran/114474
1393         * primary.cc (gfc_variable_attr): Catch variables used in structure
1394         constructors within DATA statements that are still tagged with a
1395         temporary type BT_PROCEDURE from match_actual_arg and which have the
1396         target attribute, and fix their typespec.
1398 2024-03-28  Mikael Morin  <mikael@gcc.gnu.org>
1399             Harald Anlauf  <anlauf@gmx.de>
1401         PR fortran/111781
1402         PR fortran/114475
1403         * expr.cc (check_restricted): In submodules, allow variables host-
1404         associated from the parent module.
1406 2024-03-22  Harald Anlauf  <anlauf@gmx.de>
1408         PR fortran/55978
1409         * interface.cc (gfc_compare_actual_formal): Skip size check for
1410         NULL() actual without MOLD argument.
1412 2024-03-22  Mikael Morin  <mikael@gcc.gnu.org>
1414         PR fortran/107426
1415         * gfortran.h (gfc_save_module_list, gfc_restore_old_module_list):
1416         New declarations.
1417         * module.cc (old_module_list_tail): New global variable.
1418         (gfc_save_module_list, gfc_restore_old_module_list): New functions.
1419         (gfc_use_modules): Set module_list and old_module_list_tail.
1420         * parse.cc (next_statement): Save module_list before doing any work.
1421         (reject_statement): Restore module_list to its saved value.
1423 2024-03-22  Mikael Morin  <mikael@gcc.gnu.org>
1425         PR fortran/111781
1426         * symbol.cc (gfc_get_procedure_ns, gfc_get_spec_ns): New functions.
1427         * gfortran.h (gfc_get_procedure_ns, gfc_get_spec ns): Declare them.
1428         (gfc_is_formal_arg): Remove.
1429         * expr.cc (check_restricted): Remove special case allowing local
1430         variable in dummy argument bound expressions.  Use gfc_get_spec_ns
1431         to get the right namespace.
1432         * resolve.cc (gfc_is_formal_arg, formal_arg_flag): Remove.
1433         (gfc_resolve_formal_arglist): Set gfc_current_ns.  Quit loop and
1434         restore gfc_current_ns instead of early returning.
1435         (resolve_symbol): Factor common array spec resolution code to...
1436         (resolve_symbol_array_spec): ... this new function.  Additionnally
1437         set and restore gfc_current_ns.
1439 2024-03-21  Harald Anlauf  <anlauf@gmx.de>
1441         PR fortran/30802
1442         * trans-array.cc (abridged_ref_name): New helper function.
1443         (trans_array_bound_check): Use it.
1444         (array_bound_check_elemental): Likewise.
1445         (gfc_conv_array_ref): Likewise.
1447 2024-03-20  Jakub Jelinek  <jakub@redhat.com>
1449         * trans-array.cc (structure_alloc_comps): Use integer_zero_node
1450         instead of build_zero_cst (integer_type_node) or
1451         build_int_cst (integer_type_node, 0) and integer_one_node instead of
1452         build_int_cst (integer_type_node, 1).
1453         * trans-expr.cc (conv_scalar_char_value): Likewise.
1454         * trans-stmt.cc (gfc_trans_form_team, gfc_trans_change_team,
1455         gfc_trans_sync_team, gfc_trans_sync): Likewise.
1456         * trans-decl.cc (create_main_function): Likewise.
1457         * trans-intrinsic.cc (trans_this_image, conv_intrinsic_move_alloc):
1458         Likewise.
1459         * trans.cc (gfc_allocate_using_caf_lib, gfc_deallocate_with_status):
1460         Likewise.
1462 2024-03-18  Harald Anlauf  <anlauf@gmx.de>
1464         PR fortran/103715
1465         * frontend-passes.cc (check_externals_expr): Prevent invalid read
1466         in case of mismatch of external subroutine with function.
1468 2024-03-17  Harald Anlauf  <anlauf@gmx.de>
1470         PR fortran/101135
1471         * trans-array.cc (gfc_get_dataptr_offset): Check for optional
1472         arguments being present before dereferencing data pointer.
1474 2024-03-15  Paul Thomas  <pault@gcc.gnu.org>
1476         PR fortran/87477
1477         PR fortran/89645
1478         PR fortran/99065
1479         PR fortran/114141
1480         PR fortran/114280
1481         * class.cc (gfc_change_class): New function needed for
1482         associate names, when rank changes or a derived type is
1483         produced by resolution
1484         * dump-parse-tree.cc (show_code_node): Make output for SELECT
1485         TYPE more comprehensible.
1486         * expr.cc (find_inquiry_ref): Do not simplify expressions of
1487         an inferred type.
1488         * gfortran.h : Add 'gfc_association_list' to structure
1489         'gfc_association_list'. Add prototypes for
1490         'gfc_find_derived_types', 'gfc_fixup_inferred_type_refs' and
1491         'gfc_change_class'. Add macro IS_INFERRED_TYPE.
1492         * match.cc (copy_ts_from_selector_to_associate): Add bolean arg
1493         'select_type' with default false. If this is a select type name
1494         and the selector is a inferred type, build the class type and
1495         apply it to the associate name.
1496         (build_associate_name): Pass true to 'select_type' in call to
1497         previous.
1498         * parse.cc (parse_associate): If the selector is inferred type
1499         the associate name is too. Make sure that function selector
1500         class and rank, if known, are passed to the associate name. If
1501         a function result exists, pass its typespec to the associate
1502         name.
1503         * primary.cc (resolvable_fcns): New function to check that all
1504         the function references are resolvable.
1505         (gfc_match_varspec): If a scalar derived type select type
1506         temporary has an array reference, match the array reference,
1507         treating this in the same way as an equivalence member. Do not
1508         set 'inquiry' if applied to an unknown type the inquiry name
1509         is ambiguous with the component of an accessible derived type.
1510         Check that resolution of the target expression is OK by testing
1511         if the symbol is declared or is an operator expression, then
1512         using 'resolvable_fcns' recursively. If all is well, resolve
1513         the expression. If this is an inferred type with a component
1514         reference, call 'gfc_find_derived_types' to find a suitable
1515         derived type. If there is an inquiry ref and the symbol either
1516         is of unknown type or is inferred to be a derived type, set the
1517         primary and symbol TKR appropriately.
1518         * resolve.cc (resolve_variable): Call new function below.
1519         (gfc_fixup_inferred_type_refs): New function to ensure that the
1520         expression references for a inferred type are consistent with
1521         the now fixed up selector.
1522         (resolve_assoc_var): Ensure that derived type or class function
1523         selectors transmit the correct arrayspec to the associate name.
1524         (resolve_select_type): If the selector is an associate name of
1525         inferred type and has no component references, the associate
1526         name should have its typespec. Simplify the conversion of a
1527         class array to class scalar by calling 'gfc_change_class'.
1528         Make sure that a class, inferred type selector with an array
1529         ref transfers the typespec from the symbol to the expression.
1530         * symbol.cc (gfc_set_default_type): If an associate name with
1531         unknown type has a selector expression, try resolving the expr.
1532         (find_derived_types, gfc_find_derived_types): New functions
1533         that search for a derived type with a given name.
1534         * trans-expr.cc (gfc_conv_variable): Some inferred type exprs
1535         escape resolution so call 'gfc_fixup_inferred_type_refs'.
1536         * trans-stmt.cc (trans_associate_var): Tidy up expression for
1537         'class_target'. Finalize and free class function results.
1538         Correctly handle selectors that are class functions and class
1539         array references, passed as derived types.
1541 2024-03-14  Thomas Schwinge  <thomas@codesourcery.com>
1543         * dump-parse-tree.cc (show_omp_clauses): Handle 'self_expr'.
1544         * openmp.cc (gfc_free_omp_clauses): Likewise.
1545         * trans-openmp.cc (gfc_split_omp_clauses): Don't handle 'self_expr'.
1547 2024-03-14  Chung-Lin Tang  <cltang@baylibre.com>
1549         * dump-parse-tree.cc (show_omp_namelist): Print "readonly," for
1550         OMP_LIST_MAP and OMP_LIST_CACHE if n->u.map.readonly is set.
1551         Adjust 'n->u.map_op' to 'n->u.map.op'.
1552         * gfortran.h (typedef struct gfc_omp_namelist): Adjust map_op as
1553         'ENUM_BITFIELD (gfc_omp_map_op) op:8', add 'bool readonly' field,
1554         change to named struct field 'map'.
1555         * openmp.cc (gfc_match_omp_map_clause): Adjust 'n->u.map_op' to
1556         'n->u.map.op'.
1557         (gfc_match_omp_clause_reduction): Likewise.
1558         (gfc_match_omp_clauses): Add readonly modifier parsing for OpenACC
1559         copyin clause, set 'n->u.map.op' and 'n->u.map.readonly' for parsed
1560         clause. Adjust 'n->u.map_op' to 'n->u.map.op'.
1561         (gfc_match_oacc_declare): Adjust 'n->u.map_op' to 'n->u.map.op'.
1562         (gfc_match_oacc_cache): Add readonly modifier parsing for OpenACC
1563         cache directive.
1564         (resolve_omp_clauses): Adjust 'n->u.map_op' to 'n->u.map.op'.
1565         * trans-decl.cc (add_clause): Adjust 'n->u.map_op' to 'n->u.map.op'.
1566         (finish_oacc_declare): Likewise.
1567         * trans-openmp.cc (gfc_trans_omp_clauses): Set OMP_CLAUSE_MAP_READONLY,
1568         OMP_CLAUSE__CACHE__READONLY to 1 when readonly is set. Adjust
1569         'n->u.map_op' to 'n->u.map.op'.
1570         (gfc_add_clause_implicitly): Adjust 'n->u.map_op' to 'n->u.map.op'.
1572 2024-03-13  Harald Anlauf  <anlauf@gmx.de>
1574         PR fortran/114001
1575         * expr.cc (gfc_is_simply_contiguous): Adjust logic so that CLASS
1576         symbols are also handled.
1578 2024-03-13  Tobias Burnus  <tburnus@baylibre.com>
1580         PR fortran/114283
1581         * trans-openmp.cc (gfc_omp_predetermined_mapping): Map dummy
1582         procedures as firstprivate.
1584 2024-03-12  Harald Anlauf  <anlauf@gmx.de>
1586         PR fortran/110826
1587         * array.cc (gfc_array_dimen_size): When walking the ref chain of an
1588         array and the ultimate component is a procedure pointer, do not try
1589         to figure out its dimension even if it is a array-valued function.
1591 2024-03-06  Harald Anlauf  <anlauf@gmx.de>
1593         PR fortran/103707
1594         PR fortran/106987
1595         * arith.cc (is_hard_arith_error): New helper function to determine
1596         whether an arithmetic error is "hard" or not.
1597         (check_result): Use it.
1598         (gfc_arith_divide): Set "Division by zero" only for regular
1599         numerators of real and complex divisions.
1600         (reduce_unary): Use is_hard_arith_error to determine whether a hard
1601         or (recoverable) soft error was encountered.  Terminate immediately
1602         on hard error, otherwise remember code of first soft error.
1603         (reduce_binary_ac): Likewise.
1604         (reduce_binary_ca): Likewise.
1605         (reduce_binary_aa): Likewise.
1607 2024-03-01  Harald Anlauf  <anlauf@gmx.de>
1609         PR fortran/104819
1610         * check.cc (gfc_check_null): Handle nested NULL()s.
1611         (is_c_interoperable): Check for MOLD argument of NULL() as part of
1612         the interoperability check.
1613         * interface.cc (gfc_compare_actual_formal): Extend checks for NULL()
1614         actual arguments for presence of MOLD argument when required by
1615         Interp J3/22-146.
1617 2024-02-29  Alexander Westbrooks  <alexanderw@gcc.gnu.org>
1619         PR fortran/82943
1620         PR fortran/86148
1621         PR fortran/86268
1622         * decl.cc (gfc_get_pdt_instance): Set the PDT instance field
1623         'f2k_derived', if not set already, to point to the given
1624         PDT template 'f2k_derived' namespace in order to give the
1625         PDT instance referential access to the typebound procedures
1626         of the template.
1627         * gfortran.h (gfc_pdt_is_instance_of): Add prototype.
1628         * resolve.cc (resolve_typebound_procedure): If the derived type
1629         does not have the attribute 'pdt_template' set, compare the
1630         dummy argument to the 'resolve_bindings_derived' type like usual.
1631         If the derived type is a 'pdt_template', then check if the
1632         dummy argument is an instance of the PDT template. If the derived
1633         type is a PDT template, and the dummy argument is an instance of
1634         that template, but the dummy argument 'param_list' is not
1635         SPEC_ASSUMED, check if there are any LEN parameters in the
1636         dummy argument. If there are no LEN parameters, then this implies
1637         that there are only KIND parameters in the dummy argument.
1638         If there are LEN parameters, this would be an error, for all
1639         LEN parameters for the dummy argument MUST be assumed for
1640         typebound procedures of PDTs.
1641         (resolve_pdt): Add a check for ALLOCATABLE and POINTER attributes for
1642         SPEC_DEFERRED parameters of PDT class symbols.  ALLOCATABLE and
1643         POINTER attributes for a PDT class symbol are stored in the
1644         'class_pointer' and 'allocatable' attributes of the '_data'
1645         component respectively.
1646         * symbol.cc (gfc_pdt_is_instance_of): New function.
1648 2024-02-26  Harald Anlauf  <anlauf@gmx.de>
1650         PR fortran/114012
1651         * trans-expr.cc (gfc_conv_procedure_call): Evaluate non-trivial
1652         arguments just once before assigning to an unlimited polymorphic
1653         dummy variable.
1655 2024-02-23  Steve Kargl  <kargl@gcc.gnu.org>
1656             Harald Anlauf  <anlauf@gmx.de>
1658         PR fortran/114024
1659         * trans-stmt.cc (gfc_trans_allocate): When a source expression has
1660         substring references, part-refs, or %re/%im inquiries, wrap the
1661         entity in parentheses to force evaluation of the expression.
1663 2024-02-23  Tobias Burnus  <tburnus@baylibre.com>
1665         * openmp.cc (gfc_match_omp_depobj): Use OPT_Wopenmp
1666         as warning category in gfc_warning.
1668 2024-02-20  Peter Hill  <peter.hill@york.ac.uk>
1670         PR fortran/105658
1671         * trans-expr.cc (gfc_conv_intrinsic_to_class): When passing an
1672         array component reference of intrinsic type to a procedure
1673         with an unlimited polymorphic dummy argument, a temporary
1674         should be created.
1676 2024-02-17  Jakub Jelinek  <jakub@redhat.com>
1678         PR fortran/113503
1679         * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Don't
1680         overwrite expr2->ts.u.cl->backend_decl, instead set size to
1681         expr2->ts.u.cl->backend_decl first and use size instead of
1682         expr2->ts.u.cl->backend_decl.
1683         (gfc_trans_subcomponent_assign): Emit se.pre into block
1684         before calling alloc_scalar_allocatable_subcomponent instead of
1685         after it.
1687 2024-02-17  Harald Anlauf  <anlauf@gmx.de>
1689         PR fortran/113911
1690         * trans-array.cc (gfc_trans_deferred_array): Do not clobber
1691         deferred length for a character variable passed as dummy argument.
1693 2024-02-15  Kwok Cheung Yeung  <kcyeung@baylibre.com>
1695         * dump-parse-tree.cc (show_attr): Handle omp_declare_target_indirect
1696         attribute.
1697         * f95-lang.cc (gfc_gnu_attributes): Add entry for 'omp declare
1698         target indirect'.
1699         * gfortran.h (symbol_attribute): Add omp_declare_target_indirect
1700         field.
1701         (struct gfc_omp_clauses): Add indirect field.
1702         * openmp.cc (omp_mask2): Add OMP_CLAUSE_INDIRECT.
1703         (gfc_match_omp_clauses): Match indirect clause.
1704         (OMP_DECLARE_TARGET_CLAUSES): Add OMP_CLAUSE_INDIRECT.
1705         (gfc_match_omp_declare_target): Check omp_device_type and apply
1706         omp_declare_target_indirect attribute to symbol if indirect clause
1707         active.  Show warning if there are only device_type and/or indirect
1708         clauses on the directive.
1709         * trans-decl.cc (add_attributes_to_decl): Add 'omp declare target
1710         indirect' attribute if symbol has indirect attribute set.
1712 2024-02-14  Steve Kargl  <kargl@gcc.gnu.org>
1714         PR fortran/105847
1715         * trans-io.cc (transfer_namelist_element): When building the
1716         namelist object name, if the use rename attribute is set, use
1717         the local name specified in the use statement.
1719 2024-02-14  Jakub Jelinek  <jakub@redhat.com>
1721         * error.cc (error_print): For u printing of ptrdiff_t,
1722         print ptrdiff_t argument converted to unsigned long long and
1723         masked with 2ULL * PTRDIFF_MAX + 1.
1725 2024-02-13  Tobias Burnus  <tburnus@baylibre.com>
1727         PR middle-end/113904
1728         * trans-openmp.cc (gfc_trans_omp_declare_variant): Handle splitting of
1729         OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
1730         * openmp.cc (gfc_match_omp_context_selector): Likewise; rejects
1731         non-const device_num/condition; improve diagnostic.
1733 2024-02-13  Harald Anlauf  <anlauf@gmx.de>
1735         PR fortran/113866
1736         * trans-expr.cc (gfc_conv_procedure_call): When passing an optional
1737         dummy argument to an optional dummy argument of a bind(c) procedure
1738         and the dummy argument is passed via a CFI descriptor, no special
1739         presence check and passing of a default NULL pointer is needed.
1741 2024-02-13  Steve Kargl  <kargl@gcc.gnu.org>
1743         PR fortran/113883
1744         * trans-array.cc (gfc_trans_deferred_array): Set length to zero,
1745         avoiding extraneous diagnostics.
1747 2024-02-10  Jakub Jelinek  <jakub@redhat.com>
1749         * error.cc (error_print): Handle z and t modifiers on d, i and u.
1750         * check.cc (gfc_check_transfer): Use %zd instead of %ld and casts to
1751         long.
1752         * primary.cc (gfc_convert_to_structure_constructor): Use %td instead
1753         of %ld and casts to long.
1755 2024-02-10  Jakub Jelinek  <jakub@redhat.com>
1757         * trans-common.cc (build_common_decl): Use %wu instead of %lu and
1758         casts to unsigned long.
1759         * resolve.cc (resolve_ordinary_assign): Use %wd instead of %ld and
1760         casts to long.
1761         * array.cc (gfc_resolve_character_array_constructor): Likewise.
1762         * data.cc (create_character_initializer): Likewise.
1764 2024-02-09  Harald Anlauf  <anlauf@gmx.de>
1766         PR fortran/113799
1767         * arith.cc (reduce_unary): Remember any overflow encountered during
1768         reduction of unary arithmetic operations on array constructors and
1769         continue, and return error status, but terminate on serious errors.
1771 2024-01-28  Harald Anlauf  <anlauf@gmx.de>
1773         PR fortran/113377
1774         * trans-expr.cc (conv_dummy_value): Treat NULL actual argument to
1775         optional dummy with the VALUE attribute as not present.
1776         (gfc_conv_procedure_call): Likewise.
1778 2024-01-27  Harald Anlauf  <anlauf@gmx.de>
1780         PR fortran/104908
1781         * trans-array.cc (gfc_conv_array_ref): Restrict use of transformed
1782         descriptor (sym->backend_decl) to the unlimited polymorphic case.
1784 2024-01-24  Harald Anlauf  <anlauf@gmx.de>
1786         PR fortran/113377
1787         * trans-expr.cc (conv_dummy_value): New.
1788         (gfc_conv_procedure_call): Factor code for handling dummy arguments
1789         with the VALUE attribute in the scalar case into conv_dummy_value().
1790         Reuse and adjust for calling elemental procedures.
1792 2024-01-21  Harald Anlauf  <anlauf@gmx.de>
1794         PR fortran/113377
1795         * trans-expr.cc (gfc_conv_procedure_call): Fix handling of optional
1796         scalar arguments of intrinsic type with the VALUE attribute.
1798 2024-01-20  Mikael Morin  <mikael@gcc.gnu.org>
1800         PR fortran/48776
1801         PR fortran/111291
1802         * parse.cc: Restore current interface to its previous value on error.
1804 2024-01-19  Harald Anlauf  <anlauf@gmx.de>
1806         PR fortran/113471
1807         * trans-array.cc (array_bound_check_elemental): Array bounds check
1808         shall apply here to elemental dimensions of an array section only.
1810 2024-01-13  Harald Anlauf  <anlauf@gmx.de>
1812         PR fortran/67277
1813         * trans-intrinsic.cc (gfc_conv_intrinsic_ishftc): Handle optional
1814         dummy argument for SIZE passed to ISHFTC.  Set default value to
1815         BIT_SIZE(I) when missing.
1817 2024-01-13  Harald Anlauf  <anlauf@gmx.de>
1819         PR fortran/113305
1820         * gfortran.h (gfc_loop_annot): New.
1821         (gfc_iterator, gfc_forall_iterator): Use for annotation control.
1822         * array.cc (gfc_copy_iterator): Adjust.
1823         * gfortran.texi: Document annotations IVDEP, UNROLL n, VECTOR,
1824         NOVECTOR as applied to DO CONCURRENT.
1825         * parse.cc (parse_do_block): Parse annotations IVDEP, UNROLL n,
1826         VECTOR, NOVECTOR as applied to DO CONCURRENT.  Apply UNROLL only to
1827         first loop control variable.
1828         * trans-stmt.cc (iter_info): Use gfc_loop_annot.
1829         (gfc_trans_simple_do): Adjust.
1830         (gfc_trans_forall_loop): Annotate loops with IVDEP, UNROLL n,
1831         VECTOR, NOVECTOR as needed for DO CONCURRENT.
1832         (gfc_trans_forall_1): Handle loop annotations.
1834 2024-01-08  Harald Anlauf  <anlauf@gmx.de>
1836         PR fortran/113245
1837         * trans-intrinsic.cc (gfc_conv_intrinsic_size): Use
1838         gfc_conv_expr_present() for proper check of optional DIM argument.
1840 2024-01-06  Harald Anlauf  <anlauf@gmx.de>
1841             José Rui Faustino de Sousa  <jrfsousa@gmail.com>
1843         PR fortran/96724
1844         * iresolve.cc (gfc_resolve_repeat): Force conversion to
1845         gfc_charlen_int_kind before call to gfc_multiply.
1847 2024-01-04  David Malcolm  <dmalcolm@redhat.com>
1849         * lang.opt.urls: New file, autogenerated by
1850         regenerate-opt-urls.py.
1852 2024-01-03  Harald Anlauf  <anlauf@gmx.de>
1854         * trans-types.cc (gfc_get_nodesc_array_type): Clear used gmp
1855         variables.
1857 2024-01-03  Jakub Jelinek  <jakub@redhat.com>
1859         * gfortranspec.cc (lang_specific_driver): Update copyright notice
1860         dates.
1861         * gfc-internals.texi: Bump @copying's copyright year.
1862         * gfortran.texi: Ditto.
1863         * intrinsic.texi: Ditto.
1864         * invoke.texi: Ditto.
1867 Copyright (C) 2024 Free Software Foundation, Inc.
1869 Copying and distribution of this file, with or without modification,
1870 are permitted in any medium without royalty provided the copyright
1871 notice and this notice are preserved.