1 2024-10-13 Tobias Burnus <tburnus@baylibre.com>
3 * gfortran.h (gfc_option_t): Add disable_acc_on_device.
4 * options.cc (gfc_handle_option): Handle -fno-builtin-acc_on_device.
5 * trans-decl.cc (gfc_get_extern_function_decl): Move
6 __builtin_omp_is_initial_device handling to ...
7 * trans-expr.cc (get_builtin_fn): ... this new function.
8 (conv_function_val): Call it.
9 (update_builtin_function): New.
10 (gfc_conv_procedure_call): Call it.
11 * types.def (BT_BOOL): Fix type by using bool_type_node.
13 2024-10-12 Thomas Koenig <tkoenig@gcc.gnu.org>
15 * dump-parse-tree.cc (get_c_type_name): Also handle BT_UNSIGNED.
16 * gfortran.h (NAMED_UINTCST): Define before inclusion
17 of iso-c-binding.def and iso-fortran-env.def.
18 (gfc_get_uint_kind_from_width_isofortranenv): Prototype.
19 * gfortran.texi: Mention new constants in iso_c_binding and
21 * iso-c-binding.def: Handle NAMED_UINTCST. Add c_unsigned,
22 c_unsigned_short,c_unsigned_char, c_unsigned_long,
23 c_unsigned_long_long, c_uintmax_t, c_uint8_t, c_uint16_t,
24 c_uint32_t, c_uint64_t, c_uint128_t, c_uint_least8_t,
25 c_uint_least16_t, c_uint_least32_t, c_uint_least64_t,
26 c_uint_least128_t, c_uint_fast8_t, c_uint_fast16_t,
27 c_uint_fast32_t, c_uint_fast64_t and c_uint_fast128_t.
28 * iso-fortran-env.def: Handle NAMED_UINTCST. Add uint8, uint16,
30 * module.cc (parse_integer): Whitespace fix.
31 (write_module): Whitespace fix.
32 (NAMED_UINTCST): Define before inclusion of iso-fortran-evn.def
33 and iso-fortran-env.def.
34 * symbol.cc: Likewise.
35 * trans-types.cc (get_unsigned_kind_from_node): New function.
36 (get_uint_kind_from_name): New function.
37 (gfc_get_uint_kind_from_width_isofortranenv): New function.
38 (get_uint_kind_from_width): New function.
39 (gfc_init_kinds): Initialize gfc_c_uint_kind.
41 2024-10-12 Tobias Burnus <tburnus@baylibre.com>
43 * openmp.cc (resolve_omp_clauses): Diagnose polymorphic mapping.
44 * trans-openmp.cc (gfc_omp_finish_clause): Warn when
45 polymorphic variable is implicitly mapped.
47 2024-10-12 Tobias Burnus <tburnus@baylibre.com>
49 * array.cc (gfc_match_array_constructor): Only update the
50 character length if the expression is of character type.
51 * error.cc (gfc_get_location_with_offset): New; split off
53 (gfc_format_decoder): ... here; call it.
54 * gfortran.h (gfc_get_location_with_offset): New prototype.
55 (gfc_get_location): New inline function.
56 * trans.cc (gfc_get_location): Remove function definition.
57 * trans.h (gfc_get_location): Remove declaration.
59 2024-10-11 Thomas Koenig <tkoenig@gcc.gnu.org>
61 * intrinsic.cc (add_functions): Convert uint and
62 selected_unsigned_kind to GFC_STD_UNSIGNED.
63 (gfc_check_intrinsic_standard): Handle GFC_STD_UNSIGNED.
64 * libgfortran.h (GFC_STD_UNSIGNED): Add.
65 * options.cc (gfc_post_options): Set GFC_STD_UNSIGNED
68 2024-10-11 Tobias Burnus <tburnus@baylibre.com>
70 * error.cc (error_char, error_string, error_uinteger, error_integer,
71 error_hwuint, error_hwint, gfc_widechar_display_length,
72 gfc_wide_display_length, error_printf, show_locus, show_loci):
73 Remove unused static functions.
74 (IBUF_LEN, MAX_ARGS): Remove now unused #define.
76 2024-10-08 Andre Vehreschild <vehre@gcc.gnu.org>
79 * array.cc (gfc_match_array_ref): Only parse coarray part of
81 * match.h (gfc_match_array_ref): Add flag.
82 * primary.cc (gfc_match_varspec): Request only coarray ref
83 parsing when no regular array is present. Report error on
84 unexpected additional ref.
86 2024-10-07 Thomas Koenig <tkoenig@gcc.gnu.org>
88 * check.cc (gfc_check_minloc_maxloc): Handle BT_UNSIGNED.
89 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Likewise.
90 * gfortran.texi: Document MAXLOC and MINLOC for UNSIGNED.
92 2024-10-07 Tobias Burnus <tburnus@baylibre.com>
94 * openmp.cc (is_predefined_allocator): Use gomp-constants.h consts.
95 * trans-common.cc (translate_common): Reject OpenMP allocate directives.
96 * trans-decl.cc (gfc_finish_var_decl): Handle allocate directive
98 (gfc_trans_deferred_vars): Update for the latter.
100 2024-10-01 Thomas Koenig <tkoenig@gcc.gnu.org>
102 * check.cc (int_or_real_or_char_or_unsigned_check_f2003): New function.
103 (gfc_check_minval_maxval): Use it.
104 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxval): Handle
105 initial values for UNSIGNED.
106 * gfortran.texi: Document MINVAL and MAXVAL for unsigned.
108 2024-09-30 David Malcolm <dmalcolm@redhat.com>
111 * error.cc (gfc_diagnostic_build_locus_prefix): Convert first
112 param from diagnostic_context * to
113 const diagnostic_location_print_policy &. Add colorize param.
114 Likewise for the "two expanded_locations" overload.
115 (gfc_diagnostic_text_starter): Update for above changes.
116 (gfc_diagnostic_start_span): Update for change to callback type.
118 2024-09-30 Andre Vehreschild <vehre@gcc.gnu.org>
121 * trans-expr.cc (gfc_conv_procedure_call): Ensure coarrays use a
122 descriptor when passed.
124 2024-09-28 Thomas Koenig <tkoenig@gcc.gnu.org>
126 * check.cc (intrinsic_type_check): Handle unsigned.
127 (gfc_check_findloc): Likewise.
128 * gfortran.texi: Include FINDLOC in unsigned documentation.
129 * iresolve.cc (gfc_resolve_findloc): Use INTEGER version
132 2024-09-28 Thomas Koenig <tkoenig@gcc.gnu.org>
134 * check.cc (gfc_check_eoshift): Handle BT_UNSIGNED.
135 * simplify.cc (gfc_simplify_eoshift): Likewise.
136 * gfortran.texi: Document CSHIFT and EOSHIFT for UNSIGNED.
138 2024-09-26 Mikael Morin <mikael@gcc.gnu.org>
140 * invoke.texi (-M): Remove index reference to removed documentation.
142 2024-09-25 Mikael Morin <mikael@gcc.gnu.org>
145 * invoke.texi: Remove @code wrapping in arguments to @opindex.
146 (std=): Remove spurious 'option' in index.
147 (idirafter, imultilib, iprefix, isysroot, iquote, isystem,
148 fintrinsic-modules-path): Remove variable from index.
149 * lang.opt.urls: Regenerate.
151 2024-09-25 Tobias Burnus <tburnus@baylibre.com>
153 * parse.cc (decode_omp_directive): Set target-used bit of
154 omp_requires_mask when encountering the declare_target or interop
157 2024-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
159 * check.cc (gfc_check_random_number): Adjust for unsigned.
160 * iresolve.cc (gfc_resolve_random_number): Handle unsigned.
161 * trans-expr.cc (gfc_conv_expr_op): Handle BT_UNSIGNED for divide.
162 * trans-types.cc (gfc_get_dtype_rank_type): Handle BT_UNSIGNED.
163 * gfortran.texi: Add RANDOM_NUMBER for UNSIGNED.
165 2024-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
167 * check.cc (gfc_check_transf_bit_intrins): Handle unsigned.
168 * gfortran.texi: Docment IANY, IALL and IPARITY for unsigned.
169 * iresolve.cc (gfc_resolve_iall): Set flag to use integer
170 if type is BT_UNSIGNED.
171 (gfc_resolve_iany): Likewise.
172 (gfc_resolve_iparity): Likewise.
173 * simplify.cc (do_bit_and): Adjust asserts for BT_UNSIGNED.
174 (do_bit_ior): Likewise.
175 (do_bit_xor): Likewise
177 2024-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
179 * gfortran.texi: Document SUM and PRODUCT.
180 * iresolve.cc (resolve_transformational): New argument,
181 use_integer, to translate calls to unsigned to calls to
183 (gfc_resolve_product): Use it
184 (gfc_resolve_sum): Use it.
185 * simplify.cc (init_result_expr): Handle BT_UNSIGNED.
187 2024-09-24 Thomas Koenig <tkoenig@gcc.gnu.org>
189 * arith.cc (gfc_arith_uminus): Fix warning.
190 (gfc_arith_minus): Correctly truncate unsigneds.
191 * check.cc (gfc_check_dot_product): Handle unsigned arguments.
192 (gfc_check_matmul): Likewise.
193 * expr.cc (gfc_get_unsigned_expr): New function.
194 * gfortran.h (gfc_get_unsigned_expr): Add prototype.
195 * iresolve.cc (gfc_resolve_matmul): If using UNSIGNED, use the
196 signed integer version.
197 * gfortran.texi: Document MATMUL and DOT_PRODUCT for unsigned.
198 * simplify.cc (compute_dot_product): Handle unsigneds.
200 2024-09-24 Andre Vehreschild <vehre@gcc.gnu.org>
203 * trans-expr.cc (trans_caf_token_assign): Take caf-token from
204 decl for non ultimate coarray components.
206 2024-09-24 Andre Vehreschild <vehre@gcc.gnu.org>
209 * trans-array.cc (duplicate_allocatable_coarray): For scalar
210 allocatable components the memory allocated is now assigned to
211 the component's pointer.
213 2024-09-24 Tobias Burnus <tburnus@baylibre.com>
215 * gfortran.h (enum gfc_omp_requires_kind): Add OMP_REQ_SELF_MAPS.
216 (gfc_namespace): Enlarge omp_requires bitfield.
217 * module.cc (enum ab_attribute, attr_bits): Add AB_OMP_REQ_SELF_MAPS.
218 (mio_symbol_attribute): Handle it.
219 * openmp.cc (gfc_check_omp_requires, gfc_match_omp_requires): Handle
221 * parse.cc (gfc_parse_file): Handle self_maps clause.
223 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
226 * invoke.texi(finline-intrinsics): Document new flag.
227 * lang.opt (finline-intrinsics, finline-intrinsics=,
228 fno-inline-intrinsics): New flags.
229 * options.cc (gfc_post_options): If the option variable controlling
230 the inlining of MAXLOC (respectively MINLOC) has not been set, set
231 it or clear it depending on the optimization option variables.
232 * trans-intrinsic.cc (gfc_inline_intrinsic_function_p): Return false
233 if inlining for the intrinsic is disabled according to the option
236 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
239 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Generate a set
240 of index variables. Set them using the loop indexes before leaving
241 the first set of loops. Generate a new loop entry predicate.
242 Initialize it. Set it before leaving the first set of loops. Clear
243 it in the body of the second set of loops. For the second set of
244 loops, update each loop lower bound to use the corresponding index
245 variable if the predicate variable is set.
247 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
250 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Initialize
251 and update all the variables. Put the label and goto in the
252 outermost scalarizer loop. Don't start the second loop where the
254 (gfc_inline_intrinsic_function_p): Also return TRUE for array MASK
255 or for any REAL type.
257 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
260 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Generate
261 variable initialization for each dimension in the else branch of
262 the toplevel condition.
263 (gfc_inline_intrinsic_function_p): Return TRUE for scalar MASK.
265 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
268 * trans-array.cc (gfc_conv_ss_startstride): Set the MINLOC/MAXLOC
269 result upper bound using the rank of the ARRAY argument. Ajdust
270 the error message for intrinsic result arrays. Only check array
271 bounds for array references. Move bound check decision code...
272 (bounds_check_needed): ... here as a new predicate. Allow bound
273 check for MINLOC/MAXLOC intrinsic results.
274 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Change the
275 result array upper bound to the rank of ARRAY. Update the NONEMPTY
276 variable to depend on the non-empty extent of every dimension. Use
277 one variable per dimension instead of a single variable for the
278 position and the offset. Update their declaration, initialization,
279 and update to affect the variable of each dimension. Use the first
280 variable only in areas only accessed with rank 1 ARRAY argument.
281 Set every element of the result using its corresponding variable.
282 (gfc_inline_intrinsic_function_p): Return true for integral ARRAY
283 and absent DIM and MASK.
285 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
287 * trans-array.cc (gfc_conv_ss_startstride): Move array bound check
289 (add_check_section_in_array_bounds): ... here as a new function.
291 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
293 * frontend-passes.cc (optimize_minmaxloc): Remove.
294 (optimize_expr): Remove dispatch to optimize_minmaxloc.
296 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
299 * trans-array.cc (gfc_conv_ss_startstride): Set the scalarization
300 rank based on the MINLOC/MAXLOC rank if needed. Call the inline
301 code generation and setup the scalarizer array descriptor info
302 in the MINLOC and MAXLOC cases.
303 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Return the
304 result array element if the scalarizer is setup and we are inside
305 the loops. Restrict library function call dispatch to the case
306 where inline expansion is not supported. Declare an array result
307 if the expression isn't scalar. Initialize the array result single
308 element and return the result variable if the expression isn't
310 (walk_inline_intrinsic_minmaxloc): New function.
311 (walk_inline_intrinsic_function): Add MINLOC and MAXLOC cases,
312 dispatching to walk_inline_intrinsic_minmaxloc.
313 (gfc_add_intrinsic_ss_code): Add MINLOC and MAXLOC cases.
314 (gfc_inline_intrinsic_function_p): Return true if ARRAY has rank 1,
317 2024-09-21 Mikael Morin <mikael@gcc.gnu.org>
320 * frontend-passes.cc (optimize_minmaxloc): Skip if we can generate
321 inline code for the unmodified expression.
322 * trans-intrinsic.cc (gfc_inline_intrinsic_function_p): Add
323 MINLOC and MAXLOC cases.
325 2024-09-20 David Malcolm <dmalcolm@redhat.com>
328 * error.cc: Include "diagnostic-format-text.h".
329 (gfc_diagnostic_starter): Rename to...
330 (gfc_diagnostic_text_starter): ...this. Convert first
331 param from diagnostic_context * to diagnostic_text_output_format &
332 and update accordingly.
333 (gfc_diagnostic_finalizer, gfc_diagnostic_text_finalizer):
335 (gfc_diagnostics_init): Update for renamings.
336 (gfc_diagnostics_finish): Likewise.
338 2024-09-19 Andre Vehreschild <vehre@gcc.gnu.org>
341 * trans-types.cc (gfc_get_derived_type): Only build non-pointer
342 derived types as component's types when they are not yet built.
344 2024-09-19 Andre Vehreschild <vehre@gcc.gnu.org>
347 * trans-array.cc (duplicate_allocatable_coarray): Allow adding
348 of deep copy code in the when-allocated case. Add bounds
349 computation before condition, because coarrays need the bounds
350 also when not allocated.
351 (structure_alloc_comps): Duplication in the coarray case is done
352 already, omit it. Add the deep-code when duplication a coarray.
353 * trans-expr.cc (gfc_trans_structure_assign): Fix comment.
355 2024-09-15 Mikael Morin <mikael@gcc.gnu.org>
357 * trans-expr.cc (gfc_advance_se_ss_chain): Don't use an element
358 from the parent scalarization chain when the current chain reaches
361 2024-09-13 Tobias Burnus <tburnus@baylibre.com>
364 * gfortran.h (gfc_omp_namelist): Rename 'init' members for clarity.
365 * match.cc (gfc_free_omp_namelist): Handle renaming.
366 * dump-parse-tree.cc (show_omp_namelist): Update for new format
368 * openmp.cc (gfc_match_omp_prefer_type): Parse list to 'fr' and 'attr';
369 store 'fr' values as integer.
370 (gfc_match_omp_init): Rename variable names.
372 2024-09-12 Steven G. Kargl <kargl@gcc.gnu.org>
374 * module.cc (bt_types): Add BT_UNSIGNED.
376 2024-09-11 Tobias Burnus <tburnus@baylibre.com>
379 * openmp.cc (gfc_match_omp_prefer_type): NULL init a gfc_expr
380 variable and use right locus in gfc_error.
382 2024-09-09 David Malcolm <dmalcolm@redhat.com>
384 * cpp.cc (cb_cpp_diagnostic_cpp_option): Convert return type from
385 "int" to "diagnostic_option_id".
386 (cb_cpp_diagnostic): Update for renaming of
387 diagnostic_override_option_index to diagnostic_set_option_id.
388 * error.cc (gfc_warning): Update for renaming of diagnostic_info
390 (gfc_warning_now_at): Likewise.
391 (gfc_warning_now): Likewise.
392 (gfc_warning_internal): Likewise.
394 2024-09-09 David Malcolm <dmalcolm@redhat.com>
397 * error.cc (gfc_clear_pp_buffer): Rename diagnostic_context's
398 "printer" field to "m_printer".
399 (gfc_warning): Likewise.
400 (gfc_diagnostic_build_kind_prefix): Likewise.
401 (gfc_diagnostic_build_locus_prefix): Likewise.
402 (gfc_diagnostic_starter): Likewise.
403 (gfc_diagnostic_starter): Likewise.
404 (gfc_diagnostic_start_span): Likewise.
405 (gfc_diagnostic_finalizer): Likewise.
406 (gfc_warning_check): Likewise.
407 (gfc_error_opt): Likewise.
408 (gfc_error_check): Likewise.
410 2024-09-07 Thomas Koenig <tkoenig@gcc.gnu.org>
412 * arith.cc (gfc_reduce_unsigned): New function.
413 (gfc_arith_error): Add ARITH_UNSIGNED_TRUNCATED and
414 ARITH_UNSIGNED_NEGATIVE.
415 (gfc_arith_init_1): Initialize unsigned types.
416 (gfc_check_unsigned_range): New function.
417 (gfc_range_check): Handle unsigned types.
418 (gfc_arith_uminus): Likewise.
419 (gfc_arith_plus): Likewise.
420 (gfc_arith_minus): Likewise.
421 (gfc_arith_times): Likewise.
422 (gfc_arith_divide): Likewise.
423 (gfc_compare_expr): Likewise.
424 (eval_intrinsic): Likewise.
425 (gfc_int2int): Also convert unsigned.
426 (gfc_uint2uint): New function.
427 (gfc_int2uint): New function.
428 (gfc_uint2int): New function.
429 (gfc_uint2real): New function.
430 (gfc_uint2complex): New function.
431 (gfc_real2uint): New function.
432 (gfc_complex2uint): New function.
433 (gfc_log2uint): New function.
434 (gfc_uint2log): New function.
435 * arith.h (gfc_int2uint, gfc_uint2uint, gfc_uint2int, gfc_uint2real):
437 (gfc_uint2complex, gfc_real2uint, gfc_complex2uint, gfc_log2uint):
439 (gfc_uint2log): Likewise.
440 * check.cc (gfc_boz2uint): New function
441 (type_check2): New function.
442 (int_or_real_or_unsigned_check): New function.
443 (less_than_bitsizekind): Adjust for unsingeds.
444 (less_than_bitsize2): Likewise.
445 (gfc_check_allocated): Likewise.
446 (gfc_check_mod): Likewise.
447 (gfc_check_bge_bgt_ble_blt): Likewise.
448 (gfc_check_bitfcn): Likewise.
449 (gfc_check_digits): Likewise.
450 (gfc_check_dshift): Likewise.
451 (gfc_check_huge): Likewise.
452 (gfc_check_iu): New function.
453 (gfc_check_iand_ieor_ior): Adjust for unsigneds.
454 (gfc_check_ibits): Likewise.
455 (gfc_check_uint): New function.
456 (gfc_check_ishft): Adjust for unsigneds.
457 (gfc_check_ishftc): Likewise.
458 (gfc_check_min_max): Likewise.
459 (gfc_check_merge_bits): Likewise.
460 (gfc_check_selected_int_kind): Likewise.
461 (gfc_check_shift): Likewise.
462 (gfc_check_mvbits): Likewise.
463 (gfc_invalid_unsigned_ops): Likewise.
464 * decl.cc (gfc_match_decl_type_spec): Likewise.
465 * dump-parse-tree.cc (show_expr): Likewise.
466 * expr.cc (gfc_get_constant_expr): Likewise.
467 (gfc_copy_expr): Likewise.
468 (gfc_extract_int): Likewise.
469 (numeric_type): Likewise.
470 * gfortran.h (enum arith): Extend with ARITH_UNSIGNED_TRUNCATED
471 and ARITH_UNSIGNED_NEGATIVE.
472 (enum gfc_isym_id): Extend with GFC_ISYM_SU_KIND and GFC_ISYM_UINT.
473 (gfc_check_unsigned_range): New prototype-
474 (gfc_arith_error): Likewise.
475 (gfc_reduce_unsigned): Likewise.
476 (gfc_boz2uint): Likewise.
477 (gfc_invalid_unsigned_ops): Likewise.
478 (gfc_convert_mpz_to_unsigned): Likewise.
479 * gfortran.texi: Add some rudimentary documentation.
480 * intrinsic.cc (gfc_type_letter): Adjust for unsigneds.
481 (add_functions): Add uint and adjust functions to be called.
482 (add_conversions): Add unsigned conversions.
483 (gfc_convert_type_warn): Adjust for unsigned.
484 * intrinsic.h (gfc_check_iu, gfc_check_uint, gfc_check_mod, gfc_simplify_uint,
485 gfc_simplify_selected_unsigned_kind, gfc_resolve_uint): New prototypes.
486 * invoke.texi: Add -funsigned.
487 * iresolve.cc (gfc_resolve_dshift): Handle unsigneds.
488 (gfc_resolve_iand): Handle unsigneds.
489 (gfc_resolve_ibclr): Handle unsigneds.
490 (gfc_resolve_ibits): Handle unsigneds.
491 (gfc_resolve_ibset): Handle unsigneds.
492 (gfc_resolve_ieor): Handle unsigneds.
493 (gfc_resolve_ior): Handle unsigneds.
494 (gfc_resolve_uint): Handle unsigneds.
495 (gfc_resolve_merge_bits): Handle unsigneds.
496 (gfc_resolve_not): Handle unsigneds.
497 * lang.opt: Add -funsigned.
498 * libgfortran.h: Add BT_UNSIGNED.
499 * match.cc (gfc_match_type_spec): Match UNSIGNED.
500 * misc.cc (gfc_basic_typename): Add UNSIGNED.
501 (gfc_typename): Likewise.
502 * primary.cc (convert_unsigned): New function.
503 (match_unsigned_constant): New function.
504 (gfc_match_literal_constant): Handle unsigned.
505 * resolve.cc (resolve_operator): Handle unsigned.
506 (resolve_ordinary_assign): Likewise.
507 * simplify.cc (convert_mpz_to_unsigned): Renamed to...
508 (gfc_convert_mpz_to_unsigned): and adjusted.
509 (gfc_simplify_bit_size): Adjusted for unsigned.
510 (compare_bitwise): Likewise.
511 (gfc_simplify_bge): Likewise.
512 (gfc_simplify_bgt): Likewise.
513 (gfc_simplify_ble): Likewise.
514 (gfc_simplify_blt): Likewise.
515 (simplify_cmplx): Likewise.
516 (gfc_simplify_digits): Likewise.
517 (simplify_dshift): Likewise.
518 (gfc_simplify_huge): Likewise.
519 (gfc_simplify_iand): Likewise.
520 (gfc_simplify_ibclr): Likewise.
521 (gfc_simplify_ibits): Likewise.
522 (gfc_simplify_ibset): Likewise.
523 (gfc_simplify_ieor): Likewise.
524 (gfc_simplify_uint): Likewise.
525 (gfc_simplify_ior): Likewise.
526 (simplify_shift): Likewise.
527 (gfc_simplify_ishftc): Likewise.
528 (gfc_simplify_merge_bits): Likewise.
529 (min_max_choose): Likewise.
530 (gfc_simplify_mod): Likewise.
531 (gfc_simplify_modulo): Likewise.
532 (gfc_simplify_popcnt): Likewise.
533 (gfc_simplify_range): Likewise.
534 (gfc_simplify_selected_unsigned_kind): Likewise.
535 (gfc_convert_constant): Likewise.
536 * target-memory.cc (size_unsigned): New function.
537 (gfc_element_size): Adjust for unsigned.
538 * trans-const.h (gfc_conv_mpz_unsigned_to_tree): Add prototype.
539 * trans-const.cc (gfc_conv_mpz_unsigned_to_tree): Handle unsigneds.
540 (gfc_conv_constant_to_tree): Likewise.
541 * trans-decl.cc (gfc_conv_cfi_to_gfc): Put in "not yet implemented".
542 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Likewise.
543 * trans-stmt.cc (gfc_trans_integer_select): Handle unsigned.
544 (gfc_trans_select): Likewise.
545 * trans-intrinsic.cc (gfc_conv_intrinsic_mod): Handle unsigned.
546 (gfc_conv_intrinsic_shift): Likewise.
547 (gfc_conv_intrinsic_function): Add GFC_ISYM_UINT.
548 * trans-io.cc (enum iocall): Add IOCALL_X_UNSIGNED and IOCALL_X_UNSIGNED_WRITE.
549 (gfc_build_io_library_fndecls): Add transfer_unsigned and transfer_unsigned_write.
550 (transfer_expr): Handle unsigneds.
551 * trans-types.cc (gfc_unsinged_kinds): New array.
552 (gfc_unsigned_types): Likewise.
553 (gfc_init_kinds): Handle them.
554 (validate_unsigned): New function.
555 (gfc_validate_kind): Use it.
556 (gfc_build_unsigned_type): New function.
557 (gfc_init_types): Use it.
558 (gfc_get_unsigned_type): New function.
559 (gfc_typenode_for_spec): Handle unsigned.
560 * trans-types.h (gfc_get_unsigned_type): New prototype.
562 2024-09-06 Tobias Burnus <tburnus@baylibre.com>
564 * dump-parse-tree.cc (show_omp_namelist): Handle OMP_LIST_INIT.
565 (show_omp_clauses): Handle OMP_LIST_{INIT,USE,DESTORY}; move 'nowait'
566 from end-directive to the directive dump.
567 (show_omp_node, show_code_node): Handle EXEC_OMP_INTEROP.
568 * gfortran.h (enum gfc_statement): Add ST_OMP_INTEROP.
569 (OMP_LIST_INIT, OMP_LIST_USE, OMP_LIST_DESTROY): Add.
570 (enum gfc_exec_op): Add EXEC_OMP_INTEROP.
571 (struct gfc_omp_namelist): Add interop items to union.
572 (gfc_free_omp_namelist): Add boolean arg.
573 * match.cc (gfc_free_omp_namelist): Update to free
574 interop union members.
575 * match.h (gfc_match_omp_interop): New.
576 * openmp.cc (gfc_omp_directives): Uncomment 'interop' entry.
577 (gfc_free_omp_clauses, gfc_match_omp_allocate,
578 gfc_match_omp_flush, gfc_match_omp_clause_reduction): Update
580 (enum omp_mask2): Add OMP_CLAUSE_{INIT,USE,DESTROY}.
581 (OMP_INTEROP_CLAUSES): Use it.
582 (gfc_match_omp_clauses): Match those clauses.
583 (gfc_match_omp_prefer_type, gfc_match_omp_init,
584 gfc_match_omp_interop): New.
585 (resolve_omp_clauses): Handle interop clauses.
586 (omp_code_to_statement): Add ST_OMP_INTEROP.
587 (gfc_resolve_omp_directive): Add EXEC_OMP_INTEROP.
588 * parse.cc (decode_omp_directive): Parse 'interop' directive.
589 (next_statement, gfc_ascii_statement): Handle ST_OMP_INTEROP.
590 * st.cc (gfc_free_statement): Likewise
591 * resolve.cc (gfc_resolve_code): Handle EXEC_OMP_INTEROP.
592 * trans.cc (trans_code): Likewise.
593 * trans-openmp.cc (gfc_trans_omp_directive): Print 'sorry'
594 for EXEC_OMP_INTEROP.
596 2024-09-05 Harald Anlauf <anlauf@gmx.de>
599 * trans-decl.cc (gfc_create_module_variable): Handle module
600 variable also when it is needed for the result specification
601 of a contained function.
603 2024-09-03 David Malcolm <dmalcolm@redhat.com>
605 * error.cc (gfc_move_error_buffer_from_to): Prefix all
606 output_buffer fields with "m_".
607 (gfc_diagnostics_init): Likewise.
609 2024-08-31 Harald Anlauf <anlauf@gmx.de>
611 * match.cc (gfc_match_namelist): Downgrade feature from GNU to
614 2024-08-30 Harald Anlauf <anlauf@gmx.de>
617 * resolve.cc (resolve_symbol): Add default-initialization of
618 non-allocatable, non-pointer derived-type function results.
620 2024-08-29 David Malcolm <dmalcolm@redhat.com>
622 * error.cc (gfc_format_decoder): Convert final param from
623 const char **buffer_ptr to pp_token_list &formatted_token_list,
624 and update call to default_tree_printer accordingly.
626 2024-08-29 Harald Anlauf <anlauf@gmx.de>
629 * trans-io.cc (transfer_namelist_element): Prevent NULL pointer
632 2024-08-23 Paul Thomas <pault@gcc.gnu.org>
635 2024-08-06 Paul Thomas <pault@gcc.gnu.org>
638 * trans-array.cc (get_array_ref_dim_for_loop_dim): Use the arg1
639 class container carried in ss->info as the seed for a lhs in
640 class valued transformational intrinsic calls that are not the
641 rhs of an assignment. Otherwise, the lhs variable expression is
642 taken from the loop chain. For this latter case, the _vptr and
644 (gfc_trans_create_temp_array): Use either the lhs expression
645 seeds to build a class variable that will take the returned
646 descriptor as its _data field. In the case that the arg1 expr.
647 is used, a class typespec must be built with the correct rank
648 and the _vptr and _len fields set. The element size is provided
649 for the temporary allocation and to set the descriptor span.
650 (gfc_array_init_size): When an intrinsic type scalar expr3 is
651 used in allocation of a class array, use its element size in
652 the descriptor dtype.
653 * trans-expr.cc (gfc_conv_class_to_class): Class valued
654 transformational intrinsics return the pointer to the array
655 descriptor as the _data field of a class temporary. Extract
656 directly and return the address of the class temporary.
657 (gfc_conv_procedure_call): store the expression for the first
658 argument of a class valued transformational intrinsic function
659 in the ss info class_container field. Later, use its type as
660 the element type in the call to gfc_trans_create_temp_array.
661 (fcncall_realloc_result): Add a dtype argument and use it in
662 the descriptor, when available.
663 (gfc_trans_arrayfunc_assign): For class lhs, build a dtype with
664 the lhs rank and the rhs element size and use it in the call to
665 fcncall_realloc_result.
667 2024-08-23 Gerald Pfeifer <gerald@pfeifer.com>
669 * invoke.texi (Code Gen Options): Add a missing word.
671 2024-08-23 Andre Vehreschild <vehre@gcc.gnu.org>
674 * trans-stmt.cc (trans_associate_var): Remove superfluous
677 2024-08-21 Andre Vehreschild <vehre@gcc.gnu.org>
680 * trans-intrinsic.cc (conv_intrinsic_move_alloc): Correct
682 * trans-types.cc (gfc_sym_type): Pass coarray rank, not false.
683 (gfc_get_derived_type): Only propagate codimension for coarrays
684 and pointers to array components in derived typed coarrays.
686 2024-08-21 Andre Vehreschild <vehre@gcc.gnu.org>
689 * trans-intrinsic.cc (gfc_conv_intrinsic_sizeof): Use
690 class_container of se when set.
692 2024-08-20 Andre Vehreschild <vehre@gcc.gnu.org>
695 * resolve.cc (caf_possible_reallocate): Detect arrays that may
696 be reallocated by caf_send.
697 (resolve_ordinary_assign): More reliably detect assignments
698 where a rewrite to caf_send is needed.
699 * trans-expr.cc (gfc_trans_assignment_1): Remove rewrite to
700 caf_send, because this is done by resolve now.
701 * trans-intrinsic.cc (conv_caf_send): Prevent unneeded temporary
704 2024-08-19 Andre Vehreschild <vehre@gcc.gnu.org>
708 * expr.cc (gfc_is_coindexed): Detect is coindexed also when
709 rewritten to caf_get.
710 * trans-stmt.cc (trans_associate_var): Always accept a
711 descriptor for coarrays.
713 2024-08-19 Andre Vehreschild <vehre@gcc.gnu.org>
716 * trans-types.cc (gfc_get_derived_type): When a caf_sub_token is
717 generated for a component, link it to the component it is
718 generated for (the previous one).
720 2024-08-16 Harald Anlauf <anlauf@gmx.de>
723 * intrinsic.texi: Fix documentation of arguments of RANDOM_INIT,
724 which is conforming to the F2018 standard.
726 2024-08-15 Jakub Jelinek <jakub@redhat.com>
729 * resolve.cc (resolve_operator): Use %L rather than %%L in format
732 2024-08-15 Andre Vehreschild <vehre@gcc.gnu.org>
735 * class.cc (gfc_is_class_scalar_expr): Coarray refs that ref
736 only self, aka this image, are regarded as scalar, too.
737 * resolve.cc (resolve_assoc_var): Ignore this image coarray refs
738 and do not build a new class type.
739 * trans-expr.cc (gfc_get_caf_token_offset): Get the caf token
740 from the descriptor for associated variables.
741 (gfc_conv_variable): Same.
742 (gfc_trans_pointer_assignment): Assign token to temporary
743 associate variable, too.
744 (gfc_trans_scalar_assign): Add flag that assign is for associate
745 and use it to assign the token.
746 (is_assoc_assign): Detect that expressions are for associate
748 (gfc_trans_assignment_1): Treat associate assigns like pointer
749 assignments where possible.
750 * trans-stmt.cc (trans_associate_var): Set same_class only for
752 * trans.h (gfc_trans_scalar_assign): Add flag to
753 trans_scalar_assign for marking associate assignments.
755 2024-08-15 Andre Vehreschild <vehre@gcc.gnu.org>
757 * arith.cc (reduce_unary): Use expr.corank.
758 (reduce_binary_ac): Same.
759 (reduce_binary_ca): Same.
760 (reduce_binary_aa): Same.
761 * array.cc (gfc_match_array_ref): Same.
762 * check.cc (dim_corank_check): Same.
763 (gfc_check_move_alloc): Same.
764 (gfc_check_image_index): Same.
765 * class.cc (gfc_add_class_array_ref): Same.
766 (finalize_component): Same.
767 * data.cc (gfc_assign_data_value): Same.
768 * decl.cc (match_clist_expr): Same.
769 (add_init_expr_to_sym): Same.
770 * expr.cc (simplify_intrinsic_op): Same.
771 (simplify_parameter_variable): Same.
772 (gfc_check_assign_symbol): Same.
773 (gfc_get_variable_expr): Same.
774 (gfc_add_full_array_ref): Same.
775 (gfc_lval_expr_from_sym): Same.
776 (gfc_get_corank): Removed.
777 * frontend-passes.cc (callback_reduction): Use expr.corank.
779 (combine_array_constructor): Same.
780 (optimize_minmaxloc): Same.
781 * gfortran.h (gfc_get_corank): Add corank to gfc_expr.
782 * intrinsic.cc (gfc_get_intrinsic_function_symbol): Use
784 (gfc_convert_type_warn): Same.
785 (gfc_convert_chartype): Same.
786 * iresolve.cc (resolve_bound): Same.
787 (gfc_resolve_cshift): Same.
788 (gfc_resolve_eoshift): Same.
789 (gfc_resolve_logical): Same.
790 (gfc_resolve_matmul): Same.
791 * match.cc (copy_ts_from_selector_to_associate): Same.
792 * matchexp.cc (gfc_get_parentheses): Same.
793 * parse.cc (parse_associate): Same.
794 * primary.cc (gfc_match_rvalue): Same.
795 * resolve.cc (resolve_structure_cons): Same.
796 (resolve_actual_arglist): Same.
797 (resolve_elemental_actual): Same.
798 (resolve_generic_f0): Same.
799 (resolve_unknown_f): Same.
800 (resolve_operator): Same.
801 (gfc_expression_rank): Same and set dimen_type for coarray to
803 (gfc_op_rank_conformable): Use expr.corank.
804 (add_caf_get_intrinsic): Same.
805 (resolve_variable): Same.
806 (gfc_fixup_inferred_type_refs): Same.
807 (check_host_association): Same.
808 (resolve_compcall): Same.
809 (resolve_expr_ppc): Same.
810 (resolve_assoc_var): Same.
811 (fixup_array_ref): Same.
812 (resolve_select_type): Same.
813 (add_comp_ref): Same.
814 (get_temp_from_expr): Same.
815 (resolve_fl_var_and_proc): Same.
816 (resolve_symbol): Same.
817 * symbol.cc (gfc_is_associate_pointer): Same.
818 * trans-array.cc (walk_coarray): Same.
819 (gfc_conv_expr_descriptor): Same.
820 (gfc_walk_array_ref): Same.
821 * trans-array.h (gfc_walk_array_ref): Same.
822 * trans-expr.cc (gfc_get_ultimate_alloc_ptr_comps_caf_token):
824 * trans-intrinsic.cc (trans_this_image): Same.
825 (trans_image_index): Same.
826 (conv_intrinsic_cobound): Same.
827 (gfc_walk_intrinsic_function): Same.
828 (conv_intrinsic_move_alloc): Same.
829 * trans-stmt.cc (gfc_trans_lock_unlock): Same.
830 (trans_associate_var): Same and adapt to slightly different
831 behaviour of expr.corank and gfc_get_corank.
832 (gfc_trans_allocate): Same.
833 * trans.cc (gfc_add_finalizer_call): Same.
835 2024-08-14 Harald Anlauf <anlauf@gmx.de>
837 * simplify.cc (gfc_simplify_sizeof): Clear used gmp variable.
838 * target-memory.cc (gfc_target_expr_size): Likewise.
840 2024-08-14 Andre Vehreschild <vehre@gcc.gnu.org>
843 * match.cc (gfc_match_associate): Reset proc_ptr parsing flag on
846 2024-08-14 Andre Vehreschild <vehre@gcc.gnu.org>
849 * trans-intrinsic.cc (conv_intrinsic_move_alloc): Get the vtab
850 only for derived types and classes and adjust _len for class
853 2024-08-13 Harald Anlauf <anlauf@gmx.de>
854 Steven G. Kargl <kargl@gcc.gnu.org>
857 * array.cc (resolve_array_list): Reject array constructor value if
858 its declared type is abstract (F2018:C7114).
860 2024-08-12 Andre Vehreschild <vehre@gcc.gnu.org>
863 * resolve.cc (resolve_variable): Mark the variable as host
864 associated only, when it is not in an associate block.
865 * trans-decl.cc (generate_coarray_init): Remove incorrect unused
868 2024-08-11 Harald Anlauf <anlauf@gmx.de>
871 * intrinsic.cc (gfc_get_intrinsic_sub_symbol): Initialize variable.
872 * symbol.cc (gfc_get_ha_symbol): Likewise.
874 2024-08-07 Julian Brown <julian@codesourcery.com>
875 Tobias Burnus <tobias@baylibre.com>
877 * gfortran.h (gfc_option_t): Add disable_omp_is_initial_device.
878 * lang.opt (fbuiltin-): Add.
879 * options.cc (gfc_handle_option): Handle
880 -fno-builtin-omp_is_initial_device.
881 * f95-lang.cc (gfc_init_builtin_functions): Handle
882 DEF_GOMP_BUILTIN_COMPILER.
883 * trans-decl.cc (gfc_get_extern_function_decl): Add code to use
884 DEF_GOMP_BUILTIN_COMPILER for 'omp_is_initial_device'.
886 2024-08-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
889 * resolve.cc (CHECK_INTERFACES): New helper macro.
890 (resolve_operator): Replace use of snprintf with
893 2024-08-06 Paul Thomas <pault@gcc.gnu.org>
896 * trans-array.cc (get_array_ref_dim_for_loop_dim): Use the arg1
897 class container carried in ss->info as the seed for a lhs in
898 class valued transformational intrinsic calls that are not the
899 rhs of an assignment. Otherwise, the lhs variable expression is
900 taken from the loop chain. For this latter case, the _vptr and
902 (gfc_trans_create_temp_array): Use either the lhs expression
903 seeds to build a class variable that will take the returned
904 descriptor as its _data field. In the case that the arg1 expr.
905 is used, a class typespec must be built with the correct rank
906 and the _vptr and _len fields set. The element size is provided
907 for the temporary allocation and to set the descriptor span.
908 (gfc_array_init_size): When an intrinsic type scalar expr3 is
909 used in allocation of a class array, use its element size in
910 the descriptor dtype.
911 * trans-expr.cc (gfc_conv_class_to_class): Class valued
912 transformational intrinsics return the pointer to the array
913 descriptor as the _data field of a class temporary. Extract
914 directly and return the address of the class temporary.
915 (gfc_conv_procedure_call): store the expression for the first
916 argument of a class valued transformational intrinsic function
917 in the ss info class_container field. Later, use its type as
918 the element type in the call to gfc_trans_create_temp_array.
919 (fcncall_realloc_result): Add a dtype argument and use it in
920 the descriptor, when available.
921 (gfc_trans_arrayfunc_assign): For class lhs, build a dtype with
922 the lhs rank and the rhs element size and use it in the call to
923 fcncall_realloc_result.
925 2024-08-03 Steve Kargl <kargls@comcast.net>
928 * symbol.cc (gfc_add_save): Add checks for SAVE attribute
929 conflicts and duplicate SAVE attribute.
931 2024-08-02 Mikael Morin <mikael@gcc.gnu.org>
933 * trans-intrinsic.cc (maybe_absent_optional_variable): New function.
934 (gfc_conv_intrinsic_minmaxloc): Remove BACK from scalarization and
935 evaluate it before. Add a check that BACK is not null if the
936 expression is an optional dummy. Save the resulting expression to a
937 variable. Use the variable in the generated inline code.
939 2024-08-01 Jakub Jelinek <jakub@redhat.com>
941 * trans-types.cc (gfc_get_array_descr_info): Don't test if
942 !integer_zerop (dtype_off), use fold_build_pointer_plus
945 2024-07-29 Tobias Burnus <tburnus@baylibre.com>
948 * trans-common.cc (build_common_decl): Add 'omp declare target' and
949 'omp declare target link' variables to offload_vars.
950 * trans-decl.cc (add_attributes_to_decl): Likewise; update args and
951 call decl_attributes.
952 (get_proc_pointer_decl, gfc_get_extern_function_decl,
953 build_function_decl): Update calls.
954 (gfc_get_symbol_decl): Likewise; move after 'DECL_STATIC (t)=1'
955 to avoid errors with symtab_node::get_create.
957 2024-07-22 Andre Vehreschild <vehre@gcc.gnu.org>
960 * trans-expr.cc (gfc_conv_procedure_call): Treat
961 pointers/references (e.g. from parameters) correctly by derefing
964 2024-07-21 Paul Thomas <pault@gcc.gnu.org>
967 * gfortran.h : Add decl_order to gfc_symbol.
968 * symbol.cc : Add static next_decl_order..
969 (gfc_set_sym_referenced): Set symbol decl_order.
970 * trans-decl.cc : Include dependency.h.
971 (decl_order): Replace symbol declared_at.lb->location with
974 2024-07-19 Harald Anlauf <anlauf@gmx.de>
977 * trans-array.cc (gfc_trans_array_constructor_value): If the first
978 element of an array constructor is deferred-length character and
979 therefore does not have an element size known at compile time, do
980 not try to collect subsequent constant elements into a constructor
983 2024-07-18 Andre Vehreschild <vehre@gcc.gnu.org>
987 * array.cc (gfc_compare_array_spec): Take cotype into account.
988 * class.cc (gfc_build_class_symbol): Coarrays are also arrays.
989 * gfortran.h (IS_CLASS_COARRAY_OR_ARRAY): New macro to detect
990 regular and coarray class arrays.
991 * interface.cc (compare_components): Take codimension into
993 * resolve.cc (resolve_symbol): Improve error message.
994 * simplify.cc (simplify_bound_dim): Remove duplicate.
995 * trans-array.cc (gfc_trans_array_cobounds): Coarrays are also
997 (gfc_trans_array_bounds): Same.
998 (gfc_trans_dummy_array_bias): Same.
999 (get_coarray_as): Get the as having a non-zero codim.
1000 (is_explicit_coarray): Detect explicit coarrays.
1001 (gfc_conv_expr_descriptor): Create a new descriptor for explicit
1003 * trans-decl.cc (gfc_build_qualified_array): Coarrays are also
1005 (gfc_build_dummy_array_decl): Same.
1006 (gfc_get_symbol_decl): Same.
1007 (gfc_trans_deferred_vars): Same.
1008 * trans-expr.cc (class_scalar_coarray_to_class): Get the
1009 descriptor from the correct location.
1010 (gfc_conv_variable): Pick up the descriptor when needed.
1011 * trans-types.cc (gfc_is_nodesc_array): Coarrays are also
1013 (gfc_get_nodesc_array_type): Indentation fix only.
1014 (cobounds_match_decl): Match a tree's bounds to the expr's
1015 bounds and return true, when they match.
1016 (gfc_get_derived_type): Create a new type tree/descriptor, when
1017 the cobounds of the existing declaration and expr to not
1018 match. This happends for class arrays in parameter list, when
1019 there are different cobound declarations.
1021 2024-07-18 Paul Thomas <pault@gcc.gnu.org>
1024 * gfortran.h: Add bit field 'allocated_in_scope' to gfc_symbol.
1025 * trans-array.cc (gfc_array_allocate): Set 'allocated_in_scope'
1026 after allocation if not a component reference.
1027 (gfc_alloc_allocatable_for_assignment): If 'allocated_in_scope'
1028 not set, not a component ref and not allocated, set the array
1029 bounds and offset to give zero length in all dimensions. Then
1030 set allocated_in_scope.
1032 2024-07-18 Andre Vehreschild <vehre@gcc.gnu.org>
1035 * trans-types.cc (gfc_sym_type): Use type `char*` for saved
1036 deferred length char arrays.
1037 * trans.cc (get_array_span): Get `.span` also for `char*` typed
1038 arrays, i.e. for those that have INTEGER_TYPE instead of
1041 2024-07-17 Kewen Lin <linkw@linux.ibm.com>
1044 * trans-types.cc (get_real_kind_from_node): Consider the case where
1045 more than one modes have the same precision.
1047 2024-07-16 Paul Thomas <pault@gcc.gnu.org>
1050 * simplify.cc (gfc_simplify_len_trim): If the argument is an
1051 element of a parameter array, simplify all the elements and
1052 build a new parameter array to hold the result, after checking
1053 that it doesn't already exist.
1054 * trans-expr.cc (gfc_get_interface_mapping_array) if a string
1055 length is available, use it for the typespec.
1056 (gfc_add_interface_mapping): Supply the se string length.
1058 2024-07-16 Prathamesh Kulkarni <prathameshk@nvidia.com>
1060 * trans-expr.cc (gfc_trans_zero_assign): Handle allocatable arrays.
1062 2024-07-13 Mikael Morin <mikael@gcc.gnu.org>
1064 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Add the
1065 preliminary code generated for MASK to the preliminary code of
1068 2024-07-12 Mikael Morin <morin-mikael@orange.fr>
1070 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxloc): Create a new
1071 scalar scalarization chain element if BACK is present. Add it to
1072 the loop. Set the scalarization chain before evaluating the
1075 2024-07-11 Andre Vehreschild <vehre@gcc.gnu.org>
1077 * trans-array.cc (gfc_conv_array_parameter): Init variable to
1078 NULL_TREE to fix bootstrap.
1080 2024-07-11 Andre Vehreschild <vehre@gcc.gnu.org>
1083 * trans-array.cc (gfc_trans_array_bounds): Set a starting
1084 stride, when descriptor expects a variable for the stride.
1085 (gfc_trans_dummy_array_bias): Allow storage association for
1086 dummy class arrays, when they are not elemental.
1087 (gfc_conv_array_parameter): Add more general class support
1088 and packing for classes, too.
1089 * trans-array.h (gfc_conv_array_parameter): Add lbound shift
1091 * trans-decl.cc (gfc_build_builtin_function_decls): Add decls
1092 for internal_un-/pack_class.
1093 * trans-expr.cc (gfc_reset_vptr): Allow supplying a type-tree
1094 to generate the vtab from.
1095 (gfc_class_set_vptr): Allow supplying a class-tree to take the
1097 (class_array_data_assign): Rename to gfc_class_array_data_assign
1098 and make usable from other compile units.
1099 (gfc_class_array_data_assign): Renamed from class_array_data_
1101 (gfc_conv_derived_to_class): Remove assert to
1102 allow converting derived to class type arrays with assumed
1103 rank. Reduce code base and use gfc_conv_array_parameter also
1105 (gfc_conv_class_to_class): Use gfc_class_data_assign.
1106 (gfc_conv_procedure_call): Adapt to new signature of
1107 gfc_conv_derived_to_class.
1108 * trans-io.cc (transfer_expr): Same.
1109 * trans-stmt.cc (trans_associate_var): Same.
1110 * trans.h (gfc_conv_derived_to_class): Signature changed.
1111 (gfc_class_array_data_assign): Made public.
1112 (gfor_fndecl_in_pack_class): Added declaration.
1113 (gfor_fndecl_in_unpack_class): Same.
1115 2024-07-08 Mikael Morin <mikael@gcc.gnu.org>
1117 * trans-array.cc (gfc_trans_preloop_setup): Use a separate variable
1118 for iteration. Use directly the value of variable I if it is known.
1119 Move the definition of the variable to the branch where the
1122 2024-07-03 Harald Anlauf <anlauf@gmx.de>
1125 * trans-stmt.cc (trans_associate_var): When the associate target
1126 is an array-valued character variable, the length is known at entry
1127 of the associate block. Move setting of string length of the
1128 selector to the initialization part of the block.
1130 2024-07-01 Andrew Stubbs <ams@baylibre.com>
1131 Thomas Schwinge <thomas@codesourcery.com>
1133 * openmp.cc (is_predefined_allocator): Update valid ranges to
1134 incorporate ompx_gnu_pinned_mem_alloc.
1136 2024-06-29 Harald Anlauf <anlauf@gmx.de>
1139 * trans-stmt.cc (gfc_trans_allocate): Fix handling of case of
1140 scalar character expression being used for SOURCE.
1142 2024-06-28 Andre Vehreschild <vehre@gcc.gnu.org>
1144 * trans-expr.cc (gfc_class_set_vptr): Add setting of _vptr
1146 * trans-intrinsic.cc (conv_intrinsic_move_alloc): First use
1147 of gfc_class_set_vptr and refactor very similar code.
1148 * trans.h (gfc_class_set_vptr): Declare the new function.
1150 2024-06-28 Andre Vehreschild <vehre@gcc.gnu.org>
1152 * trans-array.cc (structure_alloc_comps): Use reset_vptr.
1153 * trans-decl.cc (gfc_trans_deferred_vars): Same.
1154 (gfc_generate_function_code): Same.
1155 * trans-expr.cc (gfc_reset_vptr): Allow supplying the class
1157 (gfc_conv_procedure_call): Use reset_vptr.
1158 * trans-intrinsic.cc (gfc_conv_intrinsic_transfer): Same.
1160 2024-06-24 Harald Anlauf <anlauf@gmx.de>
1163 * trans-array.cc (gfc_conv_array_parameter): Do not dereference
1164 data component of a missing allocatable dummy array argument for
1165 passing as actual to optional dummy. Harden logic of presence
1166 check for optional pointer dummy by using TRUTH_ANDIF_EXPR instead
1169 2024-06-20 Paul Thomas <pault@gcc.gnu.org>
1172 * dependency.cc (dependency_fcn, gfc_function_dependency): New
1173 functions to detect dependency in array bounds and character
1174 lengths on old style function results.
1175 * dependency.h : Add prototype for gfc_function_dependency.
1176 * error.cc (error_print): Remove trailing space.
1177 * gfortran.h : Remove dummy_order and add fn_result_spec.
1178 * symbol.cc : Remove declaration of next_dummy_order..
1179 (gfc_set_sym_referenced): remove setting of symbol dummy order.
1180 * trans-array.cc (gfc_trans_auto_array_allocation): Detect
1181 non-dummy symbols with function dependencies and put the
1182 allocation at the end of the initialization code.
1183 * trans-decl.cc : Include dependency.h.
1184 (decl_order): New function that determines uses the location
1185 field of the symbol 'declared_at' to determine the order of two
1187 (gfc_defer_symbol_init): Call gfc_function_dependency to put
1188 dependent symbols in the right part of the tlink chain. Use
1189 the location field of the symbol declared_at to determine the
1190 order of declarations.
1191 (gfc_trans_auto_character_variable): Put character length
1192 initialization of dependent symbols at the end of the chain.
1193 * trans.cc (gfc_add_init_cleanup): Add boolean argument with
1194 default false that determines whther an expression is placed at
1195 the back or the front of the initialization chain.
1196 * trans.h : Update the prototype for gfc_add_init_cleanup.
1198 2024-06-19 Harald Anlauf <anlauf@gmx.de>
1201 * trans-decl.cc (gfc_conv_cfi_to_gfc): Move derivation of type sizes
1202 for character via gfc_trans_vla_type_sizes to after character length
1205 2024-06-19 Andre Vehreschild <vehre@gcc.gnu.org>
1208 * trans-decl.cc (gfc_generate_function_code): Set vptr for
1209 results to declared class type.
1210 * trans-expr.cc (gfc_reset_vptr): Allow to provide the typespec
1211 instead of the expression.
1212 * trans.h (gfc_reset_vptr): Same.
1214 2024-06-17 Andre Vehreschild <vehre@gcc.gnu.org>
1216 * trans.cc (gfc_deallocate_with_status): Check that object to deref
1217 is an array, before applying array deref.
1219 2024-06-12 David Malcolm <dmalcolm@redhat.com>
1221 * error.cc (gfc_clear_pp_buffer): Likewise.
1222 (gfc_warning): Likewise.
1223 (gfc_warning_check): Likewise.
1224 (gfc_error_opt): Likewise.
1225 (gfc_error_check): Likewise.
1227 2024-06-07 Andre Vehreschild <vehre@gcc.gnu.org>
1230 * trans-array.cc (gfc_trans_array_ctor_element): Eval non-
1231 variable expressions once only.
1232 (gfc_trans_array_constructor_value): Add statements of
1234 (trans_array_constructor): Detect when final block is required.
1236 2024-06-07 Andre Vehreschild <vehre@gcc.gnu.org>
1239 * expr.cc (gfc_is_alloc_class_scalar_function): Detect
1240 allocatable class return types also for user-defined
1242 * trans-expr.cc (gfc_conv_procedure_call): Same.
1243 (trans_class_vptr_len_assignment): Compute vptr len
1244 assignment correctly for user-defined functions.
1246 2024-06-05 Jakub Jelinek <jakub@redhat.com>
1247 Frederik Harwath <frederik@codesourcery.com>
1248 Sandra Loosemore <sandra@codesourcery.com>
1250 * gfortran.h (enum gfc_statement): Add ST_OMP_UNROLL,
1251 ST_OMP_END_UNROLL, ST_OMP_TILE and ST_OMP_END_TILE.
1252 (struct gfc_omp_clauses): Add sizes_list, partial, full and erroneous
1254 (enum gfc_exec_op): Add EXEC_OMP_UNROLL and EXEC_OMP_TILE.
1255 (gfc_expr_list_len): Declare.
1256 * match.h (gfc_match_omp_tile, gfc_match_omp_unroll): Declare.
1257 * openmp.cc (gfc_get_location): Declare.
1258 (gfc_free_omp_clauses): Free sizes_list.
1259 (match_oacc_expr_list): Rename to ...
1260 (match_omp_oacc_expr_list): ... this. Add is_omp argument and
1261 change diagnostic wording if it is true.
1262 (enum omp_mask2): Add OMP_CLAUSE_{FULL,PARTIAL,SIZES}.
1263 (gfc_match_omp_clauses): Parse full, partial and sizes clauses.
1264 (gfc_match_oacc_wait): Use match_omp_oacc_expr_list instead of
1265 match_oacc_expr_list.
1266 (OMP_UNROLL_CLAUSES, OMP_TILE_CLAUSES): Define.
1267 (gfc_match_omp_tile, gfc_match_omp_unroll): New functions.
1268 (resolve_omp_clauses): Diagnose full vs. partial clause conflict.
1269 Resolve sizes clause arguments.
1270 (find_nested_loop_in_chain): Use switch instead of series of ifs.
1271 Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1272 (gfc_resolve_omp_do_blocks): Set omp_current_do_collapse to
1273 list length of sizes_list if present.
1274 (gfc_resolve_do_iterator): Return for EXEC_OMP_TILE or
1276 (restructure_intervening_code): Remove spurious ()s around & operands.
1277 (is_outer_iteration_variable): Handle EXEC_OMP_TILE and
1279 (check_nested_loop_in_chain): Likewise.
1280 (expr_is_invariant): Likewise.
1281 (resolve_omp_do): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL. Diagnose
1282 tile without sizes clause. Use sizes_list length for count if
1283 non-NULL. Set code->ext.omp_clauses->erroneous on loops where we've
1284 reported diagnostics. Sorry for mixing non-rectangular loops with
1286 (omp_code_to_statement): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1287 (gfc_resolve_omp_directive): Likewise.
1288 * parse.cc (decode_omp_directive): Parse end tile, end unroll, tile
1289 and unroll. Move nothing entry alphabetically.
1290 (case_exec_markers): Add ST_OMP_TILE and ST_OMP_UNROLL.
1291 (gfc_ascii_statement): Handle ST_OMP_END_TILE, ST_OMP_END_UNROLL,
1292 ST_OMP_TILE and ST_OMP_UNROLL.
1293 (parse_omp_do): Add nested argument. Handle ST_OMP_TILE and
1295 (parse_omp_structured_block): Adjust parse_omp_do caller.
1296 (parse_executable): Likewise. Handle ST_OMP_TILE and ST_OMP_UNROLL.
1297 * resolve.cc (gfc_resolve_blocks): Handle EXEC_OMP_TILE and
1299 (gfc_resolve_code): Likewise.
1300 * st.cc (gfc_free_statement): Likewise.
1301 * trans.cc (trans_code): Likewise.
1302 * trans-openmp.cc (gfc_trans_omp_clauses): Handle full, partial and
1303 sizes clauses. Use tree_cons + nreverse instead of
1304 temporary vector and build_tree_list_vec for tile_list handling.
1305 (gfc_expr_list_len): New function.
1306 (gfc_trans_omp_do): Rename tile to oacc_tile. Handle sizes clause.
1307 Don't assert code->op is EXEC_DO. Handle EXEC_OMP_TILE and
1309 (gfc_trans_omp_directive): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1310 * dump-parse-tree.cc (show_omp_clauses): Dump full, partial and
1312 (show_omp_node): Handle EXEC_OMP_TILE and EXEC_OMP_UNROLL.
1313 (show_code_node): Likewise.
1315 2024-06-05 Kewen Lin <linkw@linux.ibm.com>
1317 * trans-intrinsic.cc (build_round_expr): Use TYPE_PRECISION of
1318 long_double_type_node to replace LONG_DOUBLE_TYPE_SIZE.
1319 * trans-types.cc (gfc_build_real_type): Use TYPE_PRECISION of
1320 {float,double,long_double}_type_node to replace
1321 {FLOAT,DOUBLE,LONG_DOUBLE}_TYPE_SIZE.
1323 2024-06-04 Harald Anlauf <anlauf@gmx.de>
1326 * trans-stmt.cc (gfc_trans_allocate): Restrict special case for
1327 source-expression with zero-length character to rank 0, so that
1328 the array shape is not discarded.
1330 2024-05-29 Andre Vehreschild <vehre@gcc.gnu.org>
1333 * trans-expr.cc (gfc_conv_procedure_call): Evaluate
1334 expressions with side-effects only ones and ensure
1337 2024-05-24 Harald Anlauf <anlauf@gmx.de>
1338 Steven G. Kargl <kargl@gcc.gnu.org>
1341 * symbol.cc (conflict_std): Helper function for reporting attribute
1342 conflicts depending on the Fortran standard version.
1343 (conf_std): Helper macro for checking standard-dependent conflicts.
1344 (gfc_check_conflict): Use it.
1346 2024-05-24 Harald Anlauf <anlauf@gmx.de>
1349 * trans-array.cc (gfc_conv_ss_startstride): Use abridged_ref_name
1350 to generate a more user-friendly name for bounds-check messages.
1351 * trans-expr.cc (gfc_copy_class_to_class): Fix bounds check for
1352 rank>1 by looping over the dimensions.
1354 2024-05-23 Paul Thomas <pault@gcc.gnu.org>
1357 * dependency.cc (gfc_dep_compare_expr): Handle component call
1358 expressions. Return -2 as default and return 0 if compared with
1359 a function expression that is from an interface body and has
1361 * expr.cc (gfc_reduce_init_expr): If the expression is a comp
1362 call do not attempt to reduce, defer to resolution and return
1364 * trans-types.cc (gfc_get_dtype_rank_type,
1365 gfc_get_nodesc_array_type): Fix whitespace.
1367 2024-05-20 Mikael Morin <mikael@gcc.gnu.org>
1370 * symbol.cc (gfc_release_symbol): Move the condition guarding
1371 the handling cyclic references...
1372 (cyclic_reference_break_needed): ... here as a new predicate.
1373 Remove superfluous parts. Add a condition preventing any premature
1374 release with submodule symbols.
1376 2024-05-20 Tobias Burnus <tburnus@baylibre.com>
1379 * trans-intrinsic.cc (gfc_conv_intrinsic_bound): Fix SHAPE
1380 for zero-size arrays
1382 2024-05-20 Tobias Burnus <tburnus@baylibre.com>
1384 * invoke.texi (fcoarray): Link to OpenCoarrays.org;
1385 mention libcaf_single.
1387 2024-05-17 Paul Thomas <pault@gcc.gnu.org>
1390 * gfortran.h: Add 'assoc_name_inferred' to gfc_namespace.
1391 * match.cc (gfc_match_select_type): Set 'assoc_name_inferred'
1392 in select type namespace if the selector has inferred type.
1393 * primary.cc (gfc_match_varspec): If a select type temporary
1394 is apparently scalar and a left parenthesis has been detected,
1395 check the current namespace has 'assoc_name_inferred' set. If
1396 so, set inferred_type.
1397 * resolve.cc (resolve_variable): If the namespace of a select
1398 type temporary is marked with 'assoc_name_inferred' call
1399 gfc_fixup_inferred_type_refs to ensure references are OK.
1400 (gfc_fixup_inferred_type_refs): Catch invalid array refs..
1402 2024-05-15 Jakub Jelinek <jakub@redhat.com>
1405 * openmp.cc (resolve_omp_clauses): Diagnose grainsize
1406 used together with num_tasks or nogroup used together with
1409 2024-05-13 Paul Thomas <pault@gcc.gnu.org>
1412 * trans-array.cc (gfc_array_init_size): Use the expr3 dtype so
1413 that the correct element size is used.
1414 * trans-expr.cc (gfc_conv_procedure_call): Remove restriction
1415 that ss and ss->loop be present for the finalization of class
1416 array function results.
1417 (trans_class_assignment): Use free and malloc, rather than
1418 realloc, for character expressions assigned to unlimited poly
1420 * trans-stmt.cc (gfc_trans_allocate): Build a correct rhs for
1421 the assignment of an unlimited polymorphic 'source'.
1423 2024-05-12 Harald Anlauf <anlauf@gmx.de>
1425 * primary.cc (gfc_match_varspec): Replace 'ref' argument to
1426 is_inquiry_ref() by NULL when the result is not needed to avoid
1429 2024-05-12 Paul Thomas <pault@gcc.gnu.org>
1434 * iresolve.cc (gfc_resolve_transfer): Emit a TODO error for
1435 unlimited polymorphic mold.
1436 * trans-expr.cc (gfc_resize_class_size_with_len): Use the fold
1437 even if a block is not available in which to fix the result.
1438 (trans_class_assignment): Enable correct assignment of
1439 character expressions to unlimited polymorphic variables using
1440 lhs _len field and rse string_length.
1441 * trans-intrinsic.cc (gfc_conv_intrinsic_storage_size): Extract
1442 the class expression so that the unlimited polymorphic class
1443 expression can be used in gfc_resize_class_size_with_len to
1444 obtain the storage size for character payloads. Guard the use
1445 of GFC_DECL_SAVED_DESCRIPTOR by testing for DECL_LANG_SPECIFIC
1446 to prevent the ICE. Also, invert the order to use the class
1447 expression extracted from the argument.
1448 (gfc_conv_intrinsic_transfer): In same way as 'storage_size',
1449 use the _len field to obtaining the correct length for arg 1.
1450 Add a branch for the element size in bytes of class expressions
1451 with provision to make use of the unlimited polymorphic _len
1452 field. Again, the class references are explicitly identified.
1453 'mold_expr' was already declared. Use it instead of 'arg'. Do
1454 not fix 'dest_word_len' for deferred character sources because
1455 reallocation on assign makes use of it before it is assigned.
1457 2024-05-11 Harald Anlauf <anlauf@gmx.de>
1460 * expr.cc (gfc_traverse_expr): An inquiry ref does not constitute
1461 a dependency and cannot collide with a symbol.
1463 2024-05-05 Harald Anlauf <anlauf@gmx.de>
1466 * trans-array.cc (gfc_alloc_allocatable_for_assignment): Take into
1467 account _len of unlimited polymorphic entities when calculating
1468 the effective element size for allocation size and array span.
1469 Set _len of lhs to _len of rhs.
1470 * trans-expr.cc (trans_class_assignment): Take into account _len
1471 of unlimited polymorphic entities for allocation size.
1473 2024-04-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1475 * expr.cc (check_transformational): Add SELECTED_LOGICAL_KIND
1476 to allowed functions for Fortran 2023.
1477 * gfortran.h (GFC_ISYM_SL_KIND): New.
1478 * gfortran.texi: Mention SELECTED_LOGICAL_KIND.
1479 * intrinsic.cc (add_functions): Add SELECTED_LOGICAL_KIND.
1480 (gfc_intrinsic_func_interface): Allow it in initialization
1482 * intrinsic.h (gfc_simplify_selected_logical_kind): New proto.
1483 * intrinsic.texi: Add SELECTED_LOGICAL_KIND.
1484 * simplify.cc (gfc_simplify_selected_logical_kind): New
1486 * trans-decl.cc (gfc_build_intrinsic_function_decls): Initialize
1487 gfor_fndecl_sl_kind.
1488 * trans-intrinsic.cc (gfc_conv_intrinsic_sl_kind): New function.
1489 (gfc_conv_intrinsic_function): Call it for GFC_ISYM_SL_KIND.
1490 * trans.h (gfor_fndecl_sl_kind): New symbol.
1492 2024-04-29 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1494 * iso-fortran-env.def: Add logical{8,16,32,64} and
1495 real16 named constants.
1497 2024-04-29 Paul Thomas <pault@gcc.gnu.org>
1500 * trans-expr.cc (gfc_trans_class_init_assign): Return NULL_TREE
1501 if the default initializer has all NULL fields. Guard this
1502 by a requirement that the code not be EXEC_INIT_ASSIGN and that
1503 the object be an INTENT_OUT dummy.
1504 * trans-stmt.cc (gfc_trans_allocate): Change the initializer
1505 code for allocate with mold to EXEC_ALLOCATE to allow an
1506 initializer with all NULL fields.
1508 2024-04-25 Paul Thomas <pault@gcc.gnu.org>
1511 * trans-expr.cc (gfc_conv_procedure_call): Use the interface,
1512 where possible, to obtain the type of character procedure
1513 pointers of class entities.
1515 2024-04-25 Paul Thomas <pault@gcc.gnu.org>
1516 Jakub Jelinek <jakub@gcc.gnu.org>
1519 * decl.cc (build_sym): Add an extra argument 'elem'. If 'elem'
1520 is greater than 1, gfc_new_charlen is called to generate a new
1521 charlen, registered in the symbol namespace.
1522 (variable_decl, enumerator_decl): Set the new argument in the
1525 2024-04-21 Paul Thomas <pault@gcc.gnu.org>
1528 * resolve.cc (resolve_actual_arglist): Catch variables silently
1529 set as untyped, resetting the flag so that gfc_resolve_expr can
1530 generate the no implicit type error.
1531 (gfc_resolve_index_1): Block index expressions of unknown type
1532 from being converted to default integer, avoiding the fatal
1533 error in trans-decl.cc.
1534 * symbol.cc (gfc_set_default_type): Remove '(symbol)' from the
1535 'no IMPLICIT type' error message.
1536 * trans-decl.cc (gfc_get_symbol_decl): Change fatal error locus
1537 to that of the symbol declaration.
1538 (gfc_trans_deferred_vars): Remove two trailing tabs.
1540 2024-04-18 Paul Thomas <pault@gcc.gnu.org>
1543 * primary.cc (gfc_match_varspec): Check for default type before
1544 checking for derived types with the right component name.
1546 2024-04-16 Harald Anlauf <anlauf@gmx.de>
1549 * resolve.cc (resolve_allocate_expr): Reject ALLOCATE with SOURCE=
1550 or MOLD= specifier for unequal length.
1551 * trans-stmt.cc (gfc_trans_allocate): If an allocatable character
1552 variable has fixed length, use it and do not use the source length.
1553 With bounds-checking enabled, add a runtime check for same length.
1555 2024-04-10 Harald Anlauf <anlauf@gmx.de>
1558 * check.cc (is_c_interoperable): Fix checks for C_SIZEOF.
1559 (gfc_check_c_f_pointer): Reject function returning a pointer as FPTR,
1560 and improve an error message.
1562 2024-04-09 Paul Thomas <pault@gcc.gnu.org>
1565 * resolve.cc (resolve_symbol): Remove last chunk that checked
1566 for finalization of unreferenced symbols.
1568 2024-04-09 Paul Thomas <pault@gcc.gnu.org>
1571 * trans-expr.cc (gfc_trans_pointer_assignment): Remove assert
1572 causing the ICE since it was unnecesary.
1574 2024-04-02 Paul Thomas <pault@gcc.gnu.org>
1577 * interface.cc (gfc_compare_interfaces): Add error for a
1578 subroutine proc pointer passed to a variable formal.
1579 (compare_parameter): If a procedure pointer is being passed to
1580 a non-procedure formal arg, and there is an an interface, use
1581 gfc_compare_interfaces to check and provide a more useful error
1584 2024-04-02 Paul Thomas <pault@gcc.gnu.org>
1587 * resolve.cc (resolve_procedure_expression): Change the test for
1588 for recursion in the case of hidden procedures from modules.
1589 (resolve_typebound_static): Add warning for possible recursive
1590 calls to typebound procedures.
1591 * trans-expr.cc (gfc_trans_class_init_assign): Do not apply
1592 default initializer to class dummy where component initializers
1595 2024-03-29 Harald Anlauf <anlauf@gmx.de>
1598 * trans-expr.cc (gfc_conv_structure): Check for NULL pointer.
1600 2024-03-29 Paul Thomas <pault@gcc.gnu.org>
1605 * trans-expr.cc (gfc_trans_assignment_1): Place finalization
1606 block before rhs post block for elemental rhs.
1607 * trans.cc (gfc_finalize_tree_expr): Check directly if a type
1608 has no components, rather than the zero components attribute.
1609 Treat elemental zero component expressions in the same way as
1612 2024-03-28 Harald Anlauf <anlauf@gmx.de>
1615 * primary.cc (gfc_variable_attr): Catch variables used in structure
1616 constructors within DATA statements that are still tagged with a
1617 temporary type BT_PROCEDURE from match_actual_arg and which have the
1618 target attribute, and fix their typespec.
1620 2024-03-28 Mikael Morin <mikael@gcc.gnu.org>
1621 Harald Anlauf <anlauf@gmx.de>
1625 * expr.cc (check_restricted): In submodules, allow variables host-
1626 associated from the parent module.
1628 2024-03-22 Harald Anlauf <anlauf@gmx.de>
1631 * interface.cc (gfc_compare_actual_formal): Skip size check for
1632 NULL() actual without MOLD argument.
1634 2024-03-22 Mikael Morin <mikael@gcc.gnu.org>
1637 * gfortran.h (gfc_save_module_list, gfc_restore_old_module_list):
1639 * module.cc (old_module_list_tail): New global variable.
1640 (gfc_save_module_list, gfc_restore_old_module_list): New functions.
1641 (gfc_use_modules): Set module_list and old_module_list_tail.
1642 * parse.cc (next_statement): Save module_list before doing any work.
1643 (reject_statement): Restore module_list to its saved value.
1645 2024-03-22 Mikael Morin <mikael@gcc.gnu.org>
1648 * symbol.cc (gfc_get_procedure_ns, gfc_get_spec_ns): New functions.
1649 * gfortran.h (gfc_get_procedure_ns, gfc_get_spec ns): Declare them.
1650 (gfc_is_formal_arg): Remove.
1651 * expr.cc (check_restricted): Remove special case allowing local
1652 variable in dummy argument bound expressions. Use gfc_get_spec_ns
1653 to get the right namespace.
1654 * resolve.cc (gfc_is_formal_arg, formal_arg_flag): Remove.
1655 (gfc_resolve_formal_arglist): Set gfc_current_ns. Quit loop and
1656 restore gfc_current_ns instead of early returning.
1657 (resolve_symbol): Factor common array spec resolution code to...
1658 (resolve_symbol_array_spec): ... this new function. Additionnally
1659 set and restore gfc_current_ns.
1661 2024-03-21 Harald Anlauf <anlauf@gmx.de>
1664 * trans-array.cc (abridged_ref_name): New helper function.
1665 (trans_array_bound_check): Use it.
1666 (array_bound_check_elemental): Likewise.
1667 (gfc_conv_array_ref): Likewise.
1669 2024-03-20 Jakub Jelinek <jakub@redhat.com>
1671 * trans-array.cc (structure_alloc_comps): Use integer_zero_node
1672 instead of build_zero_cst (integer_type_node) or
1673 build_int_cst (integer_type_node, 0) and integer_one_node instead of
1674 build_int_cst (integer_type_node, 1).
1675 * trans-expr.cc (conv_scalar_char_value): Likewise.
1676 * trans-stmt.cc (gfc_trans_form_team, gfc_trans_change_team,
1677 gfc_trans_sync_team, gfc_trans_sync): Likewise.
1678 * trans-decl.cc (create_main_function): Likewise.
1679 * trans-intrinsic.cc (trans_this_image, conv_intrinsic_move_alloc):
1681 * trans.cc (gfc_allocate_using_caf_lib, gfc_deallocate_with_status):
1684 2024-03-18 Harald Anlauf <anlauf@gmx.de>
1687 * frontend-passes.cc (check_externals_expr): Prevent invalid read
1688 in case of mismatch of external subroutine with function.
1690 2024-03-17 Harald Anlauf <anlauf@gmx.de>
1693 * trans-array.cc (gfc_get_dataptr_offset): Check for optional
1694 arguments being present before dereferencing data pointer.
1696 2024-03-15 Paul Thomas <pault@gcc.gnu.org>
1703 * class.cc (gfc_change_class): New function needed for
1704 associate names, when rank changes or a derived type is
1705 produced by resolution
1706 * dump-parse-tree.cc (show_code_node): Make output for SELECT
1707 TYPE more comprehensible.
1708 * expr.cc (find_inquiry_ref): Do not simplify expressions of
1710 * gfortran.h : Add 'gfc_association_list' to structure
1711 'gfc_association_list'. Add prototypes for
1712 'gfc_find_derived_types', 'gfc_fixup_inferred_type_refs' and
1713 'gfc_change_class'. Add macro IS_INFERRED_TYPE.
1714 * match.cc (copy_ts_from_selector_to_associate): Add bolean arg
1715 'select_type' with default false. If this is a select type name
1716 and the selector is a inferred type, build the class type and
1717 apply it to the associate name.
1718 (build_associate_name): Pass true to 'select_type' in call to
1720 * parse.cc (parse_associate): If the selector is inferred type
1721 the associate name is too. Make sure that function selector
1722 class and rank, if known, are passed to the associate name. If
1723 a function result exists, pass its typespec to the associate
1725 * primary.cc (resolvable_fcns): New function to check that all
1726 the function references are resolvable.
1727 (gfc_match_varspec): If a scalar derived type select type
1728 temporary has an array reference, match the array reference,
1729 treating this in the same way as an equivalence member. Do not
1730 set 'inquiry' if applied to an unknown type the inquiry name
1731 is ambiguous with the component of an accessible derived type.
1732 Check that resolution of the target expression is OK by testing
1733 if the symbol is declared or is an operator expression, then
1734 using 'resolvable_fcns' recursively. If all is well, resolve
1735 the expression. If this is an inferred type with a component
1736 reference, call 'gfc_find_derived_types' to find a suitable
1737 derived type. If there is an inquiry ref and the symbol either
1738 is of unknown type or is inferred to be a derived type, set the
1739 primary and symbol TKR appropriately.
1740 * resolve.cc (resolve_variable): Call new function below.
1741 (gfc_fixup_inferred_type_refs): New function to ensure that the
1742 expression references for a inferred type are consistent with
1743 the now fixed up selector.
1744 (resolve_assoc_var): Ensure that derived type or class function
1745 selectors transmit the correct arrayspec to the associate name.
1746 (resolve_select_type): If the selector is an associate name of
1747 inferred type and has no component references, the associate
1748 name should have its typespec. Simplify the conversion of a
1749 class array to class scalar by calling 'gfc_change_class'.
1750 Make sure that a class, inferred type selector with an array
1751 ref transfers the typespec from the symbol to the expression.
1752 * symbol.cc (gfc_set_default_type): If an associate name with
1753 unknown type has a selector expression, try resolving the expr.
1754 (find_derived_types, gfc_find_derived_types): New functions
1755 that search for a derived type with a given name.
1756 * trans-expr.cc (gfc_conv_variable): Some inferred type exprs
1757 escape resolution so call 'gfc_fixup_inferred_type_refs'.
1758 * trans-stmt.cc (trans_associate_var): Tidy up expression for
1759 'class_target'. Finalize and free class function results.
1760 Correctly handle selectors that are class functions and class
1761 array references, passed as derived types.
1763 2024-03-14 Thomas Schwinge <thomas@codesourcery.com>
1765 * dump-parse-tree.cc (show_omp_clauses): Handle 'self_expr'.
1766 * openmp.cc (gfc_free_omp_clauses): Likewise.
1767 * trans-openmp.cc (gfc_split_omp_clauses): Don't handle 'self_expr'.
1769 2024-03-14 Chung-Lin Tang <cltang@baylibre.com>
1771 * dump-parse-tree.cc (show_omp_namelist): Print "readonly," for
1772 OMP_LIST_MAP and OMP_LIST_CACHE if n->u.map.readonly is set.
1773 Adjust 'n->u.map_op' to 'n->u.map.op'.
1774 * gfortran.h (typedef struct gfc_omp_namelist): Adjust map_op as
1775 'ENUM_BITFIELD (gfc_omp_map_op) op:8', add 'bool readonly' field,
1776 change to named struct field 'map'.
1777 * openmp.cc (gfc_match_omp_map_clause): Adjust 'n->u.map_op' to
1779 (gfc_match_omp_clause_reduction): Likewise.
1780 (gfc_match_omp_clauses): Add readonly modifier parsing for OpenACC
1781 copyin clause, set 'n->u.map.op' and 'n->u.map.readonly' for parsed
1782 clause. Adjust 'n->u.map_op' to 'n->u.map.op'.
1783 (gfc_match_oacc_declare): Adjust 'n->u.map_op' to 'n->u.map.op'.
1784 (gfc_match_oacc_cache): Add readonly modifier parsing for OpenACC
1786 (resolve_omp_clauses): Adjust 'n->u.map_op' to 'n->u.map.op'.
1787 * trans-decl.cc (add_clause): Adjust 'n->u.map_op' to 'n->u.map.op'.
1788 (finish_oacc_declare): Likewise.
1789 * trans-openmp.cc (gfc_trans_omp_clauses): Set OMP_CLAUSE_MAP_READONLY,
1790 OMP_CLAUSE__CACHE__READONLY to 1 when readonly is set. Adjust
1791 'n->u.map_op' to 'n->u.map.op'.
1792 (gfc_add_clause_implicitly): Adjust 'n->u.map_op' to 'n->u.map.op'.
1794 2024-03-13 Harald Anlauf <anlauf@gmx.de>
1797 * expr.cc (gfc_is_simply_contiguous): Adjust logic so that CLASS
1798 symbols are also handled.
1800 2024-03-13 Tobias Burnus <tburnus@baylibre.com>
1803 * trans-openmp.cc (gfc_omp_predetermined_mapping): Map dummy
1804 procedures as firstprivate.
1806 2024-03-12 Harald Anlauf <anlauf@gmx.de>
1809 * array.cc (gfc_array_dimen_size): When walking the ref chain of an
1810 array and the ultimate component is a procedure pointer, do not try
1811 to figure out its dimension even if it is a array-valued function.
1813 2024-03-06 Harald Anlauf <anlauf@gmx.de>
1817 * arith.cc (is_hard_arith_error): New helper function to determine
1818 whether an arithmetic error is "hard" or not.
1819 (check_result): Use it.
1820 (gfc_arith_divide): Set "Division by zero" only for regular
1821 numerators of real and complex divisions.
1822 (reduce_unary): Use is_hard_arith_error to determine whether a hard
1823 or (recoverable) soft error was encountered. Terminate immediately
1824 on hard error, otherwise remember code of first soft error.
1825 (reduce_binary_ac): Likewise.
1826 (reduce_binary_ca): Likewise.
1827 (reduce_binary_aa): Likewise.
1829 2024-03-01 Harald Anlauf <anlauf@gmx.de>
1832 * check.cc (gfc_check_null): Handle nested NULL()s.
1833 (is_c_interoperable): Check for MOLD argument of NULL() as part of
1834 the interoperability check.
1835 * interface.cc (gfc_compare_actual_formal): Extend checks for NULL()
1836 actual arguments for presence of MOLD argument when required by
1839 2024-02-29 Alexander Westbrooks <alexanderw@gcc.gnu.org>
1844 * decl.cc (gfc_get_pdt_instance): Set the PDT instance field
1845 'f2k_derived', if not set already, to point to the given
1846 PDT template 'f2k_derived' namespace in order to give the
1847 PDT instance referential access to the typebound procedures
1849 * gfortran.h (gfc_pdt_is_instance_of): Add prototype.
1850 * resolve.cc (resolve_typebound_procedure): If the derived type
1851 does not have the attribute 'pdt_template' set, compare the
1852 dummy argument to the 'resolve_bindings_derived' type like usual.
1853 If the derived type is a 'pdt_template', then check if the
1854 dummy argument is an instance of the PDT template. If the derived
1855 type is a PDT template, and the dummy argument is an instance of
1856 that template, but the dummy argument 'param_list' is not
1857 SPEC_ASSUMED, check if there are any LEN parameters in the
1858 dummy argument. If there are no LEN parameters, then this implies
1859 that there are only KIND parameters in the dummy argument.
1860 If there are LEN parameters, this would be an error, for all
1861 LEN parameters for the dummy argument MUST be assumed for
1862 typebound procedures of PDTs.
1863 (resolve_pdt): Add a check for ALLOCATABLE and POINTER attributes for
1864 SPEC_DEFERRED parameters of PDT class symbols. ALLOCATABLE and
1865 POINTER attributes for a PDT class symbol are stored in the
1866 'class_pointer' and 'allocatable' attributes of the '_data'
1867 component respectively.
1868 * symbol.cc (gfc_pdt_is_instance_of): New function.
1870 2024-02-26 Harald Anlauf <anlauf@gmx.de>
1873 * trans-expr.cc (gfc_conv_procedure_call): Evaluate non-trivial
1874 arguments just once before assigning to an unlimited polymorphic
1877 2024-02-23 Steve Kargl <kargl@gcc.gnu.org>
1878 Harald Anlauf <anlauf@gmx.de>
1881 * trans-stmt.cc (gfc_trans_allocate): When a source expression has
1882 substring references, part-refs, or %re/%im inquiries, wrap the
1883 entity in parentheses to force evaluation of the expression.
1885 2024-02-23 Tobias Burnus <tburnus@baylibre.com>
1887 * openmp.cc (gfc_match_omp_depobj): Use OPT_Wopenmp
1888 as warning category in gfc_warning.
1890 2024-02-20 Peter Hill <peter.hill@york.ac.uk>
1893 * trans-expr.cc (gfc_conv_intrinsic_to_class): When passing an
1894 array component reference of intrinsic type to a procedure
1895 with an unlimited polymorphic dummy argument, a temporary
1898 2024-02-17 Jakub Jelinek <jakub@redhat.com>
1901 * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Don't
1902 overwrite expr2->ts.u.cl->backend_decl, instead set size to
1903 expr2->ts.u.cl->backend_decl first and use size instead of
1904 expr2->ts.u.cl->backend_decl.
1905 (gfc_trans_subcomponent_assign): Emit se.pre into block
1906 before calling alloc_scalar_allocatable_subcomponent instead of
1909 2024-02-17 Harald Anlauf <anlauf@gmx.de>
1912 * trans-array.cc (gfc_trans_deferred_array): Do not clobber
1913 deferred length for a character variable passed as dummy argument.
1915 2024-02-15 Kwok Cheung Yeung <kcyeung@baylibre.com>
1917 * dump-parse-tree.cc (show_attr): Handle omp_declare_target_indirect
1919 * f95-lang.cc (gfc_gnu_attributes): Add entry for 'omp declare
1921 * gfortran.h (symbol_attribute): Add omp_declare_target_indirect
1923 (struct gfc_omp_clauses): Add indirect field.
1924 * openmp.cc (omp_mask2): Add OMP_CLAUSE_INDIRECT.
1925 (gfc_match_omp_clauses): Match indirect clause.
1926 (OMP_DECLARE_TARGET_CLAUSES): Add OMP_CLAUSE_INDIRECT.
1927 (gfc_match_omp_declare_target): Check omp_device_type and apply
1928 omp_declare_target_indirect attribute to symbol if indirect clause
1929 active. Show warning if there are only device_type and/or indirect
1930 clauses on the directive.
1931 * trans-decl.cc (add_attributes_to_decl): Add 'omp declare target
1932 indirect' attribute if symbol has indirect attribute set.
1934 2024-02-14 Steve Kargl <kargl@gcc.gnu.org>
1937 * trans-io.cc (transfer_namelist_element): When building the
1938 namelist object name, if the use rename attribute is set, use
1939 the local name specified in the use statement.
1941 2024-02-14 Jakub Jelinek <jakub@redhat.com>
1943 * error.cc (error_print): For u printing of ptrdiff_t,
1944 print ptrdiff_t argument converted to unsigned long long and
1945 masked with 2ULL * PTRDIFF_MAX + 1.
1947 2024-02-13 Tobias Burnus <tburnus@baylibre.com>
1949 PR middle-end/113904
1950 * trans-openmp.cc (gfc_trans_omp_declare_variant): Handle splitting of
1951 OMP_TRAIT_PROPERTY_EXPR into OMP_TRAIT_PROPERTY_{DEV_NUM,BOOL}_EXPR.
1952 * openmp.cc (gfc_match_omp_context_selector): Likewise; rejects
1953 non-const device_num/condition; improve diagnostic.
1955 2024-02-13 Harald Anlauf <anlauf@gmx.de>
1958 * trans-expr.cc (gfc_conv_procedure_call): When passing an optional
1959 dummy argument to an optional dummy argument of a bind(c) procedure
1960 and the dummy argument is passed via a CFI descriptor, no special
1961 presence check and passing of a default NULL pointer is needed.
1963 2024-02-13 Steve Kargl <kargl@gcc.gnu.org>
1966 * trans-array.cc (gfc_trans_deferred_array): Set length to zero,
1967 avoiding extraneous diagnostics.
1969 2024-02-10 Jakub Jelinek <jakub@redhat.com>
1971 * error.cc (error_print): Handle z and t modifiers on d, i and u.
1972 * check.cc (gfc_check_transfer): Use %zd instead of %ld and casts to
1974 * primary.cc (gfc_convert_to_structure_constructor): Use %td instead
1975 of %ld and casts to long.
1977 2024-02-10 Jakub Jelinek <jakub@redhat.com>
1979 * trans-common.cc (build_common_decl): Use %wu instead of %lu and
1980 casts to unsigned long.
1981 * resolve.cc (resolve_ordinary_assign): Use %wd instead of %ld and
1983 * array.cc (gfc_resolve_character_array_constructor): Likewise.
1984 * data.cc (create_character_initializer): Likewise.
1986 2024-02-09 Harald Anlauf <anlauf@gmx.de>
1989 * arith.cc (reduce_unary): Remember any overflow encountered during
1990 reduction of unary arithmetic operations on array constructors and
1991 continue, and return error status, but terminate on serious errors.
1993 2024-01-28 Harald Anlauf <anlauf@gmx.de>
1996 * trans-expr.cc (conv_dummy_value): Treat NULL actual argument to
1997 optional dummy with the VALUE attribute as not present.
1998 (gfc_conv_procedure_call): Likewise.
2000 2024-01-27 Harald Anlauf <anlauf@gmx.de>
2003 * trans-array.cc (gfc_conv_array_ref): Restrict use of transformed
2004 descriptor (sym->backend_decl) to the unlimited polymorphic case.
2006 2024-01-24 Harald Anlauf <anlauf@gmx.de>
2009 * trans-expr.cc (conv_dummy_value): New.
2010 (gfc_conv_procedure_call): Factor code for handling dummy arguments
2011 with the VALUE attribute in the scalar case into conv_dummy_value().
2012 Reuse and adjust for calling elemental procedures.
2014 2024-01-21 Harald Anlauf <anlauf@gmx.de>
2017 * trans-expr.cc (gfc_conv_procedure_call): Fix handling of optional
2018 scalar arguments of intrinsic type with the VALUE attribute.
2020 2024-01-20 Mikael Morin <mikael@gcc.gnu.org>
2024 * parse.cc: Restore current interface to its previous value on error.
2026 2024-01-19 Harald Anlauf <anlauf@gmx.de>
2029 * trans-array.cc (array_bound_check_elemental): Array bounds check
2030 shall apply here to elemental dimensions of an array section only.
2032 2024-01-13 Harald Anlauf <anlauf@gmx.de>
2035 * trans-intrinsic.cc (gfc_conv_intrinsic_ishftc): Handle optional
2036 dummy argument for SIZE passed to ISHFTC. Set default value to
2037 BIT_SIZE(I) when missing.
2039 2024-01-13 Harald Anlauf <anlauf@gmx.de>
2042 * gfortran.h (gfc_loop_annot): New.
2043 (gfc_iterator, gfc_forall_iterator): Use for annotation control.
2044 * array.cc (gfc_copy_iterator): Adjust.
2045 * gfortran.texi: Document annotations IVDEP, UNROLL n, VECTOR,
2046 NOVECTOR as applied to DO CONCURRENT.
2047 * parse.cc (parse_do_block): Parse annotations IVDEP, UNROLL n,
2048 VECTOR, NOVECTOR as applied to DO CONCURRENT. Apply UNROLL only to
2049 first loop control variable.
2050 * trans-stmt.cc (iter_info): Use gfc_loop_annot.
2051 (gfc_trans_simple_do): Adjust.
2052 (gfc_trans_forall_loop): Annotate loops with IVDEP, UNROLL n,
2053 VECTOR, NOVECTOR as needed for DO CONCURRENT.
2054 (gfc_trans_forall_1): Handle loop annotations.
2056 2024-01-08 Harald Anlauf <anlauf@gmx.de>
2059 * trans-intrinsic.cc (gfc_conv_intrinsic_size): Use
2060 gfc_conv_expr_present() for proper check of optional DIM argument.
2062 2024-01-06 Harald Anlauf <anlauf@gmx.de>
2063 José Rui Faustino de Sousa <jrfsousa@gmail.com>
2066 * iresolve.cc (gfc_resolve_repeat): Force conversion to
2067 gfc_charlen_int_kind before call to gfc_multiply.
2069 2024-01-04 David Malcolm <dmalcolm@redhat.com>
2071 * lang.opt.urls: New file, autogenerated by
2072 regenerate-opt-urls.py.
2074 2024-01-03 Harald Anlauf <anlauf@gmx.de>
2076 * trans-types.cc (gfc_get_nodesc_array_type): Clear used gmp
2079 2024-01-03 Jakub Jelinek <jakub@redhat.com>
2081 * gfortranspec.cc (lang_specific_driver): Update copyright notice
2083 * gfc-internals.texi: Bump @copying's copyright year.
2084 * gfortran.texi: Ditto.
2085 * intrinsic.texi: Ditto.
2086 * invoke.texi: Ditto.
2089 Copyright (C) 2024 Free Software Foundation, Inc.
2091 Copying and distribution of this file, with or without modification,
2092 are permitted in any medium without royalty provided the copyright
2093 notice and this notice are preserved.