1 2025-02-04 Thomas Koenig <tkoenig@gcc.gnu.org>
3 * arith.cc (arith_power): Handle modular arithmetic for
5 (eval_intrinsic): Error for unsigned exponentiation with
7 * expr.cc (gfc_type_convert_binary): Use type of first
8 argument for unsigned exponentiation.
9 * gfortran.texi: Mention arithmetic exponentiation.
10 * resolve.cc (resolve_operator): Allow unsigned exponentiation.
11 * trans-decl.cc (gfc_build_intrinsic_function_decls): Build
12 declarations for unsigned exponentiation.
13 * trans-expr.cc (gfc_conv_cst_uint_power): New function.
14 (gfc_conv_power_op): Call it. Handle unsigned exponentiation.
15 * trans.h (gfor_fndecl_unsigned_pow_list): Add declaration.
17 2025-02-03 Harald Anlauf <anlauf@gmx.de>
20 * decl.cc (gfc_set_constant_character_len): Downgrade different
21 string lengths in character array constructor to legacy extension.
23 2025-01-31 Harald Anlauf <anlauf@gmx.de>
26 * resolve.cc (resolve_common_blocks): Initialize variable.
27 (resolve_symbol): If a symbol is already registered with a COMMON
28 block, do not search for an interface with the same name.
30 2025-01-31 Paul-Antoine Arras <parras@baylibre.com>
33 * parse.cc (parse_omp_dispatch): Add missing pop_state.
35 2025-01-30 Sandra Loosemore <sloosemore@baylibre.com>
36 Kwok Cheung Yeung <kcy@codesourcery.com>
37 Sandra Loosemore <sandra@codesourcery.com>
38 Tobias Burnus <tobias@codesourcery.com>
39 Paul-Antoine Arras <pa@codesourcery.com>
43 * decl.cc (gfc_match_end): Handle COMP_OMP_BEGIN_METADIRECTIVE and
44 COMP_OMP_METADIRECTIVE.
45 * dump-parse-tree.cc (show_omp_node): Handle EXEC_OMP_METADIRECTIVE.
46 (show_code_node): Likewise.
47 * gfortran.h (enum gfc_statement): Add ST_OMP_METADIRECTIVE,
48 ST_OMP_BEGIN_METADIRECTIVE, and ST_OMP_END_METADIRECTIVE.
49 (struct gfc_omp_clauses): Rename target_first_st_is_teams to
50 target_first_st_is_teams_or_meta.
51 (struct gfc_omp_variant): New.
52 (gfc_get_omp_variant): New.
53 (struct gfc_st_label): Add omp_region field.
54 (enum gfc_exec_op): Add EXEC_OMP_METADIRECTIVE.
55 (struct gfc_code): Add omp_variants fields.
56 (gfc_free_omp_variants): Declare.
57 (match_omp_directive): Declare.
58 (is_omp_declarative_stmt): Declare.
59 * io.cc (format_asterisk): Adjust initializer.
60 * match.h (gfc_match_omp_begin_metadirective): Declare.
61 (gfc_match_omp_metadirective): Declare.
62 * openmp.cc (gfc_omp_directives): Uncomment metadirective.
63 (gfc_match_omp_eos): Adjust to match context selectors.
64 (gfc_free_omp_variants): New.
65 (gfc_match_omp_clauses): Remove context_selector parameter and adjust
66 to use gfc_match_omp_eos instead.
67 (match_omp): Adjust call to gfc_match_omp_clauses.
68 (gfc_match_omp_context_selector): Add metadirective_p parameter and
69 adjust error-checking. Adjust matching of simd clauses.
70 (gfc_match_omp_context_selector_specification): Adjust parameters
71 so it can be used for metadirective as well as declare variant.
72 (match_omp_metadirective): New.
73 (gfc_match_omp_begin_metadirective): New.
74 (gfc_match_omp_metadirective): New.
75 (resolve_omp_metadirective): New.
76 (resolve_omp_target): Handle metadirectives.
77 (gfc_resolve_omp_directive): Handle EXEC_OMP_METADIRECTIVE.
78 * parse.cc (gfc_matching_omp_context_selector): New.
79 (gfc_in_omp_metadirective_body): New.
80 (gfc_omp_region_count): New.
81 (decode_omp_directive): Handle ST_OMP_BEGIN_METADIRECTIVE and
83 (match_omp_directive): New.
84 (case_omp_structured_block): Define.
85 (case_omp_do): Define.
86 (gfc_ascii_statement): Handle ST_OMP_BEGIN_METADIRECTIVE,
87 ST_OMP_END_METADIRECTIVE, and ST_OMP_METADIRECTIVE.
88 (accept_statement): Handle ST_OMP_METADIRECTIVE and
89 ST_OMP_BEGIN_METADIRECTIVE.
90 (gfc_omp_end_stmt): New, split from...
91 (parse_omp_do): ...here, and...
92 (parse_omp_structured_block): ...here. Handle metadirectives,
93 plus "allocate", "atomic", and "dispatch" which were missing.
94 (parse_omp_oacc_atomic): Handle "end metadirective".
95 (parse_openmp_allocate_block): Likewise.
96 (parse_omp_dispatch): Likewise.
97 (parse_omp_metadirective_body): New.
98 (parse_executable): Handle metadirective. Use new case macros
100 (gfc_parse_file): Initialize metadirective state.
101 (is_omp_declarative_stmt): New.
102 * parse.h (enum gfc_compile_state): Add COMP_OMP_METADIRECTIVE
103 and COMP_OMP_BEGIN_METADIRECTIVE.
104 (gfc_omp_end_stmt): Declare.
105 (gfc_matching_omp_context_selector): Declare.
106 (gfc_in_omp_metadirective_body): Declare.
107 (gfc_omp_metadirective_region_count): Declare.
108 * resolve.cc (gfc_resolve_code): Handle EXEC_OMP_METADIRECTIVE.
109 * st.cc (gfc_free_statement): Likewise.
110 * symbol.cc (compare_st_labels): Handle labels within a metadirective
112 (gfc_get_st_label): Likewise.
113 * trans-decl.cc (gfc_get_label_decl): Encode the metadirective region
115 * trans-openmp.cc (gfc_trans_omp_directive): Handle
116 EXEC_OMP_METADIRECTIVE.
117 (gfc_trans_omp_set_selector): New, split/adapted from code....
118 (gfc_trans_omp_declare_variant): ...here.
119 (gfc_trans_omp_metadirective): New.
120 * trans-stmt.h (gfc_trans_omp_metadirective): Declare.
121 * trans.cc (trans_code): Handle EXEC_OMP_METADIRECTIVE.
123 2025-01-30 Tobias Burnus <tburnus@baylibre.com>
125 * gfortran.h (gfc_omp_declare_variant): Add append_args_list.
126 * openmp.cc (gfc_parser_omp_clause_init_modifiers): New;
128 (gfc_match_omp_init): ... here; call it.
129 (gfc_match_omp_declare_variant): Update to handle append_args
130 clause; some syntax handling fixes.
131 * trans-openmp.cc (gfc_trans_omp_declare_variant): Handle
132 append_args clause; add some diagnostic.
134 2025-01-29 Harald Anlauf <anlauf@gmx.de>
137 * trans-expr.cc (gfc_conv_procedure_call): The bounds update for
138 passing to assumed-rank dummies shall also handle component
139 references besides inquiry references.
141 2025-01-27 Harald Anlauf <anlauf@gmx.de>
144 * frontend-passes.cc (check_externals_procedure): Do not compare
145 interfaces of a non-bind(C) procedure against a bind(C) global one.
146 (check_against_globals): Use local name from rename-on-use in the
147 search for interfaces.
149 2025-01-27 Paul Thomas <pault@gcc.gnu.org>
152 * resolve.cc (generate_component_assignments): Make sure that
153 the rhs temporary does not pick up the optional attribute from
156 2025-01-26 Tobias Burnus <tburnus@baylibre.com>
158 * openmp.cc (gfc_omp_directives): Uncomment unroll and tile lines
159 as the directives are by now implemented.
161 2025-01-26 Sandra Loosemore <sloosemore@baylibre.com>
163 * openmp.cc (resolve_omp_atomic): Fix typo in error message.
165 2025-01-25 Harald Anlauf <anlauf@gmx.de>
168 * class.cc (gfc_find_derived_vtab): Declare some frontend generated
169 variables and procedures (_vtab, _copy, _deallocate) as artificial.
170 (find_intrinsic_vtab): Likewise.
171 * trans-decl.cc (check_block_data_decls): New helper function.
172 (gfc_generate_block_data): Use it to emit warnings for variables
173 declared in a BLOCK DATA program unit but not in a COMMON block.
175 2025-01-23 Harald Anlauf <anlauf@gmx.de>
178 * trans-intrinsic.cc (gfc_conv_intrinsic_minmaxval): Adjust algorithm
179 for inlined version of MINLOC and MAXLOC so that arguments are only
180 evaluted once, and create temporaries where necessary. Document
183 2025-01-23 Paul Thomas <pault@gcc.gnu.org>
186 * trans-decl.cc (gfc_get_symbol_decl): If a dummy is missing a
187 backend decl, it is likely that it has come from a module proc
188 interface. Look for the formal symbol by name in the containing
189 proc and use its backend decl.
190 * trans-expr.cc (gfc_apply_interface_mapping_to_expr): For the
191 same reason, match the name, rather than the symbol address to
194 2025-01-20 Harald Anlauf <anlauf@gmx.de>
197 * openmp.cc (resolve_omp_clauses): Add 'with' to error message text.
199 2025-01-20 Harald Anlauf <anlauf@gmx.de>
202 * trans-array.cc (gfc_conv_array_parameter): Do not copy back data
203 if actual array parameter has the PARAMETER attribute.
204 * trans-expr.cc (gfc_conv_subref_array_arg): Likewise.
206 2025-01-16 Tobias Burnus <tburnus@baylibre.com>
209 * trans-openmp.cc (gfc_trans_omp_declare_variant): Honor hidden
210 arguments for append_arg's need_device_ptr.
212 2025-01-16 Thomas Koenig <tkoenig@gcc.gnu.org>
215 * dump-parse-tree.cc (show_external_symbol): New function.
216 (write_type): Add prototype, put in restrictions on what not to dump.
217 (has_cfi_cdesc): New function.
218 (need_iso_fortran_binding): New function.
219 (gfc_dump_c_prototypes): Adjust to take only a file output. Add
220 "#include <ISO_Fortran_binding.h" if CFI_cdesc_t is found.
221 Traverse global namespaces to dump types and the globalsymol list
222 to dump external symbols.
223 (gfc_dump_external_c_prototypes): Traverse global namespaces.
224 (get_c_type_name): Handle CFI_cdesc_t.
225 (write_proc): Also pass array spec to get_c_type_name.
226 * gfortran.h (gfc_dump_c_prototypes): Adjust prototype.
227 * parse.cc (gfc_parse_file): Adjust call to gfc_dump_c_prototypes.
229 2025-01-16 Sandra Loosemore <sloosemore@baylibre.com>
231 * openmp.cc (gfc_omp_absent_contains_clause): Use an Oxford comma
234 2025-01-16 Tobias Burnus <tburnus@baylibre.com>
237 * trans-intrinsic.cc (gfc_get_symbol_for_expr): Use
238 gfc_new_charlen for character-returning functions.
240 2025-01-15 Harald Anlauf <anlauf@gmx.de>
243 * resolve.cc (resolve_allocate_expr): Reject intrinsic NULL as
246 2025-01-14 Sandra Loosemore <sloosemore@baylibre.com>
247 Kwok Cheung Yeung <kcy@codesourcery.com>
248 Sandra Loosemore <sandra@codesourcery.com>
249 Marcel Vollweiler <marcel@codesourcery.com>
254 * trans-openmp.cc (gfc_trans_omp_declare_variant): Update for changes
255 to omp-general.h interfaces.
257 2025-01-14 Anuj Mohite <anujmohite001@gmail.com>
259 * dump-parse-tree.cc (show_code_node): Updated to use
260 c->ext.concur.forall_iterator instead of c->ext.forall_iterator.
261 * frontend-passes.cc (index_interchange): Updated to
262 use c->ext.concur.forall_iterator instead of c->ext.forall_iterator.
263 (gfc_code_walker): Likewise.
264 * gfortran.h (enum locality_type): Added new enum for locality types
265 in DO CONCURRENT constructs.
266 * match.cc (match_simple_forall): Updated to use
267 new_st.ext.concur.forall_iterator instead of new_st.ext.forall_iterator.
268 (gfc_match_forall): Likewise.
269 (gfc_match_do): Implemented support for matching DO CONCURRENT locality
270 specifiers (LOCAL, LOCAL_INIT, SHARED, DEFAULT(NONE), and REDUCE).
271 * parse.cc (parse_do_block): Updated to use
272 new_st.ext.concur.forall_iterator instead of new_st.ext.forall_iterator.
273 * resolve.cc (struct check_default_none_data): Added struct
274 check_default_none_data.
275 (do_concur_locality_specs_f2023): New function to check compliance
276 with F2023's C1133 constraint for DO CONCURRENT.
277 (check_default_none_expr): New function to check DEFAULT(NONE)
279 (resolve_locality_spec): New function to resolve locality specs.
280 (gfc_count_forall_iterators): Updated to use
281 code->ext.concur.forall_iterator.
282 (gfc_resolve_forall): Updated to use code->ext.concur.forall_iterator.
283 * st.cc (gfc_free_statement): Updated to free locality specifications
284 and use p->ext.concur.forall_iterator.
285 * trans-stmt.cc (gfc_trans_forall_1): Updated to use
286 code->ext.concur.forall_iterator.
288 2025-01-13 Thomas Koenig <tkoenig@gcc.gnu.org>
290 * dump-parse-tree.cc (show_attr): Fix typos for in_equivalence.
292 2025-01-13 Paul-Antoine Arras <parras@baylibre.com>
294 * openmp.cc (gfc_match_omp_declare_variant): Match comma after directive
295 name and between clauses. Emit more useful diagnostics.
297 2025-01-12 Thomas Koenig <tkoenig@gcc.gnu.org>
299 * dump-parse-tree.cc (show_attr): Dump all symbol attributes.
301 2025-01-12 Harald Anlauf <anlauf@gmx.de>
304 * check.cc (gfc_check_out_of_range): Check arguments to intrinsic.
305 * expr.cc (free_expr0): Fix a memleak with unsigned literals.
306 * gfortran.h (enum gfc_isym_id): Define GFC_ISYM_OUT_OF_RANGE.
307 * gfortran.texi: Add OUT_OF_RANGE to list of intrinsics supporting
309 * intrinsic.cc (add_functions): Add Fortran prototype. Break some
310 nearby lines with excessive length.
311 * intrinsic.h (gfc_check_out_of_range): Add prototypes.
312 * intrinsic.texi: Fortran documentation of OUT_OF_RANGE.
313 * simplify.cc (gfc_simplify_out_of_range): Compile-time simplification
315 * trans-intrinsic.cc (gfc_conv_intrinsic_out_of_range): Generate
316 inline expansion of runtime code for OUT_OF_RANGE.
317 (gfc_conv_intrinsic_function): Use it.
319 2025-01-12 Thomas Koenig <tkoenig@gcc.gnu.org>
322 * frontend-passes.cc (doloop_code): Select correct member
323 of co->ext.union for inquire.
325 2025-01-11 Tobias Burnus <tburnus@baylibre.com>
327 * gfortran.h: Add OMP_LIST_INTEROP to the unnamed OMP_LIST_ enum.
328 * openmp.cc (gfc_match_omp_variable_list): Add reverse_order
329 boolean argument, defaulting to false.
330 (enum omp_mask2, OMP_DISPATCH_CLAUSES): Add OMP_CLAUSE_INTEROP.
331 (gfc_match_omp_clauses, resolve_omp_clauses): Handle dispatch's
333 * trans-decl.cc (gfc_get_extern_function_decl): Use sym->declared_at
334 instead input_location as DECL_SOURCE_LOCATION.
335 * trans-openmp.cc (gfc_trans_omp_clauses): Handle OMP_LIST_INTEROP.
337 2025-01-11 Paul Thomas <pault@gcc.gnu.org>
340 * class.cc (generate_finalization_wrapper): To avoid memory
341 leaks from callocs, return immediately if the derived type
343 * decl.cc (build_struct): If the declaration of a derived type
344 or class component does not have a deferred arrayspec, correct,
345 set the error flag of the derived type and emit an immediate
348 2025-01-10 Jakub Jelinek <jakub@redhat.com>
351 * module.cc (use_iso_fortran_env_module): Add a comment explaining
352 the optimization performed. Add gcc_checking_assert that i was
353 incremented for all the elements. Formatting fix.
355 2025-01-09 Andre Vehreschild <vehre@gcc.gnu.org>
358 * resolve.cc (resolve_fl_derived0): Exempt vtypes from cycle
361 2025-01-09 Jakub Jelinek <jakub@redhat.com>
364 * module.cc (COMPAT_MOD_VERSIONS): Define.
365 (use_iso_fortran_env_module): Don't assume all NAMED_INTCSTs come
366 first followed by NAMED_UINTCSTs.
367 (gfc_use_module): Accept also COMPAT_MOD_VERSIONS for compatibility.
368 * iso-c-binding.def: Reorder entries so that the GCC 14 ones come
369 before the ones new in GCC 15.
370 * iso-fortran-env.def: Likewise.
372 2025-01-09 Tobias Burnus <tburnus@baylibre.com>
374 * types.def (BT_FN_PTRMODE_PTR_INT_PTR): Add.
376 2025-01-08 Jakub Jelinek <jakub@redhat.com>
379 * module.cc (MOD_VERSION): Bump to "16".
381 2025-01-07 Thomas Koenig <tkoenig@gcc.gnu.org>
383 * intrinsic.texi (ISO_FORTRAN_ENV): Also mention INT8 in the
384 text. Document UINT8, UINT16, UINT32 and UINT64.
385 (ISO_C_BINDING): New table for unsigned KIND numbers.
387 2025-01-07 Andre Vehreschild <vehre@gcc.gnu.org>
390 * trans-array.cc (structure_alloc_comps): Ensure deep copy is
391 also done for types having cycles.
393 2025-01-07 Andre Vehreschild <vehre@gcc.gnu.org>
396 * class.cc (gfc_find_derived_vtab): Use attr to determine cyclic
398 * expr.cc (gfc_has_default_initializer): Prevent endless
399 recursion by storing already visited derived types.
400 * resolve.cc (resolve_cyclic_derived_type): Determine if a type
401 is used in its hierarchy in a cyclic way.
402 (resolve_fl_derived0): Call resolve_cyclic_derived_type.
403 (resolve_fl_derived): Ensure vtab is generated when cyclic
404 derived types have allocatable components.
405 * trans-array.cc (structure_alloc_comps): Prevent endless loop
406 for derived type cycles.
407 * trans-expr.cc (gfc_get_ultimate_alloc_ptr_comps_caf_token):
408 Off topic, just prevent memory leaks.
410 2025-01-03 Thomas Koenig <tkoenig@gcc.gnu.org>
412 * gfortran.texi: New subsection "Generating C prototypes from
415 2025-01-03 Harald Anlauf <anlauf@gmx.de>
418 * trans-expr.cc (gfc_conv_expr_op): Inhibit excessive optimization
419 of Cray pointers by treating them as volatile in comparisons.
421 2025-01-03 Sandra Loosemore <sloosemore@baylibre.com>
423 * intrinsic.texi (ATAN): Add missing verb.
425 2025-01-02 Tobias Burnus <tburnus@baylibre.com>
427 * openmp.cc (OMP_DISPATCH_CLAUSES): Add OMP_CLAUSE_HAS_DEVICE_ADDR.
429 2025-01-02 Paul-Antoine Arras <parras@baylibre.com>
431 * dump-parse-tree.cc (show_omp_clauses): Handle novariants and nocontext
433 (show_omp_node): Handle EXEC_OMP_DISPATCH.
434 (show_code_node): Likewise.
435 * frontend-passes.cc (gfc_code_walker): Handle novariants and nocontext.
436 * gfortran.h (enum gfc_statement): Add ST_OMP_DISPATCH.
437 (symbol_attribute): Add omp_declare_variant_need_device_ptr.
438 (gfc_omp_clauses): Add novariants and nocontext.
439 (gfc_omp_declare_variant): Add need_device_ptr_arg_list.
440 (enum gfc_exec_op): Add EXEC_OMP_DISPATCH.
441 * match.h (gfc_match_omp_dispatch): Declare.
442 * openmp.cc (gfc_free_omp_clauses): Free novariants and nocontext
444 (gfc_free_omp_declare_variant_list): Free need_device_ptr_arg_list
446 (enum omp_mask2): Add OMP_CLAUSE_NOVARIANTS and OMP_CLAUSE_NOCONTEXT.
447 (gfc_match_omp_clauses): Handle OMP_CLAUSE_NOVARIANTS and
448 OMP_CLAUSE_NOCONTEXT.
449 (OMP_DISPATCH_CLAUSES): Define.
450 (gfc_match_omp_dispatch): New function.
451 (gfc_match_omp_declare_variant): Parse adjust_args.
452 (resolve_omp_clauses): Handle adjust_args, novariants and nocontext.
453 Adjust handling of OMP_LIST_IS_DEVICE_PTR.
454 (icode_code_error_callback): Handle EXEC_OMP_DISPATCH.
455 (omp_code_to_statement): Likewise.
456 (resolve_omp_dispatch): New function.
457 (gfc_resolve_omp_directive): Handle EXEC_OMP_DISPATCH.
458 * parse.cc (decode_omp_directive): Match dispatch.
459 (next_statement): Handle ST_OMP_DISPATCH.
460 (gfc_ascii_statement): Likewise.
461 (parse_omp_dispatch): New function.
462 (parse_executable): Handle ST_OMP_DISPATCH.
463 * resolve.cc (gfc_resolve_blocks): Handle EXEC_OMP_DISPATCH.
464 * st.cc (gfc_free_statement): Likewise.
465 * trans-decl.cc (create_function_arglist): Declare.
466 (gfc_get_extern_function_decl): Call it.
467 * trans-openmp.cc (gfc_trans_omp_clauses): Handle novariants and
469 (replace_omp_dispatch_call): New function.
470 (gfc_trans_omp_dispatch): New function.
471 (gfc_trans_omp_directive): Handle EXEC_OMP_DISPATCH.
472 (gfc_trans_omp_declare_variant): Handle adjust_args.
473 * trans.cc (trans_code): Handle EXEC_OMP_DISPATCH:.
475 2025-01-02 Jakub Jelinek <jakub@redhat.com>
477 * gfortranspec.cc (lang_specific_driver): Update copyright notice
479 * gfc-internals.texi: Bump @copying's copyright year.
480 * gfortran.texi: Ditto.
481 * intrinsic.texi: Ditto.
482 * invoke.texi: Ditto.
484 2025-01-01 Sandra Loosemore <sloosemore@baylibre.com>
486 * gfortran.texi (Function ABI Documentation): Make menu ordering
487 consistent with subsection ordering.
489 2025-01-01 Sandra Loosemore <sloosemore@baylibre.com>
491 * gfortran.texi: Clean up that/which usage throughout the file.
492 * intrinsic.texi: Likewise.
493 * invoke.texi: Likewise.
495 2025-01-01 Sandra Loosemore <sloosemore@baylibre.com>
497 * intrinsic.texi: Grammar and markup fixes throughout
500 Copyright (C) 2025 Free Software Foundation, Inc.
502 Copying and distribution of this file, with or without modification,
503 are permitted in any medium without royalty provided the copyright
504 notice and this notice are preserved.