1 2024-10-15 Thomas Schwinge <tschwinge@baylibre.com>
2 Harald Anlauf <anlauf@gmx.de>
7 * trans-expr.cc (gfc_conv_procedure_call): Initialize
9 (conv_function_val): Clean up.
11 2024-10-14 Andre Vehreschild <vehre@gcc.gnu.org>
14 * trans-expr.cc (gfc_conv_derived_to_class): Assign token when
15 converting a coarray to class.
16 (gfc_get_tree_for_caf_expr): For classes get the caf decl from
18 (gfc_get_caf_token_offset):Assert that coarray=lib is set and
19 cover more cases where the tree having the coarray token can be.
20 * trans-intrinsic.cc (gfc_conv_intrinsic_caf_get): Use unified
23 2024-10-13 Tobias Burnus <tburnus@baylibre.com>
25 * gfortran.h (gfc_option_t): Add disable_acc_on_device.
26 * options.cc (gfc_handle_option): Handle -fno-builtin-acc_on_device.
27 * trans-decl.cc (gfc_get_extern_function_decl): Move
28 __builtin_omp_is_initial_device handling to ...
29 * trans-expr.cc (get_builtin_fn): ... this new function.
30 (conv_function_val): Call it.
31 (update_builtin_function): New.
32 (gfc_conv_procedure_call): Call it.
33 * types.def (BT_BOOL): Fix type by using bool_type_node.
35 2024-10-12 Thomas Koenig <tkoenig@gcc.gnu.org>
37 * dump-parse-tree.cc (get_c_type_name): Also handle BT_UNSIGNED.
38 * gfortran.h (NAMED_UINTCST): Define before inclusion
39 of iso-c-binding.def and iso-fortran-env.def.
40 (gfc_get_uint_kind_from_width_isofortranenv): Prototype.
41 * gfortran.texi: Mention new constants in iso_c_binding and
43 * iso-c-binding.def: Handle NAMED_UINTCST. Add c_unsigned,
44 c_unsigned_short,c_unsigned_char, c_unsigned_long,
45 c_unsigned_long_long, c_uintmax_t, c_uint8_t, c_uint16_t,
46 c_uint32_t, c_uint64_t, c_uint128_t, c_uint_least8_t,
47 c_uint_least16_t, c_uint_least32_t, c_uint_least64_t,
48 c_uint_least128_t, c_uint_fast8_t, c_uint_fast16_t,
49 c_uint_fast32_t, c_uint_fast64_t and c_uint_fast128_t.
50 * iso-fortran-env.def: Handle NAMED_UINTCST. Add uint8, uint16,
52 * module.cc (parse_integer): Whitespace fix.
53 (write_module): Whitespace fix.
54 (NAMED_UINTCST): Define before inclusion of iso-fortran-evn.def
55 and iso-fortran-env.def.
56 * symbol.cc: Likewise.
57 * trans-types.cc (get_unsigned_kind_from_node): New function.
58 (get_uint_kind_from_name): New function.
59 (gfc_get_uint_kind_from_width_isofortranenv): New function.
60 (get_uint_kind_from_width): New function.
61 (gfc_init_kinds): Initialize gfc_c_uint_kind.
63 2024-10-12 Tobias Burnus <tburnus@baylibre.com>
65 * openmp.cc (resolve_omp_clauses): Diagnose polymorphic mapping.
66 * trans-openmp.cc (gfc_omp_finish_clause): Warn when
67 polymorphic variable is implicitly mapped.
69 2024-10-12 Tobias Burnus <tburnus@baylibre.com>
71 * array.cc (gfc_match_array_constructor): Only update the
72 character length if the expression is of character type.
73 * error.cc (gfc_get_location_with_offset): New; split off
75 (gfc_format_decoder): ... here; call it.
76 * gfortran.h (gfc_get_location_with_offset): New prototype.
77 (gfc_get_location): New inline function.
78 * trans.cc (gfc_get_location): Remove function definition.
79 * trans.h (gfc_get_location): Remove declaration.
81 2024-10-11 Thomas Koenig <tkoenig@gcc.gnu.org>
83 * intrinsic.cc (add_functions): Convert uint and
84 selected_unsigned_kind to GFC_STD_UNSIGNED.
85 (gfc_check_intrinsic_standard): Handle GFC_STD_UNSIGNED.
86 * libgfortran.h (GFC_STD_UNSIGNED): Add.
87 * options.cc (gfc_post_options): Set GFC_STD_UNSIGNED
90 2024-10-11 Tobias Burnus <tburnus@baylibre.com>
92 * error.cc (error_char, error_string, error_uinteger, error_integer,
93 error_hwuint, error_hwint, gfc_widechar_display_length,
94 gfc_wide_display_length, error_printf, show_locus, show_loci):
95 Remove unused static functions.
96 (IBUF_LEN, MAX_ARGS): Remove now unused #define.
98 2024-10-08 Andre Vehreschild <vehre@gcc.gnu.org>
101 * array.cc (gfc_match_array_ref): Only parse coarray part of
103 * match.h (gfc_match_array_ref): Add flag.
104 * primary.cc (gfc_match_varspec): Request only coarray ref
105 parsing when no regular array is present. Report error on
106 unexpected additional ref.
108 2024-10-07 Thomas Koenig <tkoenig@gcc.gnu.org>
110 * check.cc (gfc_check_minloc_maxloc): Handle BT_UNSIGNED.
111 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Likewise.
112 * gfortran.texi: Document MAXLOC and MINLOC for UNSIGNED.
114 2024-10-07 Tobias Burnus <tburnus@baylibre.com>
116 * openmp.cc (is_predefined_allocator): Use gomp-constants.h consts.
117 * trans-common.cc (translate_common): Reject OpenMP allocate directives.
118 * trans-decl.cc (gfc_finish_var_decl): Handle allocate directive
119 for static variables.
120 (gfc_trans_deferred_vars): Update for the latter.
122 2024-10-01 Thomas Koenig <tkoenig@gcc.gnu.org>
124 * check.cc (int_or_real_or_char_or_unsigned_check_f2003): New function.
125 (gfc_check_minval_maxval): Use it.
126 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxval): Handle
127 initial values for UNSIGNED.
128 * gfortran.texi: Document MINVAL and MAXVAL for unsigned.
130 2024-09-30 David Malcolm <dmalcolm@redhat.com>
133 * error.cc (gfc_diagnostic_build_locus_prefix): Convert first
134 param from diagnostic_context * to
135 const diagnostic_location_print_policy &. Add colorize param.
136 Likewise for the "two expanded_locations" overload.
137 (gfc_diagnostic_text_starter): Update for above changes.
138 (gfc_diagnostic_start_span): Update for change to callback type.
140 2024-09-30 Andre Vehreschild <vehre@gcc.gnu.org>
143 * trans-expr.cc (gfc_conv_procedure_call): Ensure coarrays use a
144 descriptor when passed.
146 2024-09-28 Thomas Koenig <tkoenig@gcc.gnu.org>
148 * check.cc (intrinsic_type_check): Handle unsigned.
149 (gfc_check_findloc): Likewise.
150 * gfortran.texi: Include FINDLOC in unsigned documentation.
151 * iresolve.cc (gfc_resolve_findloc): Use INTEGER version
154 2024-09-28 Thomas Koenig <tkoenig@gcc.gnu.org>
156 * check.cc (gfc_check_eoshift): Handle BT_UNSIGNED.
157 * simplify.cc (gfc_simplify_eoshift): Likewise.
158 * gfortran.texi: Document CSHIFT and EOSHIFT for UNSIGNED.
160 2024-09-26 Mikael Morin <mikael@gcc.gnu.org>
162 * invoke.texi (-M): Remove index reference to removed documentation.
164 2024-09-25 Mikael Morin <mikael@gcc.gnu.org>
167 * invoke.texi: Remove @code wrapping in arguments to @opindex.
168 (std=): Remove spurious 'option' in index.
169 (idirafter, imultilib, iprefix, isysroot, iquote, isystem,
170 fintrinsic-modules-path): Remove variable from index.
171 * lang.opt.urls: Regenerate.
173 2024-09-25 Tobias Burnus <tburnus@baylibre.com>
175 * parse.cc (decode_omp_directive): Set target-used bit of
176 omp_requires_mask when encountering the declare_target or interop
179 2024-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
181 * check.cc (gfc_check_random_number): Adjust for unsigned.
182 * iresolve.cc (gfc_resolve_random_number): Handle unsigned.
183 * trans-expr.cc (gfc_conv_expr_op): Handle BT_UNSIGNED for divide.
184 * trans-types.cc (gfc_get_dtype_rank_type): Handle BT_UNSIGNED.
185 * gfortran.texi: Add RANDOM_NUMBER for UNSIGNED.
187 2024-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
189 * check.cc (gfc_check_transf_bit_intrins): Handle unsigned.
190 * gfortran.texi: Docment IANY, IALL and IPARITY for unsigned.
191 * iresolve.cc (gfc_resolve_iall): Set flag to use integer
192 if type is BT_UNSIGNED.
193 (gfc_resolve_iany): Likewise.
194 (gfc_resolve_iparity): Likewise.
195 * simplify.cc (do_bit_and): Adjust asserts for BT_UNSIGNED.
196 (do_bit_ior): Likewise.
197 (do_bit_xor): Likewise
199 2024-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
201 * gfortran.texi: Document SUM and PRODUCT.
202 * iresolve.cc (resolve_transformational): New argument,
203 use_integer, to translate calls to unsigned to calls to
205 (gfc_resolve_product): Use it
206 (gfc_resolve_sum): Use it.
207 * simplify.cc (init_result_expr): Handle BT_UNSIGNED.
209 2024-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
211 * arith.cc (gfc_arith_uminus): Fix warning.
212 (gfc_arith_minus): Correctly truncate unsigneds.
213 * check.cc (gfc_check_dot_product): Handle unsigned arguments.
214 (gfc_check_matmul): Likewise.
215 * expr.cc (gfc_get_unsigned_expr): New function.
216 * gfortran.h (gfc_get_unsigned_expr): Add prototype.
217 * iresolve.cc (gfc_resolve_matmul): If using UNSIGNED, use the
218 signed integer version.
219 * gfortran.texi: Document MATMUL and DOT_PRODUCT for unsigned.
220 * simplify.cc (compute_dot_product): Handle unsigneds.
222 2024-09-24 Andre Vehreschild <vehre@gcc.gnu.org>
225 * trans-expr.cc (trans_caf_token_assign): Take caf-token from
226 decl for non ultimate coarray components.
228 2024-09-24 Andre Vehreschild <vehre@gcc.gnu.org>
231 * trans-array.cc (duplicate_allocatable_coarray): For scalar
232 allocatable components the memory allocated is now assigned to
233 the component's pointer.
235 2024-09-24 Tobias Burnus <tburnus@baylibre.com>
237 * gfortran.h (enum gfc_omp_requires_kind): Add OMP_REQ_SELF_MAPS.
238 (gfc_namespace): Enlarge omp_requires bitfield.
239 * module.cc (enum ab_attribute, attr_bits): Add AB_OMP_REQ_SELF_MAPS.
240 (mio_symbol_attribute): Handle it.
241 * openmp.cc (gfc_check_omp_requires, gfc_match_omp_requires): Handle
243 * parse.cc (gfc_parse_file): Handle self_maps clause.
245 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
248 * invoke.texi(finline-intrinsics): Document new flag.
249 * lang.opt (finline-intrinsics, finline-intrinsics=,
250 fno-inline-intrinsics): New flags.
251 * options.cc (gfc_post_options): If the option variable controlling
252 the inlining of MAXLOC (respectively MINLOC) has not been set, set
253 it or clear it depending on the optimization option variables.
254 * trans-intrinsic.cc (gfc_inline_intrinsic_function_p): Return false
255 if inlining for the intrinsic is disabled according to the option
258 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
261 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Generate a set
262 of index variables. Set them using the loop indexes before leaving
263 the first set of loops. Generate a new loop entry predicate.
264 Initialize it. Set it before leaving the first set of loops. Clear
265 it in the body of the second set of loops. For the second set of
266 loops, update each loop lower bound to use the corresponding index
267 variable if the predicate variable is set.
269 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
272 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Initialize
273 and update all the variables. Put the label and goto in the
274 outermost scalarizer loop. Don't start the second loop where the
276 (gfc_inline_intrinsic_function_p): Also return TRUE for array MASK
277 or for any REAL type.
279 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
282 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Generate
283 variable initialization for each dimension in the else branch of
284 the toplevel condition.
285 (gfc_inline_intrinsic_function_p): Return TRUE for scalar MASK.
287 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
290 * trans-array.cc (gfc_conv_ss_startstride): Set the MINLOC/MAXLOC
291 result upper bound using the rank of the ARRAY argument. Ajdust
292 the error message for intrinsic result arrays. Only check array
293 bounds for array references. Move bound check decision code...
294 (bounds_check_needed): ... here as a new predicate. Allow bound
295 check for MINLOC/MAXLOC intrinsic results.
296 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Change the
297 result array upper bound to the rank of ARRAY. Update the NONEMPTY
298 variable to depend on the non-empty extent of every dimension. Use
299 one variable per dimension instead of a single variable for the
300 position and the offset. Update their declaration, initialization,
301 and update to affect the variable of each dimension. Use the first
302 variable only in areas only accessed with rank 1 ARRAY argument.
303 Set every element of the result using its corresponding variable.
304 (gfc_inline_intrinsic_function_p): Return true for integral ARRAY
305 and absent DIM and MASK.
307 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
309 * trans-array.cc (gfc_conv_ss_startstride): Move array bound check
311 (add_check_section_in_array_bounds): ... here as a new function.
313 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
315 * frontend-passes.cc (optimize_minmaxloc): Remove.
316 (optimize_expr): Remove dispatch to optimize_minmaxloc.
318 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
321 * trans-array.cc (gfc_conv_ss_startstride): Set the scalarization
322 rank based on the MINLOC/MAXLOC rank if needed. Call the inline
323 code generation and setup the scalarizer array descriptor info
324 in the MINLOC and MAXLOC cases.
325 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Return the
326 result array element if the scalarizer is setup and we are inside
327 the loops. Restrict library function call dispatch to the case
328 where inline expansion is not supported. Declare an array result
329 if the expression isn't scalar. Initialize the array result single
330 element and return the result variable if the expression isn't
332 (walk_inline_intrinsic_minmaxloc): New function.
333 (walk_inline_intrinsic_function): Add MINLOC and MAXLOC cases,
334 dispatching to walk_inline_intrinsic_minmaxloc.
335 (gfc_add_intrinsic_ss_code): Add MINLOC and MAXLOC cases.
336 (gfc_inline_intrinsic_function_p): Return true if ARRAY has rank 1,
339 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
342 * frontend-passes.cc (optimize_minmaxloc): Skip if we can generate
343 inline code for the unmodified expression.
344 * trans-intrinsic.cc (gfc_inline_intrinsic_function_p): Add
345 MINLOC and MAXLOC cases.
347 2024-09-20 David Malcolm <dmalcolm@redhat.com>
350 * error.cc: Include "diagnostic-format-text.h".
351 (gfc_diagnostic_starter): Rename to...
352 (gfc_diagnostic_text_starter): ...this. Convert first
353 param from diagnostic_context * to diagnostic_text_output_format &
354 and update accordingly.
355 (gfc_diagnostic_finalizer, gfc_diagnostic_text_finalizer):
357 (gfc_diagnostics_init): Update for renamings.
358 (gfc_diagnostics_finish): Likewise.
360 2024-09-19 Andre Vehreschild <vehre@gcc.gnu.org>
363 * trans-types.cc (gfc_get_derived_type): Only build non-pointer
364 derived types as component's types when they are not yet built.
366 2024-09-19 Andre Vehreschild <vehre@gcc.gnu.org>
369 * trans-array.cc (duplicate_allocatable_coarray): Allow adding
370 of deep copy code in the when-allocated case. Add bounds
371 computation before condition, because coarrays need the bounds
372 also when not allocated.
373 (structure_alloc_comps): Duplication in the coarray case is done
374 already, omit it. Add the deep-code when duplication a coarray.
375 * trans-expr.cc (gfc_trans_structure_assign): Fix comment.
377 2024-09-15 Mikael Morin <mikael@gcc.gnu.org>
379 * trans-expr.cc (gfc_advance_se_ss_chain): Don't use an element
380 from the parent scalarization chain when the current chain reaches
383 2024-09-13 Tobias Burnus <tburnus@baylibre.com>
386 * gfortran.h (gfc_omp_namelist): Rename 'init' members for clarity.
387 * match.cc (gfc_free_omp_namelist): Handle renaming.
388 * dump-parse-tree.cc (show_omp_namelist): Update for new format
390 * openmp.cc (gfc_match_omp_prefer_type): Parse list to 'fr' and 'attr';
391 store 'fr' values as integer.
392 (gfc_match_omp_init): Rename variable names.
394 2024-09-12 Steven G. Kargl <kargl@gcc.gnu.org>
396 * module.cc (bt_types): Add BT_UNSIGNED.
398 2024-09-11 Tobias Burnus <tburnus@baylibre.com>
401 * openmp.cc (gfc_match_omp_prefer_type): NULL init a gfc_expr
402 variable and use right locus in gfc_error.
404 2024-09-09 David Malcolm <dmalcolm@redhat.com>
406 * cpp.cc (cb_cpp_diagnostic_cpp_option): Convert return type from
407 "int" to "diagnostic_option_id".
408 (cb_cpp_diagnostic): Update for renaming of
409 diagnostic_override_option_index to diagnostic_set_option_id.
410 * error.cc (gfc_warning): Update for renaming of diagnostic_info
412 (gfc_warning_now_at): Likewise.
413 (gfc_warning_now): Likewise.
414 (gfc_warning_internal): Likewise.
416 2024-09-09 David Malcolm <dmalcolm@redhat.com>
419 * error.cc (gfc_clear_pp_buffer): Rename diagnostic_context's
420 "printer" field to "m_printer".
421 (gfc_warning): Likewise.
422 (gfc_diagnostic_build_kind_prefix): Likewise.
423 (gfc_diagnostic_build_locus_prefix): Likewise.
424 (gfc_diagnostic_starter): Likewise.
425 (gfc_diagnostic_starter): Likewise.
426 (gfc_diagnostic_start_span): Likewise.
427 (gfc_diagnostic_finalizer): Likewise.
428 (gfc_warning_check): Likewise.
429 (gfc_error_opt): Likewise.
430 (gfc_error_check): Likewise.
432 2024-09-07 Thomas Koenig <tkoenig@gcc.gnu.org>
434 * arith.cc (gfc_reduce_unsigned): New function.
435 (gfc_arith_error): Add ARITH_UNSIGNED_TRUNCATED and
436 ARITH_UNSIGNED_NEGATIVE.
437 (gfc_arith_init_1): Initialize unsigned types.
438 (gfc_check_unsigned_range): New function.
439 (gfc_range_check): Handle unsigned types.
440 (gfc_arith_uminus): Likewise.
441 (gfc_arith_plus): Likewise.
442 (gfc_arith_minus): Likewise.
443 (gfc_arith_times): Likewise.
444 (gfc_arith_divide): Likewise.
445 (gfc_compare_expr): Likewise.
446 (eval_intrinsic): Likewise.
447 (gfc_int2int): Also convert unsigned.
448 (gfc_uint2uint): New function.
449 (gfc_int2uint): New function.
450 (gfc_uint2int): New function.
451 (gfc_uint2real): New function.
452 (gfc_uint2complex): New function.
453 (gfc_real2uint): New function.
454 (gfc_complex2uint): New function.
455 (gfc_log2uint): New function.
456 (gfc_uint2log): New function.
457 * arith.h (gfc_int2uint, gfc_uint2uint, gfc_uint2int, gfc_uint2real):
459 (gfc_uint2complex, gfc_real2uint, gfc_complex2uint, gfc_log2uint):
461 (gfc_uint2log): Likewise.
462 * check.cc (gfc_boz2uint): New function
463 (type_check2): New function.
464 (int_or_real_or_unsigned_check): New function.
465 (less_than_bitsizekind): Adjust for unsingeds.
466 (less_than_bitsize2): Likewise.
467 (gfc_check_allocated): Likewise.
468 (gfc_check_mod): Likewise.
469 (gfc_check_bge_bgt_ble_blt): Likewise.
470 (gfc_check_bitfcn): Likewise.
471 (gfc_check_digits): Likewise.
472 (gfc_check_dshift): Likewise.
473 (gfc_check_huge): Likewise.
474 (gfc_check_iu): New function.
475 (gfc_check_iand_ieor_ior): Adjust for unsigneds.
476 (gfc_check_ibits): Likewise.
477 (gfc_check_uint): New function.
478 (gfc_check_ishft): Adjust for unsigneds.
479 (gfc_check_ishftc): Likewise.
480 (gfc_check_min_max): Likewise.
481 (gfc_check_merge_bits): Likewise.
482 (gfc_check_selected_int_kind): Likewise.
483 (gfc_check_shift): Likewise.
484 (gfc_check_mvbits): Likewise.
485 (gfc_invalid_unsigned_ops): Likewise.
486 * decl.cc (gfc_match_decl_type_spec): Likewise.
487 * dump-parse-tree.cc (show_expr): Likewise.
488 * expr.cc (gfc_get_constant_expr): Likewise.
489 (gfc_copy_expr): Likewise.
490 (gfc_extract_int): Likewise.
491 (numeric_type): Likewise.
492 * gfortran.h (enum arith): Extend with ARITH_UNSIGNED_TRUNCATED
493 and ARITH_UNSIGNED_NEGATIVE.
494 (enum gfc_isym_id): Extend with GFC_ISYM_SU_KIND and GFC_ISYM_UINT.
495 (gfc_check_unsigned_range): New prototype-
496 (gfc_arith_error): Likewise.
497 (gfc_reduce_unsigned): Likewise.
498 (gfc_boz2uint): Likewise.
499 (gfc_invalid_unsigned_ops): Likewise.
500 (gfc_convert_mpz_to_unsigned): Likewise.
501 * gfortran.texi: Add some rudimentary documentation.
502 * intrinsic.cc (gfc_type_letter): Adjust for unsigneds.
503 (add_functions): Add uint and adjust functions to be called.
504 (add_conversions): Add unsigned conversions.
505 (gfc_convert_type_warn): Adjust for unsigned.
506 * intrinsic.h (gfc_check_iu, gfc_check_uint, gfc_check_mod, gfc_simplify_uint,
507 gfc_simplify_selected_unsigned_kind, gfc_resolve_uint): New prototypes.
508 * invoke.texi: Add -funsigned.
509 * iresolve.cc (gfc_resolve_dshift): Handle unsigneds.
510 (gfc_resolve_iand): Handle unsigneds.
511 (gfc_resolve_ibclr): Handle unsigneds.
512 (gfc_resolve_ibits): Handle unsigneds.
513 (gfc_resolve_ibset): Handle unsigneds.
514 (gfc_resolve_ieor): Handle unsigneds.
515 (gfc_resolve_ior): Handle unsigneds.
516 (gfc_resolve_uint): Handle unsigneds.
517 (gfc_resolve_merge_bits): Handle unsigneds.
518 (gfc_resolve_not): Handle unsigneds.
519 * lang.opt: Add -funsigned.
520 * libgfortran.h: Add BT_UNSIGNED.
521 * match.cc (gfc_match_type_spec): Match UNSIGNED.
522 * misc.cc (gfc_basic_typename): Add UNSIGNED.
523 (gfc_typename): Likewise.
524 * primary.cc (convert_unsigned): New function.
525 (match_unsigned_constant): New function.
526 (gfc_match_literal_constant): Handle unsigned.
527 * resolve.cc (resolve_operator): Handle unsigned.
528 (resolve_ordinary_assign): Likewise.
529 * simplify.cc (convert_mpz_to_unsigned): Renamed to...
530 (gfc_convert_mpz_to_unsigned): and adjusted.
531 (gfc_simplify_bit_size): Adjusted for unsigned.
532 (compare_bitwise): Likewise.
533 (gfc_simplify_bge): Likewise.
534 (gfc_simplify_bgt): Likewise.
535 (gfc_simplify_ble): Likewise.
536 (gfc_simplify_blt): Likewise.
537 (simplify_cmplx): Likewise.
538 (gfc_simplify_digits): Likewise.
539 (simplify_dshift): Likewise.
540 (gfc_simplify_huge): Likewise.
541 (gfc_simplify_iand): Likewise.
542 (gfc_simplify_ibclr): Likewise.
543 (gfc_simplify_ibits): Likewise.
544 (gfc_simplify_ibset): Likewise.
545 (gfc_simplify_ieor): Likewise.
546 (gfc_simplify_uint): Likewise.
547 (gfc_simplify_ior): Likewise.
548 (simplify_shift): Likewise.
549 (gfc_simplify_ishftc): Likewise.
550 (gfc_simplify_merge_bits): Likewise.
551 (min_max_choose): Likewise.
552 (gfc_simplify_mod): Likewise.
553 (gfc_simplify_modulo): Likewise.
554 (gfc_simplify_popcnt): Likewise.
555 (gfc_simplify_range): Likewise.
556 (gfc_simplify_selected_unsigned_kind): Likewise.
557 (gfc_convert_constant): Likewise.
558 * target-memory.cc (size_unsigned): New function.
559 (gfc_element_size): Adjust for unsigned.
560 * trans-const.h (gfc_conv_mpz_unsigned_to_tree): Add prototype.
561 * trans-const.cc (gfc_conv_mpz_unsigned_to_tree): Handle unsigneds.
562 (gfc_conv_constant_to_tree): Likewise.
563 * trans-decl.cc (gfc_conv_cfi_to_gfc): Put in "not yet implemented".
564 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Likewise.
565 * trans-stmt.cc (gfc_trans_integer_select): Handle unsigned.
566 (gfc_trans_select): Likewise.
567 * trans-intrinsic.cc (gfc_conv_intrinsic_mod): Handle unsigned.
568 (gfc_conv_intrinsic_shift): Likewise.
569 (gfc_conv_intrinsic_function): Add GFC_ISYM_UINT.
570 * trans-io.cc (enum iocall): Add IOCALL_X_UNSIGNED and IOCALL_X_UNSIGNED_WRITE.
571 (gfc_build_io_library_fndecls): Add transfer_unsigned and transfer_unsigned_write.
572 (transfer_expr): Handle unsigneds.
573 * trans-types.cc (gfc_unsinged_kinds): New array.
574 (gfc_unsigned_types): Likewise.
575 (gfc_init_kinds): Handle them.
576 (validate_unsigned): New function.
577 (gfc_validate_kind): Use it.
578 (gfc_build_unsigned_type): New function.
579 (gfc_init_types): Use it.
580 (gfc_get_unsigned_type): New function.
581 (gfc_typenode_for_spec): Handle unsigned.
582 * trans-types.h (gfc_get_unsigned_type): New prototype.
584 2024-09-06 Tobias Burnus <tburnus@baylibre.com>
586 * dump-parse-tree.cc (show_omp_namelist): Handle OMP_LIST_INIT.
587 (show_omp_clauses): Handle OMP_LIST_{INIT,USE,DESTORY}; move 'nowait'
588 from end-directive to the directive dump.
589 (show_omp_node, show_code_node): Handle EXEC_OMP_INTEROP.
590 * gfortran.h (enum gfc_statement): Add ST_OMP_INTEROP.
591 (OMP_LIST_INIT, OMP_LIST_USE, OMP_LIST_DESTROY): Add.
592 (enum gfc_exec_op): Add EXEC_OMP_INTEROP.
593 (struct gfc_omp_namelist): Add interop items to union.
594 (gfc_free_omp_namelist): Add boolean arg.
595 * match.cc (gfc_free_omp_namelist): Update to free
596 interop union members.
597 * match.h (gfc_match_omp_interop): New.
598 * openmp.cc (gfc_omp_directives): Uncomment 'interop' entry.
599 (gfc_free_omp_clauses, gfc_match_omp_allocate,
600 gfc_match_omp_flush, gfc_match_omp_clause_reduction): Update
602 (enum omp_mask2): Add OMP_CLAUSE_{INIT,USE,DESTROY}.
603 (OMP_INTEROP_CLAUSES): Use it.
604 (gfc_match_omp_clauses): Match those clauses.
605 (gfc_match_omp_prefer_type, gfc_match_omp_init,
606 gfc_match_omp_interop): New.
607 (resolve_omp_clauses): Handle interop clauses.
608 (omp_code_to_statement): Add ST_OMP_INTEROP.
609 (gfc_resolve_omp_directive): Add EXEC_OMP_INTEROP.
610 * parse.cc (decode_omp_directive): Parse 'interop' directive.
611 (next_statement, gfc_ascii_statement): Handle ST_OMP_INTEROP.
612 * st.cc (gfc_free_statement): Likewise
613 * resolve.cc (gfc_resolve_code): Handle EXEC_OMP_INTEROP.
614 * trans.cc (trans_code): Likewise.
615 * trans-openmp.cc (gfc_trans_omp_directive): Print 'sorry'
616 for EXEC_OMP_INTEROP.
618 2024-09-05 Harald Anlauf <anlauf@gmx.de>
621 * trans-decl.cc (gfc_create_module_variable): Handle module
622 variable also when it is needed for the result specification
623 of a contained function.
625 2024-09-03 David Malcolm <dmalcolm@redhat.com>
627 * error.cc (gfc_move_error_buffer_from_to): Prefix all
628 output_buffer fields with "m_".
629 (gfc_diagnostics_init): Likewise.
631 2024-08-31 Harald Anlauf <anlauf@gmx.de>
633 * match.cc (gfc_match_namelist): Downgrade feature from GNU to
636 2024-08-30 Harald Anlauf <anlauf@gmx.de>
639 * resolve.cc (resolve_symbol): Add default-initialization of
640 non-allocatable, non-pointer derived-type function results.
642 2024-08-29 David Malcolm <dmalcolm@redhat.com>
644 * error.cc (gfc_format_decoder): Convert final param from
645 const char **buffer_ptr to pp_token_list &formatted_token_list,
646 and update call to default_tree_printer accordingly.
648 2024-08-29 Harald Anlauf <anlauf@gmx.de>
651 * trans-io.cc (transfer_namelist_element): Prevent NULL pointer
654 2024-08-23 Paul Thomas <pault@gcc.gnu.org>
657 2024-08-06 Paul Thomas <pault@gcc.gnu.org>
660 * trans-array.cc (get_array_ref_dim_for_loop_dim): Use the arg1
661 class container carried in ss->info as the seed for a lhs in
662 class valued transformational intrinsic calls that are not the
663 rhs of an assignment. Otherwise, the lhs variable expression is
664 taken from the loop chain. For this latter case, the _vptr and
666 (gfc_trans_create_temp_array): Use either the lhs expression
667 seeds to build a class variable that will take the returned
668 descriptor as its _data field. In the case that the arg1 expr.
669 is used, a class typespec must be built with the correct rank
670 and the _vptr and _len fields set. The element size is provided
671 for the temporary allocation and to set the descriptor span.
672 (gfc_array_init_size): When an intrinsic type scalar expr3 is
673 used in allocation of a class array, use its element size in
674 the descriptor dtype.
675 * trans-expr.cc (gfc_conv_class_to_class): Class valued
676 transformational intrinsics return the pointer to the array
677 descriptor as the _data field of a class temporary. Extract
678 directly and return the address of the class temporary.
679 (gfc_conv_procedure_call): store the expression for the first
680 argument of a class valued transformational intrinsic function
681 in the ss info class_container field. Later, use its type as
682 the element type in the call to gfc_trans_create_temp_array.
683 (fcncall_realloc_result): Add a dtype argument and use it in
684 the descriptor, when available.
685 (gfc_trans_arrayfunc_assign): For class lhs, build a dtype with
686 the lhs rank and the rhs element size and use it in the call to
687 fcncall_realloc_result.
689 2024-08-23 Gerald Pfeifer <gerald@pfeifer.com>
691 * invoke.texi (Code Gen Options): Add a missing word.
693 2024-08-23 Andre Vehreschild <vehre@gcc.gnu.org>
696 * trans-stmt.cc (trans_associate_var): Remove superfluous
699 2024-08-21 Andre Vehreschild <vehre@gcc.gnu.org>
702 * trans-intrinsic.cc (conv_intrinsic_move_alloc): Correct
704 * trans-types.cc (gfc_sym_type): Pass coarray rank, not false.
705 (gfc_get_derived_type): Only propagate codimension for coarrays
706 and pointers to array components in derived typed coarrays.
708 2024-08-21 Andre Vehreschild <vehre@gcc.gnu.org>
711 * trans-intrinsic.cc (gfc_conv_intrinsic_sizeof): Use
712 class_container of se when set.
714 2024-08-20 Andre Vehreschild <vehre@gcc.gnu.org>
717 * resolve.cc (caf_possible_reallocate): Detect arrays that may
718 be reallocated by caf_send.
719 (resolve_ordinary_assign): More reliably detect assignments
720 where a rewrite to caf_send is needed.
721 * trans-expr.cc (gfc_trans_assignment_1): Remove rewrite to
722 caf_send, because this is done by resolve now.
723 * trans-intrinsic.cc (conv_caf_send): Prevent unneeded temporary
726 2024-08-19 Andre Vehreschild <vehre@gcc.gnu.org>
730 * expr.cc (gfc_is_coindexed): Detect is coindexed also when
731 rewritten to caf_get.
732 * trans-stmt.cc (trans_associate_var): Always accept a
733 descriptor for coarrays.
735 2024-08-19 Andre Vehreschild <vehre@gcc.gnu.org>
738 * trans-types.cc (gfc_get_derived_type): When a caf_sub_token is
739 generated for a component, link it to the component it is
740 generated for (the previous one).
742 2024-08-16 Harald Anlauf <anlauf@gmx.de>
745 * intrinsic.texi: Fix documentation of arguments of RANDOM_INIT,
746 which is conforming to the F2018 standard.
748 2024-08-15 Jakub Jelinek <jakub@redhat.com>
751 * resolve.cc (resolve_operator): Use %L rather than %%L in format
754 2024-08-15 Andre Vehreschild <vehre@gcc.gnu.org>
757 * class.cc (gfc_is_class_scalar_expr): Coarray refs that ref
758 only self, aka this image, are regarded as scalar, too.
759 * resolve.cc (resolve_assoc_var): Ignore this image coarray refs
760 and do not build a new class type.
761 * trans-expr.cc (gfc_get_caf_token_offset): Get the caf token
762 from the descriptor for associated variables.
763 (gfc_conv_variable): Same.
764 (gfc_trans_pointer_assignment): Assign token to temporary
765 associate variable, too.
766 (gfc_trans_scalar_assign): Add flag that assign is for associate
767 and use it to assign the token.
768 (is_assoc_assign): Detect that expressions are for associate
770 (gfc_trans_assignment_1): Treat associate assigns like pointer
771 assignments where possible.
772 * trans-stmt.cc (trans_associate_var): Set same_class only for
774 * trans.h (gfc_trans_scalar_assign): Add flag to
775 trans_scalar_assign for marking associate assignments.
777 2024-08-15 Andre Vehreschild <vehre@gcc.gnu.org>
779 * arith.cc (reduce_unary): Use expr.corank.
780 (reduce_binary_ac): Same.
781 (reduce_binary_ca): Same.
782 (reduce_binary_aa): Same.
783 * array.cc (gfc_match_array_ref): Same.
784 * check.cc (dim_corank_check): Same.
785 (gfc_check_move_alloc): Same.
786 (gfc_check_image_index): Same.
787 * class.cc (gfc_add_class_array_ref): Same.
788 (finalize_component): Same.
789 * data.cc (gfc_assign_data_value): Same.
790 * decl.cc (match_clist_expr): Same.
791 (add_init_expr_to_sym): Same.
792 * expr.cc (simplify_intrinsic_op): Same.
793 (simplify_parameter_variable): Same.
794 (gfc_check_assign_symbol): Same.
795 (gfc_get_variable_expr): Same.
796 (gfc_add_full_array_ref): Same.
797 (gfc_lval_expr_from_sym): Same.
798 (gfc_get_corank): Removed.
799 * frontend-passes.cc (callback_reduction): Use expr.corank.
801 (combine_array_constructor): Same.
802 (optimize_minmaxloc): Same.
803 * gfortran.h (gfc_get_corank): Add corank to gfc_expr.
804 * intrinsic.cc (gfc_get_intrinsic_function_symbol): Use
806 (gfc_convert_type_warn): Same.
807 (gfc_convert_chartype): Same.
808 * iresolve.cc (resolve_bound): Same.
809 (gfc_resolve_cshift): Same.
810 (gfc_resolve_eoshift): Same.
811 (gfc_resolve_logical): Same.
812 (gfc_resolve_matmul): Same.
813 * match.cc (copy_ts_from_selector_to_associate): Same.
814 * matchexp.cc (gfc_get_parentheses): Same.
815 * parse.cc (parse_associate): Same.
816 * primary.cc (gfc_match_rvalue): Same.
817 * resolve.cc (resolve_structure_cons): Same.
818 (resolve_actual_arglist): Same.
819 (resolve_elemental_actual): Same.
820 (resolve_generic_f0): Same.
821 (resolve_unknown_f): Same.
822 (resolve_operator): Same.
823 (gfc_expression_rank): Same and set dimen_type for coarray to
825 (gfc_op_rank_conformable): Use expr.corank.
826 (add_caf_get_intrinsic): Same.
827 (resolve_variable): Same.
828 (gfc_fixup_inferred_type_refs): Same.
829 (check_host_association): Same.
830 (resolve_compcall): Same.
831 (resolve_expr_ppc): Same.
832 (resolve_assoc_var): Same.
833 (fixup_array_ref): Same.
834 (resolve_select_type): Same.
835 (add_comp_ref): Same.
836 (get_temp_from_expr): Same.
837 (resolve_fl_var_and_proc): Same.
838 (resolve_symbol): Same.
839 * symbol.cc (gfc_is_associate_pointer): Same.
840 * trans-array.cc (walk_coarray): Same.
841 (gfc_conv_expr_descriptor): Same.
842 (gfc_walk_array_ref): Same.
843 * trans-array.h (gfc_walk_array_ref): Same.
844 * trans-expr.cc (gfc_get_ultimate_alloc_ptr_comps_caf_token):
846 * trans-intrinsic.cc (trans_this_image): Same.
847 (trans_image_index): Same.
848 (conv_intrinsic_cobound): Same.
849 (gfc_walk_intrinsic_function): Same.
850 (conv_intrinsic_move_alloc): Same.
851 * trans-stmt.cc (gfc_trans_lock_unlock): Same.
852 (trans_associate_var): Same and adapt to slightly different
853 behaviour of expr.corank and gfc_get_corank.
854 (gfc_trans_allocate): Same.
855 * trans.cc (gfc_add_finalizer_call): Same.
857 2024-08-14 Harald Anlauf <anlauf@gmx.de>
859 * simplify.cc (gfc_simplify_sizeof): Clear used gmp variable.
860 * target-memory.cc (gfc_target_expr_size): Likewise.
862 2024-08-14 Andre Vehreschild <vehre@gcc.gnu.org>
865 * match.cc (gfc_match_associate): Reset proc_ptr parsing flag on
868 2024-08-14 Andre Vehreschild <vehre@gcc.gnu.org>
871 * trans-intrinsic.cc (conv_intrinsic_move_alloc): Get the vtab
872 only for derived types and classes and adjust _len for class
875 2024-08-13 Harald Anlauf <anlauf@gmx.de>
876 Steven G. Kargl <kargl@gcc.gnu.org>
879 * array.cc (resolve_array_list): Reject array constructor value if
880 its declared type is abstract (F2018:C7114).
882 2024-08-12 Andre Vehreschild <vehre@gcc.gnu.org>
885 * resolve.cc (resolve_variable): Mark the variable as host
886 associated only, when it is not in an associate block.
887 * trans-decl.cc (generate_coarray_init): Remove incorrect unused
890 2024-08-11 Harald Anlauf <anlauf@gmx.de>
893 * intrinsic.cc (gfc_get_intrinsic_sub_symbol): Initialize variable.
894 * symbol.cc (gfc_get_ha_symbol): Likewise.
896 2024-08-07 Julian Brown <julian@codesourcery.com>
897 Tobias Burnus <tobias@baylibre.com>
899 * gfortran.h (gfc_option_t): Add disable_omp_is_initial_device.
900 * lang.opt (fbuiltin-): Add.
901 * options.cc (gfc_handle_option): Handle
902 -fno-builtin-omp_is_initial_device.
903 * f95-lang.cc (gfc_init_builtin_functions): Handle
904 DEF_GOMP_BUILTIN_COMPILER.
905 * trans-decl.cc (gfc_get_extern_function_decl): Add code to use
906 DEF_GOMP_BUILTIN_COMPILER for 'omp_is_initial_device'.
908 2024-08-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
911 * resolve.cc (CHECK_INTERFACES): New helper macro.
912 (resolve_operator): Replace use of snprintf with
915 2024-08-06 Paul Thomas <pault@gcc.gnu.org>
918 * trans-array.cc (get_array_ref_dim_for_loop_dim): Use the arg1
919 class container carried in ss->info as the seed for a lhs in
920 class valued transformational intrinsic calls that are not the
921 rhs of an assignment. Otherwise, the lhs variable expression is
922 taken from the loop chain. For this latter case, the _vptr and
924 (gfc_trans_create_temp_array): Use either the lhs expression
925 seeds to build a class variable that will take the returned
926 descriptor as its _data field. In the case that the arg1 expr.
927 is used, a class typespec must be built with the correct rank
928 and the _vptr and _len fields set. The element size is provided
929 for the temporary allocation and to set the descriptor span.
930 (gfc_array_init_size): When an intrinsic type scalar expr3 is
931 used in allocation of a class array, use its element size in
932 the descriptor dtype.
933 * trans-expr.cc (gfc_conv_class_to_class): Class valued
934 transformational intrinsics return the pointer to the array
935 descriptor as the _data field of a class temporary. Extract
936 directly and return the address of the class temporary.
937 (gfc_conv_procedure_call): store the expression for the first
938 argument of a class valued transformational intrinsic function
939 in the ss info class_container field. Later, use its type as
940 the element type in the call to gfc_trans_create_temp_array.
941 (fcncall_realloc_result): Add a dtype argument and use it in
942 the descriptor, when available.
943 (gfc_trans_arrayfunc_assign): For class lhs, build a dtype with
944 the lhs rank and the rhs element size and use it in the call to
945 fcncall_realloc_result.
947 2024-08-03 Steve Kargl <kargls@comcast.net>
950 * symbol.cc (gfc_add_save): Add checks for SAVE attribute
951 conflicts and duplicate SAVE attribute.
953 2024-08-02 Mikael Morin <mikael@gcc.gnu.org>
955 * trans-intrinsic.cc (maybe_absent_optional_variable): New function.
956 (gfc_conv_intrinsic_minmaxloc): Remove BACK from scalarization and
957 evaluate it before. Add a check that BACK is not null if the
958 expression is an optional dummy. Save the resulting expression to a
959 variable. Use the variable in the generated inline code.
961 2024-08-01 Jakub Jelinek <jakub@redhat.com>
963 * trans-types.cc (gfc_get_array_descr_info): Don't test if
964 !integer_zerop (dtype_off), use fold_build_pointer_plus
967 2024-07-29 Tobias Burnus <tburnus@baylibre.com>
970 * trans-common.cc (build_common_decl): Add 'omp declare target' and
971 'omp declare target link' variables to offload_vars.
972 * trans-decl.cc (add_attributes_to_decl): Likewise; update args and
973 call decl_attributes.
974 (get_proc_pointer_decl, gfc_get_extern_function_decl,
975 build_function_decl): Update calls.
976 (gfc_get_symbol_decl): Likewise; move after 'DECL_STATIC (t)=1'
977 to avoid errors with symtab_node::get_create.
979 2024-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
982 * trans-expr.cc (gfc_conv_procedure_call): Treat
983 pointers/references (e.g. from parameters) correctly by derefing
986 2024-07-21 Paul Thomas <pault@gcc.gnu.org>
989 * gfortran.h : Add decl_order to gfc_symbol.
990 * symbol.cc : Add static next_decl_order..
991 (gfc_set_sym_referenced): Set symbol decl_order.
992 * trans-decl.cc : Include dependency.h.
993 (decl_order): Replace symbol declared_at.lb->location with
996 2024-07-19 Harald Anlauf <anlauf@gmx.de>
999 * trans-array.cc (gfc_trans_array_constructor_value): If the first
1000 element of an array constructor is deferred-length character and
1001 therefore does not have an element size known at compile time, do
1002 not try to collect subsequent constant elements into a constructor
1005 2024-07-18 Andre Vehreschild <vehre@gcc.gnu.org>
1009 * array.cc (gfc_compare_array_spec): Take cotype into account.
1010 * class.cc (gfc_build_class_symbol): Coarrays are also arrays.
1011 * gfortran.h (IS_CLASS_COARRAY_OR_ARRAY): New macro to detect
1012 regular and coarray class arrays.
1013 * interface.cc (compare_components): Take codimension into
1015 * resolve.cc (resolve_symbol): Improve error message.
1016 * simplify.cc (simplify_bound_dim): Remove duplicate.
1017 * trans-array.cc (gfc_trans_array_cobounds): Coarrays are also
1019 (gfc_trans_array_bounds): Same.
1020 (gfc_trans_dummy_array_bias): Same.
1021 (get_coarray_as): Get the as having a non-zero codim.
1022 (is_explicit_coarray): Detect explicit coarrays.
1023 (gfc_conv_expr_descriptor): Create a new descriptor for explicit
1025 * trans-decl.cc (gfc_build_qualified_array): Coarrays are also
1027 (gfc_build_dummy_array_decl): Same.
1028 (gfc_get_symbol_decl): Same.
1029 (gfc_trans_deferred_vars): Same.
1030 * trans-expr.cc (class_scalar_coarray_to_class): Get the
1031 descriptor from the correct location.
1032 (gfc_conv_variable): Pick up the descriptor when needed.
1033 * trans-types.cc (gfc_is_nodesc_array): Coarrays are also
1035 (gfc_get_nodesc_array_type): Indentation fix only.
1036 (cobounds_match_decl): Match a tree's bounds to the expr's
1037 bounds and return true, when they match.
1038 (gfc_get_derived_type): Create a new type tree/descriptor, when
1039 the cobounds of the existing declaration and expr to not
1040 match. This happends for class arrays in parameter list, when
1041 there are different cobound declarations.
1043 2024-07-18 Paul Thomas <pault@gcc.gnu.org>
1046 * gfortran.h: Add bit field 'allocated_in_scope' to gfc_symbol.
1047 * trans-array.cc (gfc_array_allocate): Set 'allocated_in_scope'
1048 after allocation if not a component reference.
1049 (gfc_alloc_allocatable_for_assignment): If 'allocated_in_scope'
1050 not set, not a component ref and not allocated, set the array
1051 bounds and offset to give zero length in all dimensions. Then
1052 set allocated_in_scope.
1054 2024-07-18 Andre Vehreschild <vehre@gcc.gnu.org>
1057 * trans-types.cc (gfc_sym_type): Use type `char*` for saved
1058 deferred length char arrays.
1059 * trans.cc (get_array_span): Get `.span` also for `char*` typed
1060 arrays, i.e. for those that have INTEGER_TYPE instead of
1063 2024-07-17 Kewen Lin <linkw@linux.ibm.com>
1066 * trans-types.cc (get_real_kind_from_node): Consider the case where
1067 more than one modes have the same precision.
1069 2024-07-16 Paul Thomas <pault@gcc.gnu.org>
1072 * simplify.cc (gfc_simplify_len_trim): If the argument is an
1073 element of a parameter array, simplify all the elements and
1074 build a new parameter array to hold the result, after checking
1075 that it doesn't already exist.
1076 * trans-expr.cc (gfc_get_interface_mapping_array) if a string
1077 length is available, use it for the typespec.
1078 (gfc_add_interface_mapping): Supply the se string length.
1080 2024-07-16 Prathamesh Kulkarni <prathameshk@nvidia.com>
1082 * trans-expr.cc (gfc_trans_zero_assign): Handle allocatable arrays.
1084 2024-07-13 Mikael Morin <mikael@gcc.gnu.org>
1086 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Add the
1087 preliminary code generated for MASK to the preliminary code of
1090 2024-07-12 Mikael Morin <morin-mikael@orange.fr>
1092 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Create a new
1093 scalar scalarization chain element if BACK is present. Add it to
1094 the loop. Set the scalarization chain before evaluating the
1097 2024-07-11 Andre Vehreschild <vehre@gcc.gnu.org>
1099 * trans-array.cc (gfc_conv_array_parameter): Init variable to
1100 NULL_TREE to fix bootstrap.
1102 2024-07-11 Andre Vehreschild <vehre@gcc.gnu.org>
1105 * trans-array.cc (gfc_trans_array_bounds): Set a starting
1106 stride, when descriptor expects a variable for the stride.
1107 (gfc_trans_dummy_array_bias): Allow storage association for
1108 dummy class arrays, when they are not elemental.
1109 (gfc_conv_array_parameter): Add more general class support
1110 and packing for classes, too.
1111 * trans-array.h (gfc_conv_array_parameter): Add lbound shift
1113 * trans-decl.cc (gfc_build_builtin_function_decls): Add decls
1114 for internal_un-/pack_class.
1115 * trans-expr.cc (gfc_reset_vptr): Allow supplying a type-tree
1116 to generate the vtab from.
1117 (gfc_class_set_vptr): Allow supplying a class-tree to take the
1119 (class_array_data_assign): Rename to gfc_class_array_data_assign
1120 and make usable from other compile units.
1121 (gfc_class_array_data_assign): Renamed from class_array_data_
1123 (gfc_conv_derived_to_class): Remove assert to
1124 allow converting derived to class type arrays with assumed
1125 rank. Reduce code base and use gfc_conv_array_parameter also
1127 (gfc_conv_class_to_class): Use gfc_class_data_assign.
1128 (gfc_conv_procedure_call): Adapt to new signature of
1129 gfc_conv_derived_to_class.
1130 * trans-io.cc (transfer_expr): Same.
1131 * trans-stmt.cc (trans_associate_var): Same.
1132 * trans.h (gfc_conv_derived_to_class): Signature changed.
1133 (gfc_class_array_data_assign): Made public.
1134 (gfor_fndecl_in_pack_class): Added declaration.
1135 (gfor_fndecl_in_unpack_class): Same.
1137 2024-07-08 Mikael Morin <mikael@gcc.gnu.org>
1139 * trans-array.cc (gfc_trans_preloop_setup): Use a separate variable
1140 for iteration. Use directly the value of variable I if it is known.
1141 Move the definition of the variable to the branch where the
1144 2024-07-03 Harald Anlauf <anlauf@gmx.de>
1147 * trans-stmt.cc (trans_associate_var): When the associate target
1148 is an array-valued character variable, the length is known at entry
1149 of the associate block. Move setting of string length of the
1150 selector to the initialization part of the block.
1152 2024-07-01 Andrew Stubbs <ams@baylibre.com>
1153 Thomas Schwinge <thomas@codesourcery.com>
1155 * openmp.cc (is_predefined_allocator): Update valid ranges to
1156 incorporate ompx_gnu_pinned_mem_alloc.
1158 2024-06-29 Harald Anlauf <anlauf@gmx.de>
1161 * trans-stmt.cc (gfc_trans_allocate): Fix handling of case of
1162 scalar character expression being used for SOURCE.
1164 2024-06-28 Andre Vehreschild <vehre@gcc.gnu.org>
1166 * trans-expr.cc (gfc_class_set_vptr): Add setting of _vptr
1168 * trans-intrinsic.cc (conv_intrinsic_move_alloc): First use
1169 of gfc_class_set_vptr and refactor very similar code.
1170 * trans.h (gfc_class_set_vptr): Declare the new function.
1172 2024-06-28 Andre Vehreschild <vehre@gcc.gnu.org>
1174 * trans-array.cc (structure_alloc_comps): Use reset_vptr.
1175 * trans-decl.cc (gfc_trans_deferred_vars): Same.
1176 (gfc_generate_function_code): Same.
1177 * trans-expr.cc (gfc_reset_vptr): Allow supplying the class
1179 (gfc_conv_procedure_call): Use reset_vptr.
1180 * trans-intrinsic.cc (gfc_conv_intrinsic_transfer): Same.
1182 2024-06-24 Harald Anlauf <anlauf@gmx.de>
1185 * trans-array.cc (gfc_conv_array_parameter): Do not dereference
1186 data component of a missing allocatable dummy array argument for
1187 passing as actual to optional dummy. Harden logic of presence
1188 check for optional pointer dummy by using TRUTH_ANDIF_EXPR instead
1191 2024-06-20 Paul Thomas <pault@gcc.gnu.org>
1194 * dependency.cc (dependency_fcn, gfc_function_dependency): New
1195 functions to detect dependency in array bounds and character
1196 lengths on old style function results.
1197 * dependency.h : Add prototype for gfc_function_dependency.
1198 * error.cc (error_print): Remove trailing space.
1199 * gfortran.h : Remove dummy_order and add fn_result_spec.
1200 * symbol.cc : Remove declaration of next_dummy_order..
1201 (gfc_set_sym_referenced): remove setting of symbol dummy order.
1202 * trans-array.cc (gfc_trans_auto_array_allocation): Detect
1203 non-dummy symbols with function dependencies and put the
1204 allocation at the end of the initialization code.
1205 * trans-decl.cc : Include dependency.h.
1206 (decl_order): New function that determines uses the location
1207 field of the symbol 'declared_at' to determine the order of two
1209 (gfc_defer_symbol_init): Call gfc_function_dependency to put
1210 dependent symbols in the right part of the tlink chain. Use
1211 the location field of the symbol declared_at to determine the
1212 order of declarations.
1213 (gfc_trans_auto_character_variable): Put character length
1214 initialization of dependent symbols at the end of the chain.
1215 * trans.cc (gfc_add_init_cleanup): Add boolean argument with
1216 default false that determines whther an expression is placed at
1217 the back or the front of the initialization chain.
1218 * trans.h : Update the prototype for gfc_add_init_cleanup.
1220 2024-06-19 Harald Anlauf <anlauf@gmx.de>
1223 * trans-decl.cc (gfc_conv_cfi_to_gfc): Move derivation of type sizes
1224 for character via gfc_trans_vla_type_sizes to after character length
1227 2024-06-19 Andre Vehreschild <vehre@gcc.gnu.org>
1230 * trans-decl.cc (gfc_generate_function_code): Set vptr for
1231 results to declared class type.
1232 * trans-expr.cc (gfc_reset_vptr): Allow to provide the typespec
1233 instead of the expression.
1234 * trans.h (gfc_reset_vptr): Same.
1236 2024-06-17 Andre Vehreschild <vehre@gcc.gnu.org>
1238 * trans.cc (gfc_deallocate_with_status): Check that object to deref
1239 is an array, before applying array deref.
1241 2024-06-12 David Malcolm <dmalcolm@redhat.com>
1243 * error.cc (gfc_clear_pp_buffer): Likewise.
1244 (gfc_warning): Likewise.
1245 (gfc_warning_check): Likewise.
1246 (gfc_error_opt): Likewise.
1247 (gfc_error_check): Likewise.
1249 2024-06-07 Andre Vehreschild <vehre@gcc.gnu.org>
1252 * trans-array.cc (gfc_trans_array_ctor_element): Eval non-
1253 variable expressions once only.
1254 (gfc_trans_array_constructor_value): Add statements of
1256 (trans_array_constructor): Detect when final block is required.
1258 2024-06-07 Andre Vehreschild <vehre@gcc.gnu.org>
1261 * expr.cc (gfc_is_alloc_class_scalar_function): Detect
1262 allocatable class return types also for user-defined
1264 * trans-expr.cc (gfc_conv_procedure_call): Same.
1265 (trans_class_vptr_len_assignment): Compute vptr len
1266 assignment correctly for user-defined functions.
1268 2024-06-05 Jakub Jelinek <jakub@redhat.com>
1269 Frederik Harwath <frederik@codesourcery.com>
1270 Sandra Loosemore <sandra@codesourcery.com>
1272 * gfortran.h (enum gfc_statement): Add ST_OMP_UNROLL,
1273 ST_OMP_END_UNROLL, ST_OMP_TILE and ST_OMP_END_TILE.
1274 (struct gfc_omp_clauses): Add sizes_list, partial, full and erroneous
1276 (enum gfc_exec_op): Add EXEC_OMP_UNROLL and EXEC_OMP_TILE.
1277 (gfc_expr_list_len): Declare.
1278 * match.h (gfc_match_omp_tile, gfc_match_omp_unroll): Declare.
1279 * openmp.cc (gfc_get_location): Declare.
1280 (gfc_free_omp_clauses): Free sizes_list.
1281 (match_oacc_expr_list): Rename to ...
1282 (match_omp_oacc_expr_list): ... this. Add is_omp argument and
1283 change diagnostic wording if it is true.
1284 (enum omp_mask2): Add OMP_CLAUSE_{FULL,PARTIAL,SIZES}.
1285 (gfc_match_omp_clauses): Parse full, partial and sizes clauses.
1286 (gfc_match_oacc_wait): Use match_omp_oacc_expr_list instead of
1287 match_oacc_expr_list.
1288 (OMP_UNROLL_CLAUSES, OMP_TILE_CLAUSES): Define.
1289 (gfc_match_omp_tile, gfc_match_omp_unroll): New functions.
1290 (resolve_omp_clauses): Diagnose full vs. partial clause conflict.
1291 Resolve sizes clause arguments.
1292 (find_nested_loop_in_chain): Use switch instead of series of ifs.
1293 Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1294 (gfc_resolve_omp_do_blocks): Set omp_current_do_collapse to
1295 list length of sizes_list if present.
1296 (gfc_resolve_do_iterator): Return for EXEC_OMP_TILE or
1298 (restructure_intervening_code): Remove spurious ()s around & operands.
1299 (is_outer_iteration_variable): Handle EXEC_OMP_TILE and
1301 (check_nested_loop_in_chain): Likewise.
1302 (expr_is_invariant): Likewise.
1303 (resolve_omp_do): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL. Diagnose
1304 tile without sizes clause. Use sizes_list length for count if
1305 non-NULL. Set code->ext.omp_clauses->erroneous on loops where we've
1306 reported diagnostics. Sorry for mixing non-rectangular loops with
1308 (omp_code_to_statement): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1309 (gfc_resolve_omp_directive): Likewise.
1310 * parse.cc (decode_omp_directive): Parse end tile, end unroll, tile
1311 and unroll. Move nothing entry alphabetically.
1312 (case_exec_markers): Add ST_OMP_TILE and ST_OMP_UNROLL.
1313 (gfc_ascii_statement): Handle ST_OMP_END_TILE, ST_OMP_END_UNROLL,
1314 ST_OMP_TILE and ST_OMP_UNROLL.
1315 (parse_omp_do): Add nested argument. Handle ST_OMP_TILE and
1317 (parse_omp_structured_block): Adjust parse_omp_do caller.
1318 (parse_executable): Likewise. Handle ST_OMP_TILE and ST_OMP_UNROLL.
1319 * resolve.cc (gfc_resolve_blocks): Handle EXEC_OMP_TILE and
1321 (gfc_resolve_code): Likewise.
1322 * st.cc (gfc_free_statement): Likewise.
1323 * trans.cc (trans_code): Likewise.
1324 * trans-openmp.cc (gfc_trans_omp_clauses): Handle full, partial and
1325 sizes clauses. Use tree_cons + nreverse instead of
1326 temporary vector and build_tree_list_vec for tile_list handling.
1327 (gfc_expr_list_len): New function.
1328 (gfc_trans_omp_do): Rename tile to oacc_tile. Handle sizes clause.
1329 Don't assert code->op is EXEC_DO. Handle EXEC_OMP_TILE and
1331 (gfc_trans_omp_directive): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1332 * dump-parse-tree.cc (show_omp_clauses): Dump full, partial and
1334 (show_omp_node): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1335 (show_code_node): Likewise.
1337 2024-06-05 Kewen Lin <linkw@linux.ibm.com>
1339 * trans-intrinsic.cc (build_round_expr): Use TYPE_PRECISION of
1340 long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE.
1341 * trans-types.cc (gfc_build_real_type): Use TYPE_PRECISION of
1342 {float,double,long_double}_type_node to replace
1343 {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE.
1345 2024-06-04 Harald Anlauf <anlauf@gmx.de>
1348 * trans-stmt.cc (gfc_trans_allocate): Restrict special case for
1349 source-expression with zero-length character to rank 0, so that
1350 the array shape is not discarded.
1352 2024-05-29 Andre Vehreschild <vehre@gcc.gnu.org>
1355 * trans-expr.cc (gfc_conv_procedure_call): Evaluate
1356 expressions with side-effects only ones and ensure
1359 2024-05-24 Harald Anlauf <anlauf@gmx.de>
1360 Steven G. Kargl <kargl@gcc.gnu.org>
1363 * symbol.cc (conflict_std): Helper function for reporting attribute
1364 conflicts depending on the Fortran standard version.
1365 (conf_std): Helper macro for checking standard-dependent conflicts.
1366 (gfc_check_conflict): Use it.
1368 2024-05-24 Harald Anlauf <anlauf@gmx.de>
1371 * trans-array.cc (gfc_conv_ss_startstride): Use abridged_ref_name
1372 to generate a more user-friendly name for bounds-check messages.
1373 * trans-expr.cc (gfc_copy_class_to_class): Fix bounds check for
1374 rank>1 by looping over the dimensions.
1376 2024-05-23 Paul Thomas <pault@gcc.gnu.org>
1379 * dependency.cc (gfc_dep_compare_expr): Handle component call
1380 expressions. Return -2 as default and return 0 if compared with
1381 a function expression that is from an interface body and has
1383 * expr.cc (gfc_reduce_init_expr): If the expression is a comp
1384 call do not attempt to reduce, defer to resolution and return
1386 * trans-types.cc (gfc_get_dtype_rank_type,
1387 gfc_get_nodesc_array_type): Fix whitespace.
1389 2024-05-20 Mikael Morin <mikael@gcc.gnu.org>
1392 * symbol.cc (gfc_release_symbol): Move the condition guarding
1393 the handling cyclic references...
1394 (cyclic_reference_break_needed): ... here as a new predicate.
1395 Remove superfluous parts. Add a condition preventing any premature
1396 release with submodule symbols.
1398 2024-05-20 Tobias Burnus <tburnus@baylibre.com>
1401 * trans-intrinsic.cc (gfc_conv_intrinsic_bound): Fix SHAPE
1402 for zero-size arrays
1404 2024-05-20 Tobias Burnus <tburnus@baylibre.com>
1406 * invoke.texi (fcoarray): Link to OpenCoarrays.org;
1407 mention libcaf_single.
1409 2024-05-17 Paul Thomas <pault@gcc.gnu.org>
1412 * gfortran.h: Add 'assoc_name_inferred' to gfc_namespace.
1413 * match.cc (gfc_match_select_type): Set 'assoc_name_inferred'
1414 in select type namespace if the selector has inferred type.
1415 * primary.cc (gfc_match_varspec): If a select type temporary
1416 is apparently scalar and a left parenthesis has been detected,
1417 check the current namespace has 'assoc_name_inferred' set. If
1418 so, set inferred_type.
1419 * resolve.cc (resolve_variable): If the namespace of a select
1420 type temporary is marked with 'assoc_name_inferred' call
1421 gfc_fixup_inferred_type_refs to ensure references are OK.
1422 (gfc_fixup_inferred_type_refs): Catch invalid array refs..
1424 2024-05-15 Jakub Jelinek <jakub@redhat.com>
1427 * openmp.cc (resolve_omp_clauses): Diagnose grainsize
1428 used together with num_tasks or nogroup used together with
1431 2024-05-13 Paul Thomas <pault@gcc.gnu.org>
1434 * trans-array.cc (gfc_array_init_size): Use the expr3 dtype so
1435 that the correct element size is used.
1436 * trans-expr.cc (gfc_conv_procedure_call): Remove restriction
1437 that ss and ss->loop be present for the finalization of class
1438 array function results.
1439 (trans_class_assignment): Use free and malloc, rather than
1440 realloc, for character expressions assigned to unlimited poly
1442 * trans-stmt.cc (gfc_trans_allocate): Build a correct rhs for
1443 the assignment of an unlimited polymorphic 'source'.
1445 2024-05-12 Harald Anlauf <anlauf@gmx.de>
1447 * primary.cc (gfc_match_varspec): Replace 'ref' argument to
1448 is_inquiry_ref() by NULL when the result is not needed to avoid
1451 2024-05-12 Paul Thomas <pault@gcc.gnu.org>
1456 * iresolve.cc (gfc_resolve_transfer): Emit a TODO error for
1457 unlimited polymorphic mold.
1458 * trans-expr.cc (gfc_resize_class_size_with_len): Use the fold
1459 even if a block is not available in which to fix the result.
1460 (trans_class_assignment): Enable correct assignment of
1461 character expressions to unlimited polymorphic variables using
1462 lhs _len field and rse string_length.
1463 * trans-intrinsic.cc (gfc_conv_intrinsic_storage_size): Extract
1464 the class expression so that the unlimited polymorphic class
1465 expression can be used in gfc_resize_class_size_with_len to
1466 obtain the storage size for character payloads. Guard the use
1467 of GFC_DECL_SAVED_DESCRIPTOR by testing for DECL_LANG_SPECIFIC
1468 to prevent the ICE. Also, invert the order to use the class
1469 expression extracted from the argument.
1470 (gfc_conv_intrinsic_transfer): In same way as 'storage_size',
1471 use the _len field to obtaining the correct length for arg 1.
1472 Add a branch for the element size in bytes of class expressions
1473 with provision to make use of the unlimited polymorphic _len
1474 field. Again, the class references are explicitly identified.
1475 'mold_expr' was already declared. Use it instead of 'arg'. Do
1476 not fix 'dest_word_len' for deferred character sources because
1477 reallocation on assign makes use of it before it is assigned.
1479 2024-05-11 Harald Anlauf <anlauf@gmx.de>
1482 * expr.cc (gfc_traverse_expr): An inquiry ref does not constitute
1483 a dependency and cannot collide with a symbol.
1485 2024-05-05 Harald Anlauf <anlauf@gmx.de>
1488 * trans-array.cc (gfc_alloc_allocatable_for_assignment): Take into
1489 account _len of unlimited polymorphic entities when calculating
1490 the effective element size for allocation size and array span.
1491 Set _len of lhs to _len of rhs.
1492 * trans-expr.cc (trans_class_assignment): Take into account _len
1493 of unlimited polymorphic entities for allocation size.
1495 2024-04-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1497 * expr.cc (check_transformational): Add SELECTED_LOGICAL_KIND
1498 to allowed functions for Fortran 2023.
1499 * gfortran.h (GFC_ISYM_SL_KIND): New.
1500 * gfortran.texi: Mention SELECTED_LOGICAL_KIND.
1501 * intrinsic.cc (add_functions): Add SELECTED_LOGICAL_KIND.
1502 (gfc_intrinsic_func_interface): Allow it in initialization
1504 * intrinsic.h (gfc_simplify_selected_logical_kind): New proto.
1505 * intrinsic.texi: Add SELECTED_LOGICAL_KIND.
1506 * simplify.cc (gfc_simplify_selected_logical_kind): New
1508 * trans-decl.cc (gfc_build_intrinsic_function_decls): Initialize
1509 gfor_fndecl_sl_kind.
1510 * trans-intrinsic.cc (gfc_conv_intrinsic_sl_kind): New function.
1511 (gfc_conv_intrinsic_function): Call it for GFC_ISYM_SL_KIND.
1512 * trans.h (gfor_fndecl_sl_kind): New symbol.
1514 2024-04-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1516 * iso-fortran-env.def: Add logical{8,16,32,64} and
1517 real16 named constants.
1519 2024-04-29 Paul Thomas <pault@gcc.gnu.org>
1522 * trans-expr.cc (gfc_trans_class_init_assign): Return NULL_TREE
1523 if the default initializer has all NULL fields. Guard this
1524 by a requirement that the code not be EXEC_INIT_ASSIGN and that
1525 the object be an INTENT_OUT dummy.
1526 * trans-stmt.cc (gfc_trans_allocate): Change the initializer
1527 code for allocate with mold to EXEC_ALLOCATE to allow an
1528 initializer with all NULL fields.
1530 2024-04-25 Paul Thomas <pault@gcc.gnu.org>
1533 * trans-expr.cc (gfc_conv_procedure_call): Use the interface,
1534 where possible, to obtain the type of character procedure
1535 pointers of class entities.
1537 2024-04-25 Paul Thomas <pault@gcc.gnu.org>
1538 Jakub Jelinek <jakub@gcc.gnu.org>
1541 * decl.cc (build_sym): Add an extra argument 'elem'. If 'elem'
1542 is greater than 1, gfc_new_charlen is called to generate a new
1543 charlen, registered in the symbol namespace.
1544 (variable_decl, enumerator_decl): Set the new argument in the
1547 2024-04-21 Paul Thomas <pault@gcc.gnu.org>
1550 * resolve.cc (resolve_actual_arglist): Catch variables silently
1551 set as untyped, resetting the flag so that gfc_resolve_expr can
1552 generate the no implicit type error.
1553 (gfc_resolve_index_1): Block index expressions of unknown type
1554 from being converted to default integer, avoiding the fatal
1555 error in trans-decl.cc.
1556 * symbol.cc (gfc_set_default_type): Remove '(symbol)' from the
1557 'no IMPLICIT type' error message.
1558 * trans-decl.cc (gfc_get_symbol_decl): Change fatal error locus
1559 to that of the symbol declaration.
1560 (gfc_trans_deferred_vars): Remove two trailing tabs.
1562 2024-04-18 Paul Thomas <pault@gcc.gnu.org>
1565 * primary.cc (gfc_match_varspec): Check for default type before
1566 checking for derived types with the right component name.
1568 2024-04-16 Harald Anlauf <anlauf@gmx.de>
1571 * resolve.cc (resolve_allocate_expr): Reject ALLOCATE with SOURCE=
1572 or MOLD= specifier for unequal length.
1573 * trans-stmt.cc (gfc_trans_allocate): If an allocatable character
1574 variable has fixed length, use it and do not use the source length.
1575 With bounds-checking enabled, add a runtime check for same length.
1577 2024-04-10 Harald Anlauf <anlauf@gmx.de>
1580 * check.cc (is_c_interoperable): Fix checks for C_SIZEOF.
1581 (gfc_check_c_f_pointer): Reject function returning a pointer as FPTR,
1582 and improve an error message.
1584 2024-04-09 Paul Thomas <pault@gcc.gnu.org>
1587 * resolve.cc (resolve_symbol): Remove last chunk that checked
1588 for finalization of unreferenced symbols.
1590 2024-04-09 Paul Thomas <pault@gcc.gnu.org>
1593 * trans-expr.cc (gfc_trans_pointer_assignment): Remove assert
1594 causing the ICE since it was unnecesary.
1596 2024-04-02 Paul Thomas <pault@gcc.gnu.org>
1599 * interface.cc (gfc_compare_interfaces): Add error for a
1600 subroutine proc pointer passed to a variable formal.
1601 (compare_parameter): If a procedure pointer is being passed to
1602 a non-procedure formal arg, and there is an an interface, use
1603 gfc_compare_interfaces to check and provide a more useful error
1606 2024-04-02 Paul Thomas <pault@gcc.gnu.org>
1609 * resolve.cc (resolve_procedure_expression): Change the test for
1610 for recursion in the case of hidden procedures from modules.
1611 (resolve_typebound_static): Add warning for possible recursive
1612 calls to typebound procedures.
1613 * trans-expr.cc (gfc_trans_class_init_assign): Do not apply
1614 default initializer to class dummy where component initializers
1617 2024-03-29 Harald Anlauf <anlauf@gmx.de>
1620 * trans-expr.cc (gfc_conv_structure): Check for NULL pointer.
1622 2024-03-29 Paul Thomas <pault@gcc.gnu.org>
1627 * trans-expr.cc (gfc_trans_assignment_1): Place finalization
1628 block before rhs post block for elemental rhs.
1629 * trans.cc (gfc_finalize_tree_expr): Check directly if a type
1630 has no components, rather than the zero components attribute.
1631 Treat elemental zero component expressions in the same way as
1634 2024-03-28 Harald Anlauf <anlauf@gmx.de>
1637 * primary.cc (gfc_variable_attr): Catch variables used in structure
1638 constructors within DATA statements that are still tagged with a
1639 temporary type BT_PROCEDURE from match_actual_arg and which have the
1640 target attribute, and fix their typespec.
1642 2024-03-28 Mikael Morin <mikael@gcc.gnu.org>
1643 Harald Anlauf <anlauf@gmx.de>
1647 * expr.cc (check_restricted): In submodules, allow variables host-
1648 associated from the parent module.
1650 2024-03-22 Harald Anlauf <anlauf@gmx.de>
1653 * interface.cc (gfc_compare_actual_formal): Skip size check for
1654 NULL() actual without MOLD argument.
1656 2024-03-22 Mikael Morin <mikael@gcc.gnu.org>
1659 * gfortran.h (gfc_save_module_list, gfc_restore_old_module_list):
1661 * module.cc (old_module_list_tail): New global variable.
1662 (gfc_save_module_list, gfc_restore_old_module_list): New functions.
1663 (gfc_use_modules): Set module_list and old_module_list_tail.
1664 * parse.cc (next_statement): Save module_list before doing any work.
1665 (reject_statement): Restore module_list to its saved value.
1667 2024-03-22 Mikael Morin <mikael@gcc.gnu.org>
1670 * symbol.cc (gfc_get_procedure_ns, gfc_get_spec_ns): New functions.
1671 * gfortran.h (gfc_get_procedure_ns, gfc_get_spec ns): Declare them.
1672 (gfc_is_formal_arg): Remove.
1673 * expr.cc (check_restricted): Remove special case allowing local
1674 variable in dummy argument bound expressions. Use gfc_get_spec_ns
1675 to get the right namespace.
1676 * resolve.cc (gfc_is_formal_arg, formal_arg_flag): Remove.
1677 (gfc_resolve_formal_arglist): Set gfc_current_ns. Quit loop and
1678 restore gfc_current_ns instead of early returning.
1679 (resolve_symbol): Factor common array spec resolution code to...
1680 (resolve_symbol_array_spec): ... this new function. Additionnally
1681 set and restore gfc_current_ns.
1683 2024-03-21 Harald Anlauf <anlauf@gmx.de>
1686 * trans-array.cc (abridged_ref_name): New helper function.
1687 (trans_array_bound_check): Use it.
1688 (array_bound_check_elemental): Likewise.
1689 (gfc_conv_array_ref): Likewise.
1691 2024-03-20 Jakub Jelinek <jakub@redhat.com>
1693 * trans-array.cc (structure_alloc_comps): Use integer_zero_node
1694 instead of build_zero_cst (integer_type_node) or
1695 build_int_cst (integer_type_node, 0) and integer_one_node instead of
1696 build_int_cst (integer_type_node, 1).
1697 * trans-expr.cc (conv_scalar_char_value): Likewise.
1698 * trans-stmt.cc (gfc_trans_form_team, gfc_trans_change_team,
1699 gfc_trans_sync_team, gfc_trans_sync): Likewise.
1700 * trans-decl.cc (create_main_function): Likewise.
1701 * trans-intrinsic.cc (trans_this_image, conv_intrinsic_move_alloc):
1703 * trans.cc (gfc_allocate_using_caf_lib, gfc_deallocate_with_status):
1706 2024-03-18 Harald Anlauf <anlauf@gmx.de>
1709 * frontend-passes.cc (check_externals_expr): Prevent invalid read
1710 in case of mismatch of external subroutine with function.
1712 2024-03-17 Harald Anlauf <anlauf@gmx.de>
1715 * trans-array.cc (gfc_get_dataptr_offset): Check for optional
1716 arguments being present before dereferencing data pointer.
1718 2024-03-15 Paul Thomas <pault@gcc.gnu.org>
1725 * class.cc (gfc_change_class): New function needed for
1726 associate names, when rank changes or a derived type is
1727 produced by resolution
1728 * dump-parse-tree.cc (show_code_node): Make output for SELECT
1729 TYPE more comprehensible.
1730 * expr.cc (find_inquiry_ref): Do not simplify expressions of
1732 * gfortran.h : Add 'gfc_association_list' to structure
1733 'gfc_association_list'. Add prototypes for
1734 'gfc_find_derived_types', 'gfc_fixup_inferred_type_refs' and
1735 'gfc_change_class'. Add macro IS_INFERRED_TYPE.
1736 * match.cc (copy_ts_from_selector_to_associate): Add bolean arg
1737 'select_type' with default false. If this is a select type name
1738 and the selector is a inferred type, build the class type and
1739 apply it to the associate name.
1740 (build_associate_name): Pass true to 'select_type' in call to
1742 * parse.cc (parse_associate): If the selector is inferred type
1743 the associate name is too. Make sure that function selector
1744 class and rank, if known, are passed to the associate name. If
1745 a function result exists, pass its typespec to the associate
1747 * primary.cc (resolvable_fcns): New function to check that all
1748 the function references are resolvable.
1749 (gfc_match_varspec): If a scalar derived type select type
1750 temporary has an array reference, match the array reference,
1751 treating this in the same way as an equivalence member. Do not
1752 set 'inquiry' if applied to an unknown type the inquiry name
1753 is ambiguous with the component of an accessible derived type.
1754 Check that resolution of the target expression is OK by testing
1755 if the symbol is declared or is an operator expression, then
1756 using 'resolvable_fcns' recursively. If all is well, resolve
1757 the expression. If this is an inferred type with a component
1758 reference, call 'gfc_find_derived_types' to find a suitable
1759 derived type. If there is an inquiry ref and the symbol either
1760 is of unknown type or is inferred to be a derived type, set the
1761 primary and symbol TKR appropriately.
1762 * resolve.cc (resolve_variable): Call new function below.
1763 (gfc_fixup_inferred_type_refs): New function to ensure that the
1764 expression references for a inferred type are consistent with
1765 the now fixed up selector.
1766 (resolve_assoc_var): Ensure that derived type or class function
1767 selectors transmit the correct arrayspec to the associate name.
1768 (resolve_select_type): If the selector is an associate name of
1769 inferred type and has no component references, the associate
1770 name should have its typespec. Simplify the conversion of a
1771 class array to class scalar by calling 'gfc_change_class'.
1772 Make sure that a class, inferred type selector with an array
1773 ref transfers the typespec from the symbol to the expression.
1774 * symbol.cc (gfc_set_default_type): If an associate name with
1775 unknown type has a selector expression, try resolving the expr.
1776 (find_derived_types, gfc_find_derived_types): New functions
1777 that search for a derived type with a given name.
1778 * trans-expr.cc (gfc_conv_variable): Some inferred type exprs
1779 escape resolution so call 'gfc_fixup_inferred_type_refs'.
1780 * trans-stmt.cc (trans_associate_var): Tidy up expression for
1781 'class_target'. Finalize and free class function results.
1782 Correctly handle selectors that are class functions and class
1783 array references, passed as derived types.
1785 2024-03-14 Thomas Schwinge <thomas@codesourcery.com>
1787 * dump-parse-tree.cc (show_omp_clauses): Handle 'self_expr'.
1788 * openmp.cc (gfc_free_omp_clauses): Likewise.
1789 * trans-openmp.cc (gfc_split_omp_clauses): Don't handle 'self_expr'.
1791 2024-03-14 Chung-Lin Tang <cltang@baylibre.com>
1793 * dump-parse-tree.cc (show_omp_namelist): Print "readonly," for
1794 OMP_LIST_MAP and OMP_LIST_CACHE if n->u.map.readonly is set.
1795 Adjust 'n->u.map_op' to 'n->u.map.op'.
1796 * gfortran.h (typedef struct gfc_omp_namelist): Adjust map_op as
1797 'ENUM_BITFIELD (gfc_omp_map_op) op:8', add 'bool readonly' field,
1798 change to named struct field 'map'.
1799 * openmp.cc (gfc_match_omp_map_clause): Adjust 'n->u.map_op' to
1801 (gfc_match_omp_clause_reduction): Likewise.
1802 (gfc_match_omp_clauses): Add readonly modifier parsing for OpenACC
1803 copyin clause, set 'n->u.map.op' and 'n->u.map.readonly' for parsed
1804 clause. Adjust 'n->u.map_op' to 'n->u.map.op'.
1805 (gfc_match_oacc_declare): Adjust 'n->u.map_op' to 'n->u.map.op'.
1806 (gfc_match_oacc_cache): Add readonly modifier parsing for OpenACC
1808 (resolve_omp_clauses): Adjust 'n->u.map_op' to 'n->u.map.op'.
1809 * trans-decl.cc (add_clause): Adjust 'n->u.map_op' to 'n->u.map.op'.
1810 (finish_oacc_declare): Likewise.
1811 * trans-openmp.cc (gfc_trans_omp_clauses): Set OMP_CLAUSE_MAP_READONLY,
1812 OMP_CLAUSE__CACHE__READONLY to 1 when readonly is set. Adjust
1813 'n->u.map_op' to 'n->u.map.op'.
1814 (gfc_add_clause_implicitly): Adjust 'n->u.map_op' to 'n->u.map.op'.
1816 2024-03-13 Harald Anlauf <anlauf@gmx.de>
1819 * expr.cc (gfc_is_simply_contiguous): Adjust logic so that CLASS
1820 symbols are also handled.
1822 2024-03-13 Tobias Burnus <tburnus@baylibre.com>
1825 * trans-openmp.cc (gfc_omp_predetermined_mapping): Map dummy
1826 procedures as firstprivate.
1828 2024-03-12 Harald Anlauf <anlauf@gmx.de>
1831 * array.cc (gfc_array_dimen_size): When walking the ref chain of an
1832 array and the ultimate component is a procedure pointer, do not try
1833 to figure out its dimension even if it is a array-valued function.
1835 2024-03-06 Harald Anlauf <anlauf@gmx.de>
1839 * arith.cc (is_hard_arith_error): New helper function to determine
1840 whether an arithmetic error is "hard" or not.
1841 (check_result): Use it.
1842 (gfc_arith_divide): Set "Division by zero" only for regular
1843 numerators of real and complex divisions.
1844 (reduce_unary): Use is_hard_arith_error to determine whether a hard
1845 or (recoverable) soft error was encountered. Terminate immediately
1846 on hard error, otherwise remember code of first soft error.
1847 (reduce_binary_ac): Likewise.
1848 (reduce_binary_ca): Likewise.
1849 (reduce_binary_aa): Likewise.
1851 2024-03-01 Harald Anlauf <anlauf@gmx.de>
1854 * check.cc (gfc_check_null): Handle nested NULL()s.
1855 (is_c_interoperable): Check for MOLD argument of NULL() as part of
1856 the interoperability check.
1857 * interface.cc (gfc_compare_actual_formal): Extend checks for NULL()
1858 actual arguments for presence of MOLD argument when required by
1861 2024-02-29 Alexander Westbrooks <alexanderw@gcc.gnu.org>
1866 * decl.cc (gfc_get_pdt_instance): Set the PDT instance field
1867 'f2k_derived', if not set already, to point to the given
1868 PDT template 'f2k_derived' namespace in order to give the
1869 PDT instance referential access to the typebound procedures
1871 * gfortran.h (gfc_pdt_is_instance_of): Add prototype.
1872 * resolve.cc (resolve_typebound_procedure): If the derived type
1873 does not have the attribute 'pdt_template' set, compare the
1874 dummy argument to the 'resolve_bindings_derived' type like usual.
1875 If the derived type is a 'pdt_template', then check if the
1876 dummy argument is an instance of the PDT template. If the derived
1877 type is a PDT template, and the dummy argument is an instance of
1878 that template, but the dummy argument 'param_list' is not
1879 SPEC_ASSUMED, check if there are any LEN parameters in the
1880 dummy argument. If there are no LEN parameters, then this implies
1881 that there are only KIND parameters in the dummy argument.
1882 If there are LEN parameters, this would be an error, for all
1883 LEN parameters for the dummy argument MUST be assumed for
1884 typebound procedures of PDTs.
1885 (resolve_pdt): Add a check for ALLOCATABLE and POINTER attributes for
1886 SPEC_DEFERRED parameters of PDT class symbols. ALLOCATABLE and
1887 POINTER attributes for a PDT class symbol are stored in the
1888 'class_pointer' and 'allocatable' attributes of the '_data'
1889 component respectively.
1890 * symbol.cc (gfc_pdt_is_instance_of): New function.
1892 2024-02-26 Harald Anlauf <anlauf@gmx.de>
1895 * trans-expr.cc (gfc_conv_procedure_call): Evaluate non-trivial
1896 arguments just once before assigning to an unlimited polymorphic
1899 2024-02-23 Steve Kargl <kargl@gcc.gnu.org>
1900 Harald Anlauf <anlauf@gmx.de>
1903 * trans-stmt.cc (gfc_trans_allocate): When a source expression has
1904 substring references, part-refs, or %re/%im inquiries, wrap the
1905 entity in parentheses to force evaluation of the expression.
1907 2024-02-23 Tobias Burnus <tburnus@baylibre.com>
1909 * openmp.cc (gfc_match_omp_depobj): Use OPT_Wopenmp
1910 as warning category in gfc_warning.
1912 2024-02-20 Peter Hill <peter.hill@york.ac.uk>
1915 * trans-expr.cc (gfc_conv_intrinsic_to_class): When passing an
1916 array component reference of intrinsic type to a procedure
1917 with an unlimited polymorphic dummy argument, a temporary
1920 2024-02-17 Jakub Jelinek <jakub@redhat.com>
1923 * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Don't
1924 overwrite expr2->ts.u.cl->backend_decl, instead set size to
1925 expr2->ts.u.cl->backend_decl first and use size instead of
1926 expr2->ts.u.cl->backend_decl.
1927 (gfc_trans_subcomponent_assign): Emit se.pre into block
1928 before calling alloc_scalar_allocatable_subcomponent instead of
1931 2024-02-17 Harald Anlauf <anlauf@gmx.de>
1934 * trans-array.cc (gfc_trans_deferred_array): Do not clobber
1935 deferred length for a character variable passed as dummy argument.
1937 2024-02-15 Kwok Cheung Yeung <kcyeung@baylibre.com>
1939 * dump-parse-tree.cc (show_attr): Handle omp_declare_target_indirect
1941 * f95-lang.cc (gfc_gnu_attributes): Add entry for 'omp declare
1943 * gfortran.h (symbol_attribute): Add omp_declare_target_indirect
1945 (struct gfc_omp_clauses): Add indirect field.
1946 * openmp.cc (omp_mask2): Add OMP_CLAUSE_INDIRECT.
1947 (gfc_match_omp_clauses): Match indirect clause.
1948 (OMP_DECLARE_TARGET_CLAUSES): Add OMP_CLAUSE_INDIRECT.
1949 (gfc_match_omp_declare_target): Check omp_device_type and apply
1950 omp_declare_target_indirect attribute to symbol if indirect clause
1951 active. Show warning if there are only device_type and/or indirect
1952 clauses on the directive.
1953 * trans-decl.cc (add_attributes_to_decl): Add 'omp declare target
1954 indirect' attribute if symbol has indirect attribute set.
1956 2024-02-14 Steve Kargl <kargl@gcc.gnu.org>
1959 * trans-io.cc (transfer_namelist_element): When building the
1960 namelist object name, if the use rename attribute is set, use
1961 the local name specified in the use statement.
1963 2024-02-14 Jakub Jelinek <jakub@redhat.com>
1965 * error.cc (error_print): For u printing of ptrdiff_t,
1966 print ptrdiff_t argument converted to unsigned long long and
1967 masked with 2ULL * PTRDIFF_MAX + 1.
1969 2024-02-13 Tobias Burnus <tburnus@baylibre.com>
1971 PR middle-end/113904
1972 * trans-openmp.cc (gfc_trans_omp_declare_variant): Handle splitting of
1973 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
1974 * openmp.cc (gfc_match_omp_context_selector): Likewise; rejects
1975 non-const device_num/condition; improve diagnostic.
1977 2024-02-13 Harald Anlauf <anlauf@gmx.de>
1980 * trans-expr.cc (gfc_conv_procedure_call): When passing an optional
1981 dummy argument to an optional dummy argument of a bind(c) procedure
1982 and the dummy argument is passed via a CFI descriptor, no special
1983 presence check and passing of a default NULL pointer is needed.
1985 2024-02-13 Steve Kargl <kargl@gcc.gnu.org>
1988 * trans-array.cc (gfc_trans_deferred_array): Set length to zero,
1989 avoiding extraneous diagnostics.
1991 2024-02-10 Jakub Jelinek <jakub@redhat.com>
1993 * error.cc (error_print): Handle z and t modifiers on d, i and u.
1994 * check.cc (gfc_check_transfer): Use %zd instead of %ld and casts to
1996 * primary.cc (gfc_convert_to_structure_constructor): Use %td instead
1997 of %ld and casts to long.
1999 2024-02-10 Jakub Jelinek <jakub@redhat.com>
2001 * trans-common.cc (build_common_decl): Use %wu instead of %lu and
2002 casts to unsigned long.
2003 * resolve.cc (resolve_ordinary_assign): Use %wd instead of %ld and
2005 * array.cc (gfc_resolve_character_array_constructor): Likewise.
2006 * data.cc (create_character_initializer): Likewise.
2008 2024-02-09 Harald Anlauf <anlauf@gmx.de>
2011 * arith.cc (reduce_unary): Remember any overflow encountered during
2012 reduction of unary arithmetic operations on array constructors and
2013 continue, and return error status, but terminate on serious errors.
2015 2024-01-28 Harald Anlauf <anlauf@gmx.de>
2018 * trans-expr.cc (conv_dummy_value): Treat NULL actual argument to
2019 optional dummy with the VALUE attribute as not present.
2020 (gfc_conv_procedure_call): Likewise.
2022 2024-01-27 Harald Anlauf <anlauf@gmx.de>
2025 * trans-array.cc (gfc_conv_array_ref): Restrict use of transformed
2026 descriptor (sym->backend_decl) to the unlimited polymorphic case.
2028 2024-01-24 Harald Anlauf <anlauf@gmx.de>
2031 * trans-expr.cc (conv_dummy_value): New.
2032 (gfc_conv_procedure_call): Factor code for handling dummy arguments
2033 with the VALUE attribute in the scalar case into conv_dummy_value().
2034 Reuse and adjust for calling elemental procedures.
2036 2024-01-21 Harald Anlauf <anlauf@gmx.de>
2039 * trans-expr.cc (gfc_conv_procedure_call): Fix handling of optional
2040 scalar arguments of intrinsic type with the VALUE attribute.
2042 2024-01-20 Mikael Morin <mikael@gcc.gnu.org>
2046 * parse.cc: Restore current interface to its previous value on error.
2048 2024-01-19 Harald Anlauf <anlauf@gmx.de>
2051 * trans-array.cc (array_bound_check_elemental): Array bounds check
2052 shall apply here to elemental dimensions of an array section only.
2054 2024-01-13 Harald Anlauf <anlauf@gmx.de>
2057 * trans-intrinsic.cc (gfc_conv_intrinsic_ishftc): Handle optional
2058 dummy argument for SIZE passed to ISHFTC. Set default value to
2059 BIT_SIZE(I) when missing.
2061 2024-01-13 Harald Anlauf <anlauf@gmx.de>
2064 * gfortran.h (gfc_loop_annot): New.
2065 (gfc_iterator, gfc_forall_iterator): Use for annotation control.
2066 * array.cc (gfc_copy_iterator): Adjust.
2067 * gfortran.texi: Document annotations IVDEP, UNROLL n, VECTOR,
2068 NOVECTOR as applied to DO CONCURRENT.
2069 * parse.cc (parse_do_block): Parse annotations IVDEP, UNROLL n,
2070 VECTOR, NOVECTOR as applied to DO CONCURRENT. Apply UNROLL only to
2071 first loop control variable.
2072 * trans-stmt.cc (iter_info): Use gfc_loop_annot.
2073 (gfc_trans_simple_do): Adjust.
2074 (gfc_trans_forall_loop): Annotate loops with IVDEP, UNROLL n,
2075 VECTOR, NOVECTOR as needed for DO CONCURRENT.
2076 (gfc_trans_forall_1): Handle loop annotations.
2078 2024-01-08 Harald Anlauf <anlauf@gmx.de>
2081 * trans-intrinsic.cc (gfc_conv_intrinsic_size): Use
2082 gfc_conv_expr_present() for proper check of optional DIM argument.
2084 2024-01-06 Harald Anlauf <anlauf@gmx.de>
2085 José Rui Faustino de Sousa <jrfsousa@gmail.com>
2088 * iresolve.cc (gfc_resolve_repeat): Force conversion to
2089 gfc_charlen_int_kind before call to gfc_multiply.
2091 2024-01-04 David Malcolm <dmalcolm@redhat.com>
2093 * lang.opt.urls: New file, autogenerated by
2094 regenerate-opt-urls.py.
2096 2024-01-03 Harald Anlauf <anlauf@gmx.de>
2098 * trans-types.cc (gfc_get_nodesc_array_type): Clear used gmp
2101 2024-01-03 Jakub Jelinek <jakub@redhat.com>
2103 * gfortranspec.cc (lang_specific_driver): Update copyright notice
2105 * gfc-internals.texi: Bump @copying's copyright year.
2106 * gfortran.texi: Ditto.
2107 * intrinsic.texi: Ditto.
2108 * invoke.texi: Ditto.
2111 Copyright (C) 2024 Free Software Foundation, Inc.
2113 Copying and distribution of this file, with or without modification,
2114 are permitted in any medium without royalty provided the copyright
2115 notice and this notice are preserved.