1 2023-12-19 Sandra Loosemore <sandra@codesourcery.com>
3 * gfortran.h: Include omp-selectors.h.
4 (enum gfc_omp_trait_property_kind): Delete, and replace all
5 references with equivalent omp_tp_type enumerators.
6 (struct gfc_omp_trait_property): Update for omp_tp_type.
7 (struct gfc_omp_selector): Replace string name with new enumerator.
8 (struct gfc_omp_set_selector): Likewise.
9 * openmp.cc (gfc_free_omp_trait_property_list): Update for
11 (omp_construct_selectors): Delete.
12 (omp_device_selectors): Delete.
13 (omp_implementation_selectors): Delete.
14 (omp_user_selectors): Delete.
15 (gfc_ignore_trait_property_extension): New.
16 (gfc_ignore_trait_property_extension_list): New.
17 (gfc_match_omp_selector): Adjust for new representations and simplify
18 dispatch logic. Uniformly warn instead of sometimes error when an
19 unknown selector is found.
20 (gfc_match_omp_context_selector): Adjust for new representations.
21 Adjust error messages for extraneous/incorrect score.
22 (gfc_match_omp_context_selector_specification): Likewise.
23 * trans-openmp.cc (gfc_trans_omp_declare_variant): Adjust for
26 2023-12-19 Sandra Loosemore <sandra@codesourcery.com>
28 * trans-openmp.cc (gfc_trans_omp_declare_varaint): Adjust for
29 new namelist property representation.
31 2023-12-19 Sandra Loosemore <sandra@codesourcery.com>
33 * trans-openmp.cc (gfc_trans_omp_declare_variant): Use new
36 2023-12-18 Harald Anlauf <anlauf@gmx.de>
39 * check.cc (array_size_check): New helper function.
40 (gfc_check_date_and_time): Use it for checking minimum size of
41 VALUES argument. Update kind check to Fortran 2018.
42 * intrinsic.texi: Fix documentation of DATE_AND_TIME.
44 2023-12-17 Harald Anlauf <anlauf@gmx.de>
47 * trans-expr.cc (gfc_conv_procedure_call): For a contiguous dummy
48 with the TARGET attribute, the effective argument may still be
49 contiguous even if the actual argument is not simply-contiguous.
50 Allow packing to be decided at runtime by _gfortran_internal_pack.
52 2023-12-16 Paul Thomas <pault@gcc.gnu.org>
55 * trans-array.cc (gfc_trans_array_constructor_value): Replace
56 gfc_notification_std with explicit logical expression that
57 selects F2003/2008 and excludes -std=default/gnu.
58 * trans-expr.cc (gfc_conv_expr): Ditto.
60 2023-12-16 Paul Thomas <pault@gcc.gnu.org>
64 * match.cc (build_associate_name): Fix whitespace issues.
65 (select_type_set_tmp): If the selector is of unknown type, go
66 the SELECT TYPE selector to see if this is a function and, if
67 the result is available, use its typespec.
68 * parse.cc (parse_associate): Again, use the function result if
69 the type of the selector result is unknown.
70 * trans-stmt.cc (trans_associate_var): The expression has to be
71 of type class, for class_target to be true. Convert and fix
72 class functions. Pass the fixed expression.
73 * resolve.cc (gfc_expression_rank): Avoid null dereference.
75 2023-12-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
78 * intrinsic.texi: Fix where no COMPLEX allowed.
79 * invoke.texi: Clarify -fdev-math.
81 2023-12-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
84 * gfortran.texi: Update to reflect the changes.
85 * intrinsic.cc (add_functions): Update the standard that the
86 various degree trigonometric functions have been described in.
87 (gfc_check_intrinsic_standard): Add an error string for F2023.
88 * intrinsic.texi: Update accordingly.
90 2023-12-13 Julian Brown <julian@codesourcery.com>
92 * dependency.cc (gfc_omp_expr_prefix_same): New function.
93 * dependency.h (gfc_omp_expr_prefix_same): Add prototype.
94 * gfortran.h (gfc_omp_namelist): Add "duplicate_of" field to "u2"
96 * trans-openmp.cc (dependency.h): Include.
97 (gfc_trans_omp_array_section): Adjust mapping node arrangement for
98 array descriptors. Use GOMP_MAP_TO_PSET or
99 GOMP_MAP_RELEASE/GOMP_MAP_DELETE with the OMP_CLAUSE_RELEASE_DESCRIPTOR
101 (gfc_symbol_rooted_namelist): New function.
102 (gfc_trans_omp_clauses): Check subcomponent and subarray/element
103 accesses elsewhere in the clause list for pointers to derived types or
104 array descriptors, and adjust or drop mapping nodes appropriately.
105 Adjust for changes to mapping node arrangement.
106 (gfc_trans_oacc_executable_directive): Pass code op through.
108 2023-12-13 Julian Brown <julian@codesourcery.com>
110 * trans-openmp.cc (gfc_trans_omp_array_section): Add OPENMP parameter.
111 Use GOMP_MAP_ATTACH_DETACH instead of GOMP_MAP_ALWAYS_POINTER for
112 derived type components.
113 (gfc_trans_omp_clauses): Update calls to gfc_trans_omp_array_section.
115 2023-12-11 Thomas Schwinge <thomas@codesourcery.com>
117 * trans-openmp.cc (gfc_omp_call_is_alloc): Resolve ICE.
119 2023-12-11 Tobias Burnus <tobias@codesourcery.com>
121 * gfortran.h (enum gfc_omp_requires_kind): Add
122 OMP_REQ_ATOMIC_MEM_ORDER_ACQUIRE and OMP_REQ_ATOMIC_MEM_ORDER_RELEASE.
123 (gfc_namespace): Add a 7th bit to omp_requires.
124 * module.cc (enum ab_attribute): Add AB_OMP_REQ_MEM_ORDER_ACQUIRE
125 and AB_OMP_REQ_MEM_ORDER_RELEASE
126 (mio_symbol_attribute): Handle it.
127 * openmp.cc (gfc_omp_requires_add_clause): Update for acquire/release.
128 (gfc_match_omp_requires): Likewise.
129 (gfc_match_omp_atomic): Handle them for atomic_default_mem_order.
130 * parse.cc: Likewise.
132 2023-12-11 Tobias Burnus <tobias@codesourcery.com>
134 * trans-openmp.cc (gfc_omp_call_add_alloc,
135 gfc_omp_call_is_alloc): Set 'fn spec'.
137 2023-12-10 Harald Anlauf <anlauf@gmx.de>
140 * expr.cc (gfc_is_simply_contiguous): Determine characteristics of
141 NULL() from optional MOLD argument, otherwise treat as contiguous.
142 * primary.cc (gfc_variable_attr): Derive attributes of NULL(MOLD)
145 2023-12-10 Harald Anlauf <anlauf@gmx.de>
148 * resolve.cc (resolve_symbol): For a CLASS-valued function having a
149 RESULT clause, ensure that attr.class_ok is set for its symbol as
150 well as for its resolved result variable.
152 2023-12-08 Tobias Burnus <tobias@codesourcery.com>
154 * dump-parse-tree.cc (show_omp_node): Handle EXEC_OMP_ALLOCATE
155 and EXEC_OMP_ALLOCATORS.
156 * f95-lang.cc (ATTR_ALLOC_WARN_UNUSED_RESULT_SIZE_2_NOTHROW_LIST):
157 Add 'ECF_LEAF | ECF_MALLOC' to existing 'ECF_NOTHROW'.
158 (ATTR_ALLOC_WARN_UNUSED_RESULT_SIZE_2_NOTHROW_LEAF_LIST): Define.
159 * gfortran.h (gfc_omp_clauses): Add contained_in_target_construct.
160 * invoke.texi (-fopenacc, -fopenmp): Update based on C version.
161 (-fopenmp-simd): New, based on C version.
162 (-fopenmp-allocators): New.
163 * lang.opt (fopenmp-allocators): Add.
164 * openmp.cc (resolve_omp_clauses): For allocators/allocate directive,
165 add target and no dynamic_allocators diagnostic and more invalid
167 * parse.cc (decode_omp_directive): Set contains_teams_construct.
168 * trans-array.h (gfc_array_allocate): Update prototype.
169 (gfc_conv_descriptor_version): New prototype.
170 * trans-decl.cc (gfc_init_default_dt): Fix comment.
171 * trans-array.cc (gfc_conv_descriptor_version): New.
172 (gfc_array_allocate): Support GOMP_alloc allocation.
173 (gfc_alloc_allocatable_for_assignment, structure_alloc_comps):
174 Handle GOMP_free/omp_realloc as needed.
175 * trans-expr.cc (gfc_conv_procedure_call): Likewise.
176 (alloc_scalar_allocatable_for_assignment): Likewise.
177 * trans-intrinsic.cc (conv_intrinsic_move_alloc): Likewise.
178 * trans-openmp.cc (gfc_trans_omp_allocators,
179 gfc_trans_omp_directive): Handle allocators/allocate directive.
180 (gfc_omp_call_add_alloc, gfc_omp_call_is_alloc): New.
181 * trans-stmt.h (gfc_trans_allocate): Update prototype.
182 * trans-stmt.cc (gfc_trans_allocate): Support GOMP_alloc.
183 * trans-types.cc (gfc_get_dtype_rank_type): Set version field.
184 * trans.cc (gfc_allocate_using_malloc, gfc_allocate_allocatable):
185 Update to handle GOMP_alloc.
186 (gfc_deallocate_with_status, gfc_deallocate_scalar_with_status):
188 (trans_code): Update call.
189 * trans.h (gfc_allocate_allocatable, gfc_allocate_using_malloc):
191 (gfc_omp_call_add_alloc, gfc_omp_call_is_alloc): New prototype.
192 * types.def (BT_FN_PTR_PTR_SIZE_PTRMODE_PTRMODE): New.
194 2023-12-06 David Malcolm <dmalcolm@redhat.com>
196 * error.cc (gfc_diagnostic_starter): Make diagnostic_info param
198 (gfc_diagnostic_finalizer): Likewise.
200 2023-12-05 Harald Anlauf <anlauf@gmx.de>
201 Tobias Burnus <tobias@codesourcery.com>
204 * gfortran.h (IS_PROC_POINTER): New macro.
205 * trans-types.cc (gfc_sym_type): Use macro in determination if the
206 restrict qualifier can be used for a dummy variable. Fix logic to
207 allow the restrict qualifier also for optional arguments, and to
208 not apply it to pointer or proc_pointer arguments.
210 2023-12-05 Richard Sandiford <richard.sandiford@arm.com>
212 * f95-lang.cc (gfc_gnu_attribute_table): Add extra braces to work
213 around PR 16333 in older compilers.
215 2023-12-02 Harald Anlauf <anlauf@gmx.de>
219 * trans-array.cc (gfc_trans_deferred_array): Add presence check
220 for optional deferred-length character dummy arguments.
221 * trans-expr.cc (gfc_conv_missing_dummy): The character length for
222 deferred-length dummy arguments is passed by reference, so that
223 its value can be returned. Adjust handling for optional dummies.
225 2023-12-02 Richard Sandiford <richard.sandiford@arm.com>
227 * f95-lang.cc: Include attribs.h.
228 (gfc_attribute_table): Change to an array of scoped_attribute_specs
230 (gfc_gnu_attributes, gfc_gnu_attribute_table): ...these new globals.
232 2023-12-01 Harald Anlauf <anlauf@gmx.de>
235 * trans-expr.cc (gfc_conv_class_to_class): Make copy-out conditional
236 on the presence of an OPTIONAL CLASS argument passed to an OPTIONAL
239 2023-11-30 Harald Anlauf <anlauf@gmx.de>
242 * primary.cc (gfc_variable_attr): Set TARGET attribute of associating
243 entity dependent on TARGET or POINTER attribute of selector.
245 2023-11-28 Andrew Jenner <andrew@codesourcery.com>
246 Tobias Burnus <tobias@codesourcery.com>
249 * trans-expr.cc (trans_class_vptr_len_assignment): Add
250 from_vptrp parameter. Populate it. Don't check for DECL_P
251 when deciding whether to create temporary.
252 (trans_class_pointer_fcn, gfc_trans_pointer_assignment): Add
253 NULL argument to trans_class_vptr_len_assignment calls.
254 (trans_class_assignment): Get rhs_vptr from
255 trans_class_vptr_len_assignment and use it for determining size
256 for allocation/reallocation. Use return value from realloc.
258 2023-11-26 Harald Anlauf <anlauf@gmx.de>
261 * resolve.cc (resolve_common_vars): Do not call gfc_add_in_common
262 for symbols that are USE associated or used in a submodule.
264 2023-11-24 Tobias Burnus <tobias@codesourcery.com>
266 * lang.opt (Wopenmp): Add, enabled by dafault and documented in C.
267 * openmp.cc (gfc_match_omp_declare_target, resolve_positive_int_expr,
268 resolve_nonnegative_int_expr, resolve_omp_clauses,
269 gfc_resolve_omp_do_blocks): Use OPT_Wopenmp with gfc_warning{,_now}.
271 2023-11-24 Tobias Burnus <tobias@codesourcery.com>
273 * openmp.cc (gfc_match_omp_depobj): Accept optionally an argument
274 to the destroy clause.
276 2023-11-23 Harald Anlauf <anlauf@gmx.de>
279 * check.cc (gfc_check_system_clock): Add checks on integer arguments
280 to SYSTEM_CLOCK specific to F2023.
281 * error.cc (notify_std_msg): Adjust to handle new features added
283 * gfortran.texi (_gfortran_set_options): Document GFC_STD_F2023_DEL,
284 remove obsolete option GFC_STD_F2008_TS and fix enumeration values.
285 * libgfortran.h (GFC_STD_F2023_DEL): Add and use in GFC_STD_OPT_F23.
286 * options.cc (set_default_std_flags): Add GFC_STD_F2023_DEL.
288 2023-11-17 Tobias Burnus <tobias@codesourcery.com>
290 * gfortran.texi (_gfortran_set_options): Document GFC_STD_F2023.
291 * invoke.texi (std,pedantic,Wampersand,Wtabs): Add -std=2023.
292 * lang.opt (std=f2023): Add.
293 * libgfortran.h (GFC_STD_F2023, GFC_STD_OPT_F23): Add.
294 * options.cc (set_default_std_flags): Add GFC_STD_F2023.
295 (gfc_init_options): Set max_continue_free to 1,000,000.
296 (gfc_post_options): Set flag_free_line_length if unset.
297 (gfc_handle_option): Add OPT_std_f2023, set max_continue_free = 255
298 for -std=f2003, f2008 and f2018.
300 2023-11-14 David Malcolm <dmalcolm@redhat.com>
302 * error.cc (gfc_diagnostics_init): Use diagnostic_start_span.
304 2023-11-07 Joseph Myers <joseph@codesourcery.com>
306 * gfortran.h (gfc_real_info): Refer to C23 instead of C2X in
309 2023-11-06 Martin Jambor <mjambor@suse.cz>
311 * trans-decl.cc (gfc_build_builtin_function_decls): Fix fnspec of
314 2023-11-04 David Malcolm <dmalcolm@redhat.com>
316 * cpp.cc: Update for changes to diagnostic_context.
317 * error.cc: Likewise.
318 * options.cc: Likewise.
320 2023-11-03 Harald Anlauf <anlauf@gmx.de>
323 * match.cc (gfc_match_call): If a procedure pointer has already been
324 resolved, do not create a new symbol in a procedure reference of
325 the same name shadowing the first one if it is host-associated.
327 2023-11-03 Harald Anlauf <anlauf@gmx.de>
330 * trans-expr.cc (conv_cond_temp): Helper function for creation of a
331 conditional temporary.
332 (gfc_conv_procedure_call): Handle passing of allocatable or pointer
333 actual argument to dummy with OPTIONAL + VALUE attribute. Actual
334 arguments that are not allocated or associated are treated as not
337 2023-11-03 Paul Thomas <pault@gcc.gnu.org>
340 * interface.cc (upoly_ok): Defined operators using unlimited
341 polymorphic formal arguments must not override the intrinsic
344 2023-11-02 Paul Thomas <pault@gcc.gnu.org>
347 * parse.cc (parse_associate): Remove condition that caused this
350 2023-10-30 Paul Thomas <pault@gcc.gnu.org>
353 * resolve.cc (resolve_select_type): If the selector expression
354 has no class component references and the expression is a
355 derived type, copy the typespec of the symbol to that of the
358 2023-10-27 Harald Anlauf <anlauf@gmx.de>
359 Steven G. Kargl <kargl@gcc.gnu.org>
362 * decl.cc (gfc_match_formal_arglist): Handle conflicting declarations
363 of a MODULE PROCEDURE when one of the declarations is an alternate
366 2023-10-27 Paul Thomas <pault@gcc.gnu.org>
369 * expr.cc (gfc_check_vardef_context): Check that the target
370 does have a vector index before emitting the specific error.
371 * match.cc (copy_ts_from_selector_to_associate): Ensure that
372 class valued operator expressions set the selector rank and
373 use the rank to provide the associate variable with an
374 appropriate array spec.
375 * resolve.cc (resolve_operator): Reduce stacked parentheses to
377 (fixup_array_ref): Extract selector symbol from parentheses.
379 2023-10-26 Paul-Antoine Arras <pa@codesourcery.com>
380 Tobias Burnus <tobias@codesourcery.com>
382 * interface.cc (gfc_compare_types): Return true if one type is C_PTR
383 and the other is a compatible INTEGER(8).
384 * misc.cc (gfc_typename): Handle the case where an INTEGER(8) actually
387 2023-10-25 Thomas Schwinge <thomas@codesourcery.com>
389 * openmp.cc (omp_mask2): Split 'OMP_CLAUSE_HOST_SELF' into
390 'OMP_CLAUSE_SELF', 'OMP_CLAUSE_HOST'.
391 (gfc_match_omp_clauses, OACC_UPDATE_CLAUSES): Adjust.
393 2023-10-25 Chung-Lin Tang <cltang@codesourcery.com>
395 * gfortran.h (typedef struct gfc_omp_clauses): Add self_expr field.
396 * openmp.cc (enum omp_mask2): Add OMP_CLAUSE_SELF.
397 (gfc_match_omp_clauses): Add handling for OMP_CLAUSE_SELF.
398 (OACC_PARALLEL_CLAUSES): Add OMP_CLAUSE_SELF.
399 (OACC_KERNELS_CLAUSES): Likewise.
400 (OACC_SERIAL_CLAUSES): Likewise.
401 (resolve_omp_clauses): Add handling for omp_clauses->self_expr.
402 * trans-openmp.cc (gfc_trans_omp_clauses): Add handling of
403 clauses->self_expr and building of OMP_CLAUSE_SELF tree clause.
404 (gfc_split_omp_clauses): Add handling of self_expr field copy.
406 2023-10-25 Thomas Schwinge <thomas@codesourcery.com>
408 * dump-parse-tree.cc (show_omp_clauses): Group handling of 'if'
409 clause without and with modifier.
410 * frontend-passes.cc (gfc_code_walker): Likewise.
411 * gfortran.h (gfc_omp_clauses): Likewise.
412 * openmp.cc (gfc_free_omp_clauses): Likewise.
414 2023-10-18 Tobias Burnus <tobias@codesourcery.com>
416 * intrinsic.texi (signal): Add 'intrinsic :: signal, sleep' to
417 the example to make it safer.
419 2023-10-17 Harald Anlauf <anlauf@gmx.de>
422 * frontend-passes.cc (traverse_io_block): Dependency check of loop
423 nest shall be triangular, not banded.
425 2023-10-17 Tobias Burnus <tobias@codesourcery.com>
427 * intrinsic.texi (signal): Mention that the argument
428 passed to the signal handler procedure is passed by reference.
431 2023-10-15 Tobias Burnus <tobias@codesourcery.com>
433 * scanner.cc (skip_free_comments, skip_fixed_comments): Remove
434 leftover 'OpenACC' from comments about OpenMP's conditional
435 compilation sentinel.
437 2023-10-14 Tobias Burnus <tobias@codesourcery.com>
439 * gfortran.h (ext_attr_t): Add omp_allocate flag.
440 * match.cc (gfc_free_omp_namelist): Void deleting same
441 u2.allocator multiple times now that a sequence can use
443 * openmp.cc (gfc_match_omp_clauses, gfc_match_omp_allocate): Use
444 same allocator expr multiple times.
445 (is_predefined_allocator): Make static.
446 (gfc_resolve_omp_allocate): Update/extend restriction checks;
447 remove sorry message.
448 (resolve_omp_clauses): Reject corarrays in allocate/allocators
450 * parse.cc (check_omp_allocate_stmt): Permit procedure pointers
451 here (rejected later) for less misleading diagnostic.
452 * trans-array.cc (gfc_trans_auto_array_allocation): Propagate
453 size for GOMP_alloc and location to which it should be added to.
454 * trans-decl.cc (gfc_trans_deferred_vars): Handle 'omp allocate'
455 for stack variables; sorry for static variables/common blocks.
456 * trans-openmp.cc (gfc_trans_omp_clauses): Evaluate 'allocate'
457 clause's allocator only once; fix adding expressions to the
459 (gfc_trans_omp_single): Pass a block to gfc_trans_omp_clauses.
461 2023-10-13 Harald Anlauf <anlauf@gmx.de>
464 * decl.cc (get_proc_name): Extend name conflict detection between
465 internal procedure and previous declaration also to derived type.
467 2023-10-13 Harald Anlauf <anlauf@gmx.de>
470 * invoke.texi: Update documentation to reflect '-ffpe-trap=none'.
471 * options.cc (gfc_handle_fpe_option): Fix mixup up of error messages
472 for options -ffpe-trap and -ffpe-summary. Accept '-ffpe-trap=none'
473 to clear FPU traps previously set on command line.
475 2023-10-13 Richard Biener <rguenther@suse.de>
477 PR tree-optimization/111779
478 * trans-expr.cc (gfc_trans_assignment_1): Initialize
479 lhs_caf_attr and rhs_caf_attr codimension flag to avoid
480 false positive -Wuninitialized.
482 2023-10-12 Paul Thomas <pault@gcc.gnu.org>
485 * trans-expr.cc (gfc_trans_pointer_assignment): Set the hidden
486 string length component for pointer assignment to character
489 2023-10-08 Tobias Burnus <tobias@codesourcery.com>
491 * parse.cc (parse_omp_structured_block): Make the user code end
492 up inside of BLOCK construct for strictly structured blocks;
493 fix fallout for 'section' and 'teams'.
494 * openmp.cc (resolve_omp_target): Fix changed BLOCK handling
495 for teams in target checking.
497 2023-10-04 Paul Thomas <pault@gcc.gnu.org>
501 * trans-expr.cc (gfc_trans_scalar_assign): Finalize components
502 on deallocation if derived type is not finalizable.
504 2023-10-03 David Malcolm <dmalcolm@redhat.com>
506 * error.cc (gfc_format_decoder): Update for "m_" prefixes to
509 2023-10-02 David Malcolm <dmalcolm@redhat.com>
511 * error.cc (gfc_diagnostics_init): Update for change to start_span.
513 2023-10-02 David Malcolm <dmalcolm@redhat.com>
515 * error.cc (gfc_diagnostic_starter): Update for reorganization of
516 source-printing fields of diagnostic_context.
517 (gfc_diagnostics_init): Likewise.
518 (gfc_diagnostics_finish): Likewise.
520 2023-09-29 Andre Vehreschild <vehre@gcc.gnu.org>
523 * trans-array.cc (structure_alloc_comps): Deref coarray.
524 (gfc_trans_deferred_array): Add freeing of components after
525 check for allocated coarray.
527 2023-09-24 Paul Thomas <pault@gcc.gnu.org>
531 * decl.cc (fix_initializer_charlen): New function broken out of
532 add_init_expr_to_sym.
533 (add_init_expr_to_sym, build_struct): Call the new function.
534 * trans-expr.cc (gfc_conv_intrinsic_to_class): Remove repeated
537 2023-09-23 Harald Anlauf <anlauf@gmx.de>
540 * class.cc (gfc_build_class_symbol): Do not try to build class
541 container for invalid typespec.
542 * resolve.cc (resolve_fl_var_and_proc): Prevent NULL pointer
544 (resolve_symbol): Likewise.
546 2023-09-19 Harald Anlauf <anlauf@gmx.de>
549 * trans-array.cc (trans_array_constructor): In absence of a typespec,
550 use string length determined by get_array_ctor_strlen() to reasonably
551 initialize auxiliary variable for bounds-checking.
553 2023-09-15 Harald Anlauf <anlauf@gmx.de>
556 * trans-array.cc (trans_array_bound_check): Add optional argument
557 COMPNAME for explicit specification of array component name.
558 (array_bound_check_elemental): Helper function for generating
559 bounds-checking code for elemental dimensions.
560 (gfc_conv_expr_descriptor): Use bounds-checking also for elemental
561 dimensions, i.e. those not handled by the scalarizer.
563 2023-09-15 Mikael Morin <mikael@gcc.gnu.org>
566 * gfortran.h (gfc_symbol): Add comment documenting reference counting.
567 * parse.cc (parse_interface): Remove reference count incrementation.
569 2023-09-12 Mikael Morin <mikael@gcc.gnu.org>
572 * gfortran.h (gfc_release_symbol): Set return type to bool.
573 * symbol.cc (gfc_release_symbol): Ditto. Return whether symbol was
575 (delete_symbol_from_ns): New, outline code from...
576 (gfc_restore_last_undo_checkpoint): ... here. Delete new symbols
577 from two more namespaces.
579 2023-09-09 Mikael Morin <mikael@gcc.gnu.org>
581 * bbt.cc (delete_treap): Add argument REMOVED, set it to the removed
582 element from the tree. Change NULL to nullptr.
583 (gfc_delete_bbt): Return the removed element from the tree.
584 * gfortran.h (gfc_delete_symtree): Remove prototype.
585 (gfc_delete_bbt): Set return type to pointer.
586 * symbol.cc (gfc_delete_symtree): Make static. Get the element to be
587 freed from the result of gfc_delete_bbt. Remove the preliminary walk to
590 2023-09-01 Harald Anlauf <anlauf@gmx.de>
593 * trans-array.cc (gfc_conv_ss_startstride): For array bounds checking,
594 consider also array constructors in expressions, and use their shape.
596 2023-08-31 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
598 * gfortran.texi: Likewise.
600 2023-08-30 Mikael Morin <mikael@gcc.gnu.org>
603 * gfortran.h (gfc_drop_interface_elements_before): New prototype.
604 (gfc_current_interface_head): Return a reference to the pointer.
605 * interface.cc (gfc_current_interface_head): Ditto.
606 (free_interface_elements_until): New function, generalizing
608 (gfc_free_interface): Use free_interface_elements_until.
609 (gfc_drop_interface_elements_before): New function.
611 (current_interface_ptr, previous_interface_head): New static variables.
612 (current_interface_valid_p, get_current_interface_ptr): New functions.
613 (decode_statement): Initialize previous_interface_head.
614 (reject_statement): Restore current interface pointer to point to
615 previous_interface_head.
617 2023-08-26 Paul Thomas <pault@gcc.gnu.org>
620 * trans-expr.cc (gfc_trans_arrayfunc_assign): Supply a missing
621 dereference for the call to gfc_deallocate_alloc_comp_no_caf.
623 2023-08-25 Sandra Loosemore <sandra@codesourcery.com>
625 * gfortran.h (struct gfc_namespace): Add omp_structured_block bit.
626 * openmp.cc: Include omp-api.h.
627 (resolve_omp_clauses): Consolidate inscan reduction clause conflict
629 (find_nested_loop_in_chain): New.
630 (find_nested_loop_in_block): New.
631 (gfc_resolve_omp_do_blocks): Set omp_current_do_collapse properly.
632 Handle imperfectly-nested loops when looking for nested omp scan.
633 Refactor to move inscan reduction clause conflict checking to
635 (gfc_resolve_do_iterator): Handle imperfectly-nested loops.
636 (struct icode_error_state): New.
637 (icode_code_error_callback): New.
638 (icode_expr_error_callback): New.
639 (diagnose_intervening_code_errors_1): New.
640 (diagnose_intervening_code_errors): New.
641 (make_structured_block): New.
642 (restructure_intervening_code): New.
643 (is_outer_iteration_variable): Do not assume loops are perfectly
645 (check_nested_loop_in_chain): New.
646 (check_nested_loop_in_block_state): New.
647 (check_nested_loop_in_block_symbol): New.
648 (check_nested_loop_in_block): New.
649 (expr_uses_intervening_var): New.
650 (is_intervening_var): New.
651 (expr_is_invariant): Do not assume loops are perfectly nested.
652 (resolve_omp_do): Handle imperfectly-nested loops.
653 * trans-stmt.cc (gfc_trans_block_construct): Generate
654 OMP_STRUCTURED_BLOCK if magic bit is set on block namespace.
656 2023-08-25 Harald Anlauf <anlauf@gmx.de>
659 * data.cc (get_array_index): Add bounds-checking code and return error
660 status. Overindexing will be allowed as an extension for -std=legacy
661 and generate an error in standard-conforming mode.
662 (gfc_assign_data_value): Use error status from get_array_index for
663 graceful error recovery.
665 2023-08-25 Uros Bizjak <ubizjak@gmail.com>
667 * match.cc (gfc_match_equivalence): Rename TRUE/FALSE to true/false.
668 * module.cc (check_access): Ditto.
669 * primary.cc (match_real_constant): Ditto.
670 * trans-array.cc (gfc_trans_allocate_array_storage): Ditto.
671 (get_array_ctor_strlen): Ditto.
672 * trans-common.cc (find_equivalence): Ditto.
673 (add_equivalences): Ditto.
675 2023-08-23 Harald Anlauf <anlauf@gmx.de>
678 * resolve.cc (is_non_constant_shape_array): Add forward declaration.
679 (resolve_common_vars): Diagnose automatic array object in COMMON.
680 (resolve_symbol): Prevent confusing follow-on error.
682 2023-08-22 Tobias Burnus <tobias@codesourcery.com>
684 * gfortran.h (enum gfc_omp_defaultmap_category):
685 Add OMP_DEFAULTMAP_CAT_ALL.
686 * openmp.cc (gfc_match_omp_clauses): Parse
688 * trans-openmp.cc (gfc_trans_omp_clauses): Handle it.
690 2023-08-22 Harald Anlauf <anlauf@gmx.de>
693 * data.cc (gfc_advance_section): Derive next index set and next offset
694 into DATA variable also for array references using vector sections.
695 Use auxiliary array to keep track of offsets into indexing vectors.
696 (gfc_get_section_index): Set up initial indices also for DATA variables
697 with array references using vector sections.
698 * data.h (gfc_get_section_index): Adjust prototype.
699 (gfc_advance_section): Likewise.
700 * resolve.cc (check_data_variable): Pass vector offsets.
702 2023-08-16 Harald Anlauf <anlauf@gmx.de>
705 * trans-expr.cc (conv_scalar_char_value): Use gfc_replace_expr to
706 avoid leaking replaced gfc_expr.
708 2023-08-15 Martin Jambor <mjambor@suse.cz>
709 Harald Anlauf <anlauf@gmx.de>
712 * resolve.cc (resolve_structure_cons): Check comp->ts is character
713 type before accessing stuff through comp->ts.u.cl.
715 2023-08-15 Chung-Lin Tang <cltang@codesourcery.com>
716 Thomas Schwinge <thomas@codesourcery.com>
718 * openmp.cc (OACC_DATA_CLAUSES): Add OMP_CLAUSE_DEFAULT.
720 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
724 * trans-types.cc (gfc_sym_type): Use a bare character type for length
725 one value character dummy arguments.
726 * trans-expr.cc (gfc_conv_string_parameter): Handle single character
728 (gfc_conv_procedure_call): Don't exclude interoperable kinds
729 from single character handling. For single character dummy arguments,
730 extend the existing handling of non-constant expressions to constant
733 2023-08-14 Mikael Morin <mikael@gcc.gnu.org>
735 * gfortran.h (gfc_length_one_character_type_p): New inline
737 * check.cc (is_c_interoperable): Use
738 gfc_length_one_character_type_p.
739 * decl.cc (verify_bind_c_sym): Same.
740 * trans-expr.cc (gfc_conv_procedure_call): Same.
742 2023-08-09 Steve Kargl <sgk@troutmask.apl.washington.edu>
745 * resolve.cc (resolve_types): Exclude contained procedures with
746 the artificial attribute from test for pureness.
748 2023-07-31 Chung-Lin Tang <cltang@codesourcery.com>
750 * openmp.cc (resolve_omp_clauses): Add checking requiring
751 OpenACC host_data construct to have an use_device clause.
753 2023-07-28 Harald Anlauf <anlauf@gmx.de>
756 * gfortran.texi: Clarify argument passing convention.
757 * trans-expr.cc (gfc_conv_procedure_call): Do not pass the character
758 length as hidden argument when the declared dummy argument is
761 2023-07-27 Tobias Burnus <tobias@codesourcery.com>
763 * openmp.cc (resolve_omp_target): Minor cleanup.
764 * parse.cc (decode_omp_directive): Find TARGET statement
765 also higher in the stack.
767 2023-07-26 Harald Anlauf <anlauf@gmx.de>
770 * resolve.cc (check_data_variable): Do not accept strings with
771 deferred length or non-constant length in a DATA statement.
772 Reject also substrings of string variables of non-constant length.
774 2023-07-25 Tobias Burnus <tobias@codesourcery.com>
778 * gfortran.h (gfc_omp_clauses): Add target_first_st_is_teams.
779 * parse.cc (parse_omp_structured_block): Set it if the first
780 statement in the structured block of a TARGET is TEAMS or
781 a combined/composite starting with TEAMS.
782 * openmp.cc (resolve_omp_target): Also show an error for
783 contains_teams_construct without target_first_st_is_teams.
785 2023-07-24 Tobias Burnus <tobias@codesourcery.com>
789 * gfortran.h (gfc_omp_clauses): Add contains_teams_construct.
790 * openmp.cc (resolve_omp_target): New; check for teams nesting.
791 (gfc_resolve_omp_directive): Call it.
792 * parse.cc (decode_omp_directive): Set contains_teams_construct
793 on enclosing ST_OMP_TARGET.
795 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
797 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): Only
800 2023-07-20 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
802 * f95-lang.cc (gfc_init_builtin_functions): Add __builtin_iseqsig.
803 * trans-intrinsic.cc (conv_intrinsic_ieee_comparison): New
805 (gfc_conv_ieee_arithmetic_function): Handle IEEE comparisons.
807 2023-07-19 Tobias Burnus <tobias@codesourcery.com>
810 * trans-openmp.cc (gfc_nonrect_loop_expr): Accept all
812 (gfc_trans_omp_do): Likewise; use sign to determine
815 2023-07-17 Harald Anlauf <anlauf@gmx.de>
819 * trans-expr.cc (gfc_conv_procedure_call): For intrinsic procedures
820 whose result characteristics depends on the first argument and which
821 can be of type character, the character length will not be deferred.
823 2023-07-17 Tobias Burnus <tobias@codesoucery.com>
824 Chung-Lin Tang <cltang@codesourcery.com>
826 * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Dump
827 uses_allocators clause.
828 * gfortran.h (gfc_free_omp_namelist): Add memspace_sym to u union
829 and traits_sym to u2 union.
830 (OMP_LIST_USES_ALLOCATORS): New enum value.
831 (gfc_free_omp_namelist): Add 'bool free_mem_traits_space' arg.
832 * match.cc (gfc_free_omp_namelist): Likewise.
833 * openmp.cc (gfc_free_omp_clauses, gfc_match_omp_variable_list,
834 gfc_match_omp_to_link, gfc_match_omp_doacross_sink,
835 gfc_match_omp_clause_reduction, gfc_match_omp_allocate,
836 gfc_match_omp_flush): Update call.
837 (gfc_match_omp_clauses): Likewise. Parse uses_allocators clause.
838 (gfc_match_omp_clause_uses_allocators): New.
839 (enum omp_mask2): Add new OMP_CLAUSE_USES_ALLOCATORS.
840 (OMP_TARGET_CLAUSES): Accept it.
841 (resolve_omp_clauses): Resolve uses_allocators clause
842 * st.cc (gfc_free_statement): Update gfc_free_omp_namelist call.
843 * trans-openmp.cc (gfc_trans_omp_clauses): Handle
844 OMP_LIST_USES_ALLOCATORS; fail with sorry unless predefined allocator.
845 (gfc_split_omp_clauses): Handle uses_allocators.
847 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
850 * trans.h (gfc_deallocate_with_status): Add class container
852 (gfc_deallocate_scalar_with_status): Ditto.
853 * trans.cc (gfc_deallocate_with_status): Add class container
854 argument and pass it down to gfc_add_finalize_call.
855 (gfc_deallocate_scalar_with_status): Same.
856 * trans-array.cc (structure_alloc_comps): Update caller.
857 * trans-stmt.cc (gfc_trans_deallocate): Ditto.
858 * trans-expr.cc (gfc_conv_procedure_call): Ditto. Pass
859 pre-evaluated class container argument if it's available.
861 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
864 * trans.h (gfc_add_finalizer_call): Add class container argument.
865 * trans.cc (gfc_add_finalizer_call): Ditto. Pass down new
866 argument to get_final_proc_ref, get_elem_size, get_var_desc,
868 (get_elem_size): Add class container argument.
869 Use provided class container if it's available.
870 (get_var_descr): Same.
872 (get_final_proc_ref): Same. Add boolean telling the class
873 container argument is used. Set it. Don't try to use
874 final_wrapper if class container argument was used.
876 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
878 * trans.cc (get_var_descr): Factor scalar descriptor generation.
880 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
882 * trans.cc (get_vptr): New function.
883 (gfc_add_finalizer_call): Move virtual table pointer evaluation
886 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
888 * trans.cc (get_var_descr): Remove argument ts. Use var->ts
890 (gfc_add_finalizer_call): Update caller.
892 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
894 * trans.cc (gfc_add_finalizer_call): Inline definition of
895 variable has_finalizer. Merge nested conditions.
897 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
899 * trans.cc (gfc_add_finalizer_call): Remove local variable
900 final_expr. Pass down expr to get_final_proc_ref and move
901 final procedure expression generation down to its one usage
902 in get_final_proc_ref.
903 (get_final_proc_ref): Add argument expr. Remove argument
904 final_wrapper. Recreate final_wrapper from expr.
906 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
908 * trans.cc (gfc_add_finalizer_call): Remove local variable
909 elem_size. Pass expression to get_elem_size and move the
910 element size expression generation close to its usage there.
911 (get_elem_size): Add argument expr, remove class_size argument
912 and rebuild it from expr. Remove ts argument and use the
913 type of expr instead.
915 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
917 * trans.cc (gfc_add_finalizer_call): Move pre and post code for
918 the final procedure pointer expression to the outer block.
919 Reuse the previously evaluated final procedure pointer
922 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
924 * trans.cc (gfc_add_finalizer_call): Add post code for desc_se
925 after the finalizer call. Add post code for final_se and
928 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
930 * trans.cc (gfc_build_final_call): Inline...
931 (gfc_add_finalizer_call): ... to its one caller.
933 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
935 * trans.cc (get_var_descr): New function.
936 (gfc_build_final_call): Outline the data reference descriptor
937 evaluation code to get_var_descr.
939 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
941 * trans.cc (get_elem_size): New function.
942 (gfc_build_final_call): Outline the element size evaluation
945 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
947 * trans.cc (get_final_proc_ref): New function.
948 (gfc_build_final_call): Outline the pointer evaluation code
949 to get_final_proc_ref.
951 2023-07-17 Mikael Morin <mikael@gcc.gnu.org>
953 * trans.cc (gfc_build_final_call): Remove commented assertion.
955 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
958 * trans.h (gfc_reset_vptr): Add class_container argument.
959 * trans-expr.cc (gfc_reset_vptr): Ditto. If a valid vptr can
960 be obtained through class_container argument, bypass evaluation
962 (gfc_conv_procedure_call): Wrap the argument evaluation code
963 in a conditional if the associated dummy is optional. Evaluate
964 the data reference to a pointer now, and replace later
965 references with usage of the pointer.
967 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
970 * trans.h (struct gfc_se): New field class_container.
971 (struct gfc_ss_info): Ditto.
972 (gfc_evaluate_data_ref_now): New prototype.
973 * trans.cc (gfc_evaluate_data_ref_now): Implement it.
974 * trans-array.cc (gfc_conv_ss_descriptor): Copy class_container
975 field from gfc_se struct to gfc_ss_info struct.
976 (gfc_conv_expr_descriptor): Copy class_container field from
977 gfc_ss_info struct to gfc_se struct.
978 * trans-expr.cc (gfc_conv_class_to_class): Use class container
979 set in class_container field if available.
980 (gfc_conv_variable): Set class_container field on encountering
981 class variables or components, clear it on encountering
982 non-class components.
983 (gfc_conv_procedure_call): Evaluate data ref to a pointer now,
984 and replace later references by usage of the pointer.
986 2023-07-14 Mikael Morin <mikael@gcc.gnu.org>
989 * trans-expr.cc (gfc_conv_procedure_call): Use a separate gfc_se
990 struct, initalized from parmse, to generate the class wrapper.
991 After the class wrapper code has been generated, copy it back
992 depending on whether parameter deallocation code has been
995 2023-07-13 Mikael Morin <mikael@gcc.gnu.org>
998 * symbol.cc (gfc_restore_last_undo_checkpoint): Release symbols
1001 2023-07-12 Andre Vehreschild <vehre@gcc.gnu.org>
1004 * expr.cc (find_inquiry_ref): Replace len of pdt_string by
1006 (simplify_ref_chain): Ensure input to find_inquiry_ref is
1008 (gfc_match_init_expr): Prevent PDT analysis for function calls.
1009 (gfc_pdt_find_component_copy_initializer): Get the initializer
1010 value for given component.
1011 * gfortran.h (gfc_pdt_find_component_copy_initializer): New
1013 * simplify.cc (gfc_simplify_len): Replace len() of PDT with pdt
1014 component ref or constant.
1016 2023-07-11 Harald Anlauf <anlauf@gmx.de>
1019 * symbol.cc (gfc_copy_formal_args_intr): When deriving the formal
1020 argument attributes from the actual ones for intrinsic procedure
1021 calls, take special care of CHARACTER arguments that we do not
1022 wrongly treat them formally as deferred-length.
1024 2023-07-08 Steve Kargl <sgk@troutmask.apl.washington.edu>
1028 * match.cc (gfc_match_namelist): Check for host associated or
1029 defined types before applying default type.
1030 (gfc_match_select_rank): Apply default type to selector of
1031 unknown type if possible.
1032 * resolve.cc (resolve_fl_variable): Do not apply local default
1033 initialization to assumed rank entities.
1035 2023-07-08 Harald Anlauf <anlauf@gmx.de>
1036 Steven G. Kargl <kargl@gcc.gnu.org>
1039 * trans-expr.cc (gfc_conv_procedure_call): Check procedures for
1040 allocatable dummy arguments with INTENT(OUT) and move deallocation
1041 of actual arguments after evaluation of argument expressions before
1042 the procedure is executed.
1044 2023-07-08 Harald Anlauf <anlauf@gmx.de>
1047 * arith.cc (gfc_compare_expr): Handle equality comparison of constant
1048 complex gfc_expr arguments.
1050 2023-07-05 Robin Dapp <rdapp@ventanamicro.com>
1051 Juzhe-Zhong <juzhe.zhong@rivai.ai>
1053 * trans-types.cc (gfc_type_for_mode): Ditto.
1055 2023-06-28 Harald Anlauf <anlauf@gmx.de>
1058 * trans-expr.cc (gfc_conv_procedure_call): For non-constant string
1059 argument passed to CHARACTER(LEN=1),VALUE dummy, ensure proper
1060 dereferencing and truncation of string to length 1.
1062 2023-06-28 Paul Thomas <pault@gcc.gnu.org>
1065 * expr.cc (gfc_is_ptr_fcn): Remove reference to class_pointer.
1066 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
1067 associate names with pointer function targets to be used in
1068 variable definition context.
1069 * trans-decl.cc (get_symbol_decl): Remove extraneous line.
1070 * trans-expr.cc (alloc_scalar_allocatable_subcomponent): Obtain
1071 size of intrinsic and character expressions.
1072 (gfc_trans_subcomponent_assign): Expand assignment to class
1073 components to include intrinsic and character expressions.
1075 2023-06-24 Harald Anlauf <anlauf@gmx.de>
1078 * trans-expr.cc (gfc_conv_procedure_call): Truncate constant string
1079 argument of length > 1 passed to scalar CHARACTER(1),VALUE dummy.
1081 2023-06-23 Harald Anlauf <anlauf@gmx.de>
1084 * trans-expr.cc (gfc_conv_procedure_call): Pass actual argument
1085 to scalar CHARACTER(1),VALUE dummy argument by value.
1087 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
1094 * decl.cc (char_len_param_value): Fix memory leak.
1095 (resolve_block_construct): Remove unnecessary static decls.
1096 * expr.cc (gfc_is_ptr_fcn): New function.
1097 (gfc_check_vardef_context): Use it to permit pointer function
1098 result selectors to be used for associate names in variable
1100 * gfortran.h: Prototype for gfc_is_ptr_fcn.
1101 * match.cc (build_associate_name): New function.
1102 (gfc_match_select_type): Use the new function to replace inline
1103 version and to build a new associate name for the case where
1104 the supplied associate name is already used for that purpose.
1105 * resolve.cc (resolve_assoc_var): Call gfc_is_ptr_fcn to allow
1106 associate names with pointer function targets to be used in
1107 variable definition context.
1108 * trans-decl.cc (gfc_get_symbol_decl): Unlimited polymorphic
1109 variables need deferred initialisation of the vptr.
1110 (gfc_trans_deferred_vars): Do the vptr initialisation.
1111 * trans-stmt.cc (trans_associate_var): Ensure that a pointer
1112 associate name points to the target of the selector and not
1113 the selector itself.
1115 2023-06-21 Paul Thomas <pault@gcc.gnu.org>
1118 * trans-expr.cc (gfc_conv_procedure_call): The hidden string
1119 length must not be passed to a formal arg of type(cptr).
1121 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
1123 * dump-parse-tree.cc (show_omp_namelist): Fix dump of the allocator
1124 modifier of OMP_LIST_ALLOCATE.
1126 2023-06-20 Tobias Burnus <tobias@codesourcery.com>
1128 * match.cc (gfc_match_char): Match with '%S' a symbol
1129 with host_assoc = 1.
1131 2023-06-19 Tobias Burnus <tobias@codesourcery.com>
1133 * intrinsic.texi (OpenMP Modules OMP_LIB and OMP_LIB_KINDS): Also
1134 add references to the OpenMP 5.1 and 5.2 spec; add omp_initial_device
1135 and omp_invalid_device named constants.
1137 2023-06-13 Harald Anlauf <anlauf@gmx.de>
1138 Mikael Morin <mikael@gcc.gnu.org>
1141 * trans-array.cc (gfc_trans_allocate_array_storage): When passing a
1142 zero-sized array with fixed (= non-dynamic) size, allocate temporary
1143 by the caller, not by the callee.
1145 2023-06-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
1147 * f95-lang.cc (gfc_init_builtin_functions): Add fmax() and
1148 fmin() built-ins, and their variants.
1149 * mathbuiltins.def: Add FMAX and FMIN built-ins.
1150 * trans-intrinsic.cc (conv_intrinsic_ieee_minmax): New function.
1151 (gfc_conv_ieee_arithmetic_function): Handle IEEE_MIN_NUM and
1152 IEEE_MAX_NUM functions.
1154 2023-06-09 Jakub Jelinek <jakub@redhat.com>
1157 * primary.cc (gfc_convert_to_structure_constructor): Only do
1158 constant string ctor length verification and truncation/padding
1159 if constant length has INTEGER type.
1161 2023-06-08 Paul Thomas <pault@gcc.gnu.org>
1167 * decl.cc (char_len_param_value): Simplify a copy of the expr
1168 and replace the original if there is no error.
1169 * gfortran.h : Remove the redundant field 'rankguessed' from
1170 'gfc_association_list'.
1171 * resolve.cc (resolve_assoc_var): Remove refs to 'rankguessed'.
1172 (resolve_variable): Associate names with constant or structure
1173 constructor targets cannot have array refs.
1174 * trans-array.cc (gfc_conv_expr_descriptor): Guard expression
1175 character length backend decl before using it. Suppress the
1176 assignment if lhs equals rhs.
1177 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
1178 associate variables pointing to a variable. Add comment.
1179 * trans-stmt.cc (trans_associate_var): Remove requirement that
1180 the character length be deferred before assigning the value
1181 returned by gfc_conv_expr_descriptor. Also, guard the backend
1182 decl before testing with VAR_P.
1184 2023-06-06 Kwok Cheung Yeung <kcy@codesourcery.com>
1185 Tobias Burnus <tobias@codesourcery.com>
1187 * dump-parse-tree.cc (show_omp_namelist): Display 'present' map
1189 (show_omp_clauses): Display 'present' motion modifier for 'to'
1191 * gfortran.h (enum gfc_omp_map_op): Add entries with 'present'
1193 (struct gfc_omp_namelist): Add 'present_modifer'.
1194 * openmp.cc (gfc_match_motion_var_list): New, handles optional
1195 'present' modifier for to/from clauses.
1196 (gfc_match_omp_clauses): Call it for to/from clauses; parse 'present'
1197 in defaultmap and map clauses.
1198 (resolve_omp_clauses): Allow 'present' modifiers on 'target',
1199 'target data', 'target enter' and 'target exit' directives.
1200 * trans-openmp.cc (gfc_trans_omp_clauses): Apply 'present' modifiers
1201 to tree node for 'map', 'to' and 'from' clauses. Apply 'present' for
1204 2023-06-02 Steve Kargl <kargl@gcc.gnu.org>
1207 * resolve.cc (resolve_select_rank): Remove duplicate error.
1208 (resolve_fl_var_and_proc): Prevent NULL pointer dereference and
1209 suppress error message for temporary.
1211 2023-06-02 Paul Thomas <pault@gcc.gnu.org>
1214 * parse.cc (parse_associate): Replace the existing evaluation
1215 of the target rank with calls to gfc_resolve_ref and
1216 gfc_expression_rank. Identify untyped target function results
1217 with structure constructors by finding the appropriate derived
1219 * resolve.cc (resolve_symbol): Allow associate variables to be
1222 2023-06-01 Harald Anlauf <anlauf@gmx.de>
1225 * decl.cc (gfc_match_kind_spec): Use error path on missing right
1227 (gfc_match_decl_type_spec): Use error return when an error occurred
1228 during matching a KIND specifier.
1230 2023-06-01 Tobias Burnus <tobias@codesourcery.com>
1232 * parse.cc (decode_omp_directive): Accept all pure directives
1233 inside a PURE procedures; handle 'error at(execution).
1235 2023-05-26 Tobias Burnus <tobias@codesourcery.com>
1237 * dump-parse-tree.cc (show_omp_namelist): Update allocator, fix
1239 (show_omp_node, show_code_node): Handle EXEC_OMP_ALLOCATE.
1240 * gfortran.h (enum gfc_statement): Add ST_OMP_ALLOCATE and ..._EXEC.
1241 (enum gfc_exec_op): Add EXEC_OMP_ALLOCATE.
1242 (struct gfc_omp_namelist): Add 'allocator' to 'u2' union.
1243 (struct gfc_namespace): Add omp_allocate.
1244 (gfc_resolve_omp_allocate): New.
1245 * match.cc (gfc_free_omp_namelist): Free 'u2.allocator'.
1246 * match.h (gfc_match_omp_allocate, gfc_match_omp_allocators): New.
1247 * openmp.cc (gfc_omp_directives): Uncomment allocate/allocators.
1248 (gfc_match_omp_variable_list): Add bool arg for
1249 rejecting listening common-block vars separately.
1250 (gfc_match_omp_clauses): Update for u2.allocators.
1251 (OMP_ALLOCATORS_CLAUSES, gfc_match_omp_allocate,
1252 gfc_match_omp_allocators, is_predefined_allocator,
1253 gfc_resolve_omp_allocate): New.
1254 (resolve_omp_clauses): Update 'allocate' clause checks.
1255 (omp_code_to_statement, gfc_resolve_omp_directive): Handle
1256 OMP ALLOCATE/ALLOCATORS.
1257 * parse.cc (in_exec_part): New global var.
1258 (check_omp_allocate_stmt, parse_openmp_allocate_block): New.
1259 (decode_omp_directive, case_exec_markers, case_omp_decl,
1260 gfc_ascii_statement, parse_omp_structured_block): Handle
1261 OMP allocate/allocators.
1262 (verify_st_order, parse_executable): Set in_exec_part.
1263 * resolve.cc (gfc_resolve_blocks, resolve_codes): Handle
1264 allocate/allocators.
1265 * st.cc (gfc_free_statement): Likewise.
1266 * trans.cc (trans_code): Likewise.
1267 * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
1268 (gfc_trans_omp_clauses, gfc_split_omp_clauses): Update for
1269 u2.allocator, fix for u.align.
1271 2023-05-24 Harald Anlauf <anlauf@gmx.de>
1274 * simplify.cc (simplify_size): Reject DIM argument of intrinsic SIZE
1275 with error when out of valid range.
1277 2023-05-24 Harald Anlauf <anlauf@gmx.de>
1280 * check.cc (gfc_check_reshape): Expand constant arguments SHAPE and
1281 ORDER before checking.
1282 * gfortran.h (gfc_is_constant_array_expr): Add prototype.
1283 * iresolve.cc (gfc_resolve_reshape): Expand constant argument SHAPE.
1284 * simplify.cc (is_constant_array_expr): If array is determined to be
1285 constant, expand small array constructors if needed.
1286 (gfc_is_constant_array_expr): Wrapper for is_constant_array_expr.
1287 (gfc_simplify_reshape): Fix check for insufficient elements in SOURCE
1288 when no padding specified.
1290 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
1293 * resolve.cc (gfc_resolve_ref): Conversion of array_ref into an
1294 element should be done for all characters without a len expr,
1295 not just deferred lens, and for integer expressions.
1296 * trans-expr.cc (conv_inquiry): For len and kind inquiry refs,
1297 set the se string_length to NULL_TREE.
1299 2023-05-23 Paul Thomas <pault@gcc.gnu.org>
1300 Steven G. Kargl <kargl@gcc.gnu.org>
1303 * decl.cc (variable_decl): Clean up white space issues.
1304 (gfc_match_final_decl): Declaration of finalizable derived type
1305 is allowed in a submodule.
1307 2023-05-19 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1309 * expr.cc (gfc_get_corank): Use CLASS_DATA from gfortran.h.
1310 * resolve.cc (resolve_component): Same.
1311 (resolve_fl_derived0): Same.
1312 * simplify.cc (gfc_simplify_extends_type_of): Same.
1313 (simplify_cobound): Same.
1315 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1317 * trans-array.cc (is_pointer_array): Use _P() defines from tree.h.
1318 (gfc_conv_scalarized_array_ref): Ditto.
1319 (gfc_conv_array_ref): Ditto.
1320 * trans-decl.cc (gfc_finish_decl): Ditto.
1321 (gfc_get_symbol_decl): Ditto.
1322 * trans-expr.cc (gfc_trans_pointer_assignment): Ditto.
1323 (gfc_trans_arrayfunc_assign): Ditto.
1324 (gfc_trans_assignment_1): Ditto.
1325 * trans-intrinsic.cc (gfc_conv_intrinsic_minmax): Ditto.
1326 (conv_intrinsic_ieee_value): Ditto.
1327 * trans-io.cc (gfc_convert_array_to_string): Ditto.
1328 * trans-openmp.cc (gfc_omp_is_optional_argument): Ditto.
1329 (gfc_trans_omp_clauses): Ditto.
1330 * trans-stmt.cc (gfc_conv_label_variable): Ditto.
1331 * trans.cc (gfc_build_addr_expr): Ditto.
1332 (get_array_span): Ditto.
1334 2023-05-18 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1337 * array.cc (compare_bounds): Use narrower return type.
1338 (gfc_compare_array_spec): Likewise.
1339 (is_constant_element): Likewise.
1340 (gfc_constant_ac): Likewise.
1341 * check.cc (dim_rank_check): Likewise.
1342 * cpp.cc (gfc_cpp_init_options): Likewise.
1343 (dump_macro): Likewise.
1344 * cpp.h (gfc_cpp_handle_option): Likewise.
1345 * dependency.cc (gfc_ref_needs_temporary_p): Likewise.
1346 (gfc_check_argument_dependency): Likewise.
1347 (gfc_check_fncall_dependency): Likewise.
1348 (ref_same_as_full_array): Likewise.
1349 * dependency.h (gfc_check_fncall_dependency): Likewise.
1350 (gfc_dep_resolver): Likewise.
1351 (gfc_are_equivalenced_arrays): Likewise.
1352 * expr.cc (gfc_copy_ref): Likewise.
1353 (gfc_kind_max): Likewise.
1354 (numeric_type): Likewise.
1355 * gfortran.h (gfc_at_end): Likewise.
1356 (gfc_at_eof): Likewise.
1357 (gfc_at_bol): Likewise.
1358 (gfc_at_eol): Likewise.
1359 (gfc_define_undef_line): Likewise.
1360 (gfc_wide_is_printable): Likewise.
1361 (gfc_wide_is_digit): Likewise.
1362 (gfc_wide_fits_in_byte): Likewise.
1363 (gfc_find_sym_tree): Likewise.
1364 (gfc_generic_intrinsic): Likewise.
1365 (gfc_specific_intrinsic): Likewise.
1366 (gfc_intrinsic_actual_ok): Likewise.
1367 (gfc_has_vector_index): Likewise.
1368 (gfc_numeric_ts): Likewise.
1369 (gfc_impure_variable): Likewise.
1370 (gfc_pure): Likewise.
1371 (gfc_implicit_pure): Likewise.
1372 (gfc_elemental): Likewise.
1373 (gfc_pure_function): Likewise.
1374 (gfc_implicit_pure_function): Likewise.
1375 (gfc_compare_array_spec): Likewise.
1376 (gfc_constant_ac): Likewise.
1377 (gfc_expanded_ac): Likewise.
1378 (gfc_check_digit): Likewise.
1379 * intrinsic.cc (gfc_find_subroutine): Likewise.
1380 (gfc_generic_intrinsic): Likewise.
1381 (gfc_specific_intrinsic): Likewise.
1382 * io.cc (compare_to_allowed_values): Likewise. And remove
1383 unneeded forward declaration.
1384 * parse.cc: Likewise.
1385 * parse.h (gfc_check_do_variable): Likewise.
1386 * primary.cc (gfc_check_digit): Likewise.
1387 * resolve.cc (resolve_structure_cons): Likewise.
1388 (pure_stmt_function): Likewise.
1389 (gfc_pure_function): Likewise.
1390 (impure_stmt_fcn): Likewise.
1391 (resolve_forall_iterators): Likewise.
1392 (resolve_data): Likewise.
1393 (gfc_impure_variable): Likewise.
1394 (gfc_pure): Likewise.
1395 (gfc_unset_implicit_pure): Likewise.
1396 * scanner.cc (wide_is_ascii): Likewise.
1397 (gfc_wide_toupper): Likewise.
1398 (gfc_open_included_file): Likewise.
1399 (gfc_at_end): Likewise.
1400 (gfc_at_eof): Likewise.
1401 (gfc_at_bol): Likewise.
1402 (skip_comment_line): Likewise.
1403 (gfc_gobble_whitespace): Likewise.
1404 * symbol.cc (gfc_find_symtree_in_proc): Likewise.
1405 * trans-array.cc: Likewise.
1406 * trans-decl.cc (gfc_set_decl_assembler_name): Likewise.
1407 * trans-types.cc (gfc_get_element_type): Likewise.
1408 (gfc_add_field_to_struct): Likewise.
1409 * trans-types.h (gfc_copy_dt_decls_ifequal): Likewise.
1410 (gfc_return_by_reference): Likewise.
1411 (gfc_is_nodesc_array): Likewise.
1412 * trans.h (gfc_can_put_var_on_stack): Likewise.
1414 2023-05-17 Harald Anlauf <anlauf@gmx.de>
1418 * decl.cc (add_init_expr_to_sym): Set shape of initializer also for
1419 zero-sized arrays, so that bounds violations can be detected later.
1421 2023-05-17 Tobias Burnus <tobias@codesourcery.com>
1423 * trans-decl.cc (gfc_get_symbol_decl): Add attributes
1424 such as 'declare target' also to hidden artificial
1425 variable for deferred-length character variables.
1426 * trans-openmp.cc (gfc_trans_omp_array_section,
1427 gfc_trans_omp_clauses, gfc_trans_omp_target_exit_data):
1428 Improve mapping of array descriptors and deferred-length
1431 2023-05-16 Paul Thomas <pault@gcc.gnu.org>
1439 * interface.cc (gfc_compare_actual_formal): Emit an error if an
1440 unlimited polymorphic actual is not matched either to an
1441 unlimited or assumed type formal argument.
1442 * resolve.cc (resolve_ordinary_assign): Emit an error if the
1443 var expression of an ordinary assignment is a proc pointer
1445 * trans-array.cc (gfc_walk_array_ref): Provide assumed shape
1446 arrays coming from interface mapping with a viable arrayspec.
1447 * trans-expr.cc (gfc_conv_intrinsic_to_class): Tidy up flagging
1448 of unlimited polymorphic 'class_ts'.
1449 (gfc_conv_gfc_desc_to_cfi_desc): Assumed type is unlimited
1450 polymorphic and should accept any actual type.
1451 (gfc_conv_procedure_call): Replace dreadful kludge with a call
1452 to gfc_finalize_tree_expr. Avoid dereferencing a void pointer
1453 by giving it the pointer type of the actual argument.
1454 (alloc_scalar_allocatable_subcomponent): Shorten the function
1455 name and replace the symbol argument with the se string length.
1456 If a deferred length character length is either not present or
1457 is not a variable, give the typespec a variable and assign the
1458 string length to that. Use gfc_deferred_strlen to find the
1459 hidden string length component.
1460 (gfc_trans_subcomponent_assign): Convert the expression before
1461 the call to alloc_scalar_allocatable_subcomponent so that a
1462 good string length is provided.
1463 (gfc_trans_structure_assign): Remove the unneeded derived type
1464 symbol from calls to gfc_trans_subcomponent_assign.
1466 2023-05-15 Harald Anlauf <anlauf@gmx.de>
1469 * expr.cc (gfc_check_vardef_context): Check appropriate pointer
1470 attribute for CLASS vs. non-CLASS function result in variable
1473 2023-05-11 Xi Ruoyao <xry111@xry111.site>
1475 * Make-lang.in: Use grep instead of fgrep.
1477 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1479 * dump-parse-tree.cc (gfc_debug_expr): Remove forward declaration.
1480 (debug): Add DEBUG_FUNCTION.
1481 (show_code_node): Remove erroneous whitespace.
1483 2023-05-10 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1486 * dump-parse-tree.cc (debug): New function for gfc_namespace.
1487 (gfc_debug_code): Delete forward declaration.
1488 (show_attr): Make sure to print balanced braces.
1490 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1492 * resolve.cc (resolve_select_type): Fix coding style.
1494 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1496 * resolve.cc (resolve_select_type): Call free() unconditionally.
1498 2023-05-08 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
1501 * expr.cc (find_array_section): Fix mpz memory leak.
1502 * simplify.cc (gfc_simplify_reshape): Fix mpz memory leaks in
1505 2023-05-05 Harald Anlauf <anlauf@gmx.de>
1508 * arith.cc (eval_intrinsic): Check conformability of ranks of operands
1509 for intrinsic binary operators before performing type conversions.
1510 * gfortran.h (gfc_op_rank_conformable): Add prototype.
1511 * resolve.cc (resolve_operator): Check conformability of ranks of
1512 operands for intrinsic binary operators before performing type
1514 (gfc_op_rank_conformable): New helper function to compare ranks of
1515 operands of binary operator.
1517 2023-05-04 Julian Brown <julian@codesourcery.com>
1520 * openmp.cc (resolve_omp_clauses): Add diagnostic for
1521 non-pointer/non-allocatable attach/detach.
1522 * trans-openmp.cc (gfc_trans_omp_clauses): Remove dereference for
1523 pointer-to-scalar derived type component attach/detach. Fix
1524 attach/detach handling for descriptors.
1526 2023-04-28 Julian Brown <julian@codesourcery.com>
1529 * trans-openmp.cc (gfc_trans_omp_clauses): Attach/detach clause fixes.
1531 2023-04-28 Tobias Burnus <tobias@codesourcery.com>
1533 * gfortran.texi: Fix typos.
1534 * decl.cc: Fix typos in comments and in a variable name.
1535 * arith.cc: Fix comment typos.
1536 * check.cc: Likewise.
1537 * class.cc: Likewise.
1538 * dependency.cc: Likewise.
1539 * expr.cc: Likewise.
1540 * frontend-passes.cc: Likewise.
1541 * gfortran.h: Likewise.
1542 * intrinsic.cc: Likewise.
1543 * iresolve.cc: Likewise.
1544 * match.cc: Likewise.
1545 * module.cc: Likewise.
1546 * primary.cc: Likewise.
1547 * resolve.cc: Likewise.
1548 * simplify.cc: Likewise.
1549 * trans-array.cc: Likewise.
1550 * trans-decl.cc: Likewise.
1551 * trans-expr.cc: Likewise.
1552 * trans-intrinsic.cc: Likewise.
1553 * trans-openmp.cc: Likewise.
1554 * trans-stmt.cc: Likewise.
1556 2023-04-25 Tobias Burnus <tobias@codesourcery.com>
1558 * openmp.cc (gfc_resolve_omp_do_blocks): Handle zero
1559 or more than one exec statements before/after 'omp scan'.
1560 * trans-openmp.cc (gfc_trans_omp_do): Likewise.
1562 2023-04-22 Harald Anlauf <anlauf@gmx.de>
1563 Steven G. Kargl <kargl@gcc.gnu.org>
1566 * interface.cc (gfc_compare_actual_formal): Reject allocatable
1567 functions being used as actual argument for allocable dummy.
1569 2023-04-14 Harald Anlauf <anlauf@gmx.de>
1572 * simplify.cc (gfc_simplify_set_exponent): Fix implementation of
1573 compile-time simplification of intrinsic SET_EXPONENT for argument
1574 X < 1 and for I < 0.
1576 2023-04-14 Paul Thomas <pault@gcc.gnu.org>
1579 * gfortran.h : Add expr3_not_explicit bit field to gfc_code.
1580 * resolve.cc (resolve_allocate_expr): Set bit field when the
1581 default initializer is applied to expr3.
1582 * trans-stmt.cc (gfc_trans_allocate): If expr3_not_explicit is
1583 set, do not deallocate expr3.
1585 2023-04-13 Harald Anlauf <anlauf@gmx.de>
1588 * trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
1589 unsigned HOST_WIDE_INT for portability.
1591 2023-04-12 Harald Anlauf <anlauf@gmx.de>
1594 * resolve.cc (resolve_entries): Handle functions with ENTRY and
1595 ALLOCATABLE results.
1596 * trans-expr.cc (gfc_conv_procedure_call): Functions with a result
1597 with the POINTER or ALLOCATABLE attribute shall not get any special
1598 treatment with -ff2c, as they cannot be written in Fortran 77.
1599 * trans-types.cc (gfc_return_by_reference): Likewise.
1600 (gfc_get_function_type): Likewise.
1602 2023-04-12 Harald Anlauf <anlauf@gmx.de>
1606 * interface.cc (compare_parameter): Enable type and rank checks for
1607 arguments of derived type from the intrinsic module ISO_C_BINDING.
1609 2023-04-08 Paul Thomas <pault@gcc.gnu.org>
1612 * iresolve.cc (gfc_resolve_adjustl, gfc_resolve_adjustr): if
1613 string length is deferred use the string typespec for result.
1614 * resolve.cc (resolve_assoc_var): Handle parentheses around the
1616 (resolve_block_construct): Remove unnecessary static decls.
1617 * trans-array.cc (gfc_conv_expr_descriptor): Guard string len
1618 expression in condition. Improve handling of string length and
1619 span, especially for substrings of the descriptor.
1620 (duplicate_allocatable): Make element type more explicit with
1622 * trans-decl.cc (gfc_get_symbol_decl): Emit a fatal error with
1623 appropriate message instead of ICE if symbol type is unknown.
1624 (gfc_generate_function_code): Set current locus to proc_sym
1626 * trans-expr.cc (gfc_get_expr_charlen): Retain last charlen in
1627 'previous' and use if end expression in substring reference is
1629 (gfc_conv_string_length): Use gfc_conv_expr_descriptor if
1630 'expr_flat' is an array. Add post block to catch deallocation
1632 (gfc_conv_procedure_call): Assign the parmse string length to
1633 the expression string length, if it is deferred.
1634 (gfc_trans_alloc_subarray_assign): If this is a deferred string
1635 length component, store the string length in the hidden comp.
1636 Update the typespec length accordingly. Generate a new type
1637 spec for the call to gfc_duplicate-allocatable in this case.
1638 * trans-io.cc (gfc_trans_transfer): Scalarize transfer of
1639 deferred character array components.
1641 2023-04-04 Harald Anlauf <anlauf@gmx.de>
1644 * expr.cc (check_restricted): Adjust check for valid variables in
1645 restricted expressions: make no exception for module variables.
1647 2023-04-01 Thomas Koenig <tkoenig@gcc.gnu.org>
1649 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
1650 type name to be "long long".
1652 2023-03-30 Andrew Pinski <apinski@marvell.com>
1654 * dump-parse-tree.cc (get_c_type_name): Fix "long_long"
1655 type name to be "long long". Add a comment on why adding
1658 2023-03-28 Jakub Jelinek <jakub@redhat.com>
1661 * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
1662 - composit -> composite.
1664 2023-03-25 Harald Anlauf <anlauf@gmx.de>
1667 * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
1669 2023-03-24 Harald Anlauf <anlauf@gmx.de>
1671 * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
1673 2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
1674 Tobias Burnus <tobias@codesourcery.com>
1677 * target-memory.cc (gfc_interpret_float): Return FAIL when
1678 native_interpret_expr gets a NULL tree.
1679 * arith.cc (gfc_hollerith2real): Return NULL when
1680 gfc_interpret_float fails.
1681 * error.cc (gfc_buffered_p): Define.
1682 * gfortran.h (gfc_buffered_p): Declare.
1683 * intrinsic.cc: Add diagnostic.h to include list.
1684 (do_simplify): Save errorcount and check it at finish. Report a
1685 "Cannot simplify expression" error on a bad result if error count
1686 doesn't change and no other errors buffered.
1688 2023-03-22 Harald Anlauf <anlauf@gmx.de>
1689 Steven G. Kargl <kargl@gcc.gnu.org>
1692 * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
1693 cannot be an alternate return.
1695 2023-03-21 Harald Anlauf <anlauf@gmx.de>
1698 * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
1699 generic module interface.
1701 2023-03-21 Arsen Arsenović <arsen@aarsen.me>
1703 * invoke.texi: Remove usages of @gol.
1704 * intrinsic.texi: Ditto.
1706 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
1709 * trans-array.cc (gfc_trans_array_constructor_value): Correct
1710 incorrect setting of typespec.
1712 2023-03-21 Paul Thomas <pault@gcc.gnu.org>
1715 * resolve.cc (generate_component_assignments): Restore the
1716 exclusion of allocatable components from the loop.
1718 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1721 * invoke.texi: Correct documentation of how underscores are appended
1724 2023-03-20 Harald Anlauf <anlauf@gmx.de>
1727 * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
1728 up real kind-specific maximum exponent for mpfr.
1730 2023-03-20 Paul Thomas <pault@gcc.gnu.org>
1733 * resolve.cc (check_host_association): If an external function
1734 is typed but not declared explicitly to be external, change the
1735 old symbol from a variable to an external function.
1737 2023-03-19 Harald Anlauf <anlauf@gmx.de>
1740 * resolve.cc (resolve_fl_procedure): Check for an explicit interface
1741 of procedures with the BIND(C) attribute (F2018:15.4.2.2).
1743 2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
1745 * gfortran.texi: Mention behavior on overflow.
1747 2023-03-18 Paul Thomas <pault@gcc.gnu.org>
1752 * class.cc (finalize_component): Include the missing arguments
1753 in the call to the component's finalizer wrapper.
1754 (has_finalizer_component): Do not return true for procedure
1756 (finalizer_insert_packed_call): Remove the redundant argument
1757 in the call to the final subroutine.
1758 (generate_finalization_wrapper): Add support for assumed rank
1760 (gfc_may_be_finalized): New helper function.
1761 * dump-parse-tree.cc (write_proc): Whitespace.
1762 * gfortran.h : Add prototype for gfc_may_be_finalized.
1763 * resolve.cc (resolve_function): Correct derived types that
1764 have an incomplete namespace.
1765 (resolve_where, gfc_resolve_where_code_in_forall,
1766 gfc_resolve_forall_body, gfc_resolve_code): Check that the op
1767 code is still EXEC_ASSIGN. If it is set lhs to must finalize.
1768 (is_finalizable_type): New function.
1769 (generate_component_assignments): Set must_finalize if needed.
1770 (gfc_resolve_finalizers): Error if assumed rank finalizer is
1771 not the only one. Warning on lack of scalar finalizer modified
1772 to account for assumed rank finalizers.
1773 (generate_final_call): New function.
1774 (generate_component_assignments): Enclose the outermost call in
1775 a block to capture automatic deallocation and final calls.
1776 Set must_finalize as required to satisfy the standards. Use an
1777 explicit pointer assignment for pointer components to capture
1778 finalization of the target. Likewise use explicit assignment
1779 for allocatable components. Do not use the temporary copy of
1780 the lhs in defined assignment if the component is allocatable.
1781 Put the temporary in the same namespace as the lhs symbol if
1782 the component may be finalized. Remove the leading assignment
1783 from the expansion of assignment of components that have their
1784 own defined assignment components. Suppress finalization of
1785 assignment of temporary components to the lhs. Make an explicit
1786 final call for the rhs function temporary if it exists.
1787 (gfc_resolve_code): Set must_finalize for assignments with an
1788 array constructor on the rhs.
1789 (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
1790 is the only finalizer for that type and correct the surprising
1791 warning for the lack of a scalar finalizer.
1792 (check_defined_assignments): Handle allocatable components.
1793 (resolve_fl_derived): Set referenced the vtab for use
1795 (resolve_symbol): Set referenced an unreferenced symbol that
1797 * trans-array.cc (gfc_trans_array_constructor_value): Add code
1798 to finalize the constructor result. Warn that this feature was
1799 removed in F2018 and that it is suppressed by -std=2018.
1800 (trans_array_constructor): Add finalblock, pass to previous
1801 and apply to loop->post if filled.
1802 (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
1803 (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
1804 generated finalization code to the main block.
1805 (structure_alloc_comps): Add boolean argument to suppress
1806 finalization and use it for calls from
1807 gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
1809 (gfc_copy_alloc_comp_no_fini): New wrapper for
1810 structure_alloc_comps.
1811 (gfc_alloc_allocatable_for_assignment): Suppress finalization
1812 by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
1813 (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
1814 deallocate the components of entities with a leading '_' in the
1815 name that are also marked as artificial.
1816 * trans-array.h : Add the new boolean argument to the prototype
1817 of gfc_deallocate_alloc_comp_no_caf with a default of false.
1818 Add prototype for gfc_copy_alloc_comp_no_fini.
1819 * trans-decl.cc(init_intent_out_dt): Tidy up the code.
1820 * trans-expr.cc (gfc_init_se): Initialize finalblock.
1821 (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
1822 finalize function results. Replace in-line block for class
1823 results with call to new function.
1824 (gfc_conv_expr): Finalize structure constructors for F2003 and
1825 F2008. Warn that this feature was deleted in F2018 and, unlike
1826 array constructors, is not default. Add array constructor
1827 finalblock to the post block.
1828 (gfc_trans_scalar_assign): Suppress finalization by setting new
1829 argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
1830 finalization blocks to the main block.
1831 (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
1832 and ensure that finalization occurs after the evaluation of the
1833 rhs but using the initial value for the lhs. Finalize rhs
1834 function results using gfc_finalize_tree_expr.
1835 (trans_class_assignment, gfc_trans_assignment_1): As previous
1836 function, taking care to order evaluation, assignment and
1837 finalization correctly.
1838 * trans-io.cc (gfc_trans_transfer): Add the final block.
1839 * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
1840 (trans_associate_var): Nullify derived allocatable components
1841 and finalize function targets with defined assignment
1842 components on leaving the block scope.
1843 (trans_allocate): Finalize source expressions, if required,
1844 and set init_expr artificial temporarily to suppress the
1845 finalization in gfc_trans_assignment.
1846 * trans.cc (gfc_add_finalizer_call): Do not finalize the
1847 temporaries generated in type assignment with defined
1848 assignment components.
1849 (gfc_assignment_finalizer_call): New function.
1850 (gfc_finalize_tree_expr): New function.
1851 * trans.h: Add finalblock to gfc_se. Add the prototypes for
1852 gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
1854 2023-03-15 Harald Anlauf <anlauf@gmx.de>
1855 Tobias Burnus <tobias@codesourcery.com>
1858 * interface.cc (compare_parameter): Adjust check of array dummy
1859 arguments to handle the case of CLASS variables.
1861 2023-03-11 Harald Anlauf <anlauf@gmx.de>
1864 * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
1865 bounds check to common type for comparison.
1867 2023-03-10 Harald Anlauf <anlauf@gmx.de>
1870 * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
1871 checking a symbol with the BIND(C) attribute.
1873 2023-03-05 Harald Anlauf <anlauf@gmx.de>
1874 Tobias Burnus <tobias@codesourcery.com>
1877 * class.cc (gfc_build_class_symbol): Handle update of attributes of
1878 existing class container.
1879 (gfc_find_derived_vtab): Fix several memory leaks.
1880 (find_intrinsic_vtab): Ditto.
1881 * decl.cc (attr_decl1): Manage update of symbol attributes from
1883 * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
1884 updated from the class container.
1885 * symbol.cc (free_old_symbol): Adjust management of symbol versions
1886 to not prematurely free array specs while working on the declation
1889 2023-03-01 Tobias Burnus <tobias@codesourcery.com>
1891 PR middle-end/108546
1892 * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
1893 type(C_ptr) variables.
1895 2023-02-27 Harald Anlauf <anlauf@gmx.de>
1898 * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
1899 LEN argument of IBITS equal to BITSIZE(I).
1901 2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
1904 * intrinsic.cc (get_intrinsic_dummy_arg,
1905 set_intrinsic_dummy_arg): Rename the former to the latter.
1906 Remove the return value, add a reference to the lhs as argument,
1907 and do the pointer assignment inside the function. Don't do
1908 it if the pointer is already non-NULL.
1909 (sort_actual): Update caller.
1911 2023-02-25 Harald Anlauf <anlauf@gmx.de>
1913 * arith.cc (gfc_real2int): Clear mpfr variable after use.
1915 2023-02-25 Tobias Burnus <tobias@codesourcery.com>
1918 * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
1919 bounds of CFI desc for 'pointer,intent(out)'.
1921 2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1923 * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
1924 (generate_local_decl): Add diagnostic for dummy and local variables.
1926 2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
1929 * expr.cc (gfc_free_actual_arglist): Free associated_dummy
1931 (gfc_copy_actual_arglist): Make a copy of the associated_dummy
1932 field if it is set in the original element.
1934 2023-02-24 Harald Anlauf <anlauf@gmx.de>
1937 * frontend-passes.cc (do_subscript): Clear used gmp variable.
1939 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1941 * invoke.texi: Reorder index entries around @items.
1943 2023-02-23 Arsen Arsenović <arsen@aarsen.me>
1945 * invoke.texi: Reorder @opindex commands to precede @items they
1948 2023-02-22 Harald Anlauf <anlauf@gmx.de>
1951 * resolve.cc (resolve_component): The type of a CHARACTER length
1952 expression must be INTEGER.
1954 2023-02-21 Harald Anlauf <anlauf@gmx.de>
1957 * parse.cc (check_function_result_typed): Improve type check of
1958 specification expression for character length and return status.
1959 (parse_spec): Use status from above.
1960 * resolve.cc (resolve_fntype): Prevent use of invalid specification
1961 expression for character length.
1963 2023-02-16 Patrick Palka <ppalka@redhat.com>
1965 * gfortran.h: Mechanically drop static from static inline
1966 functions via s/^static inline/inline/g.
1968 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1971 * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
1972 reference to invalid formal argument.
1974 2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
1977 * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
1980 2023-02-15 Tobias Burnus <tobias@codesourcery.com>
1983 * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
1985 (gfc_resolve_do_iterator): Set a source location for added
1986 'private'-clause arguments.
1987 * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
1988 also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
1989 combined directives with loop + '{masked,master} taskloop (simd)'.
1991 2023-02-13 Harald Anlauf <anlauf@gmx.de>
1994 * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
1995 invalid use of CLASS variable.
1997 2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
1999 * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
2000 * gfortran.h (ext_attr_id_t): Ditto.
2001 * gfortran.texi (GCC$ ATTRIBUTES): Document them.
2002 * trans-decl.cc (build_function_decl): Apply them.
2004 2023-02-09 Harald Anlauf <anlauf@gmx.de>
2005 Steven G. Kargl <kargl@gcc.gnu.org>
2009 * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
2010 kind in conversion instead of generating an internal error.
2012 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
2015 * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
2016 'non_unit_incr' members.
2017 (gfc_nonrect_loop_expr): New.
2018 (gfc_trans_omp_do): Call it; use normal loop bounds
2019 for unit stride - and only create local loop var.
2021 2023-02-09 Tobias Burnus <tobias@codesourcery.com>
2023 * parse.cc (decode_omp_directive): Really ignore 'assumes' with
2026 2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
2029 * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
2030 when a symbol's location is not set.
2032 2023-02-07 Harald Anlauf <anlauf@gmx.de>
2035 * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
2036 make ASSOCIATE variables TREE_STATIC.
2038 2023-02-05 Harald Anlauf <anlauf@gmx.de>
2041 * arith.cc (gfc_arith_divide): Emit integer division truncation
2042 warnings using gfc_warning instead of gfc_warning_now to prevent
2045 2023-02-03 Jakub Jelinek <jakub@redhat.com>
2048 * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
2051 2023-02-01 Harald Anlauf <anlauf@gmx.de>
2054 * expr.cc (find_array_section): Add check to prevent interpreting an
2055 mpz non-integer constant as an integer.
2057 2023-02-01 Tobias Burnus <tobias@codesourcery.com>
2059 * openmp.cc (resolve_omp_clauses): Check also for
2062 2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
2065 * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
2066 (gfc_check_findloc): Ditto.
2068 2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2071 * parse.cc (parse_module): Remove use of a bool error value
2072 that prevented proper setting of the namespace pointer.
2074 2023-01-28 Harald Anlauf <anlauf@gmx.de>
2075 Steven G. Kargl <kargl@gcc.gnu.org>
2078 * resolve.cc (compare_bound_int): Expression to compare must be of
2080 (compare_bound_mpz_t): Likewise.
2081 (check_dimension): Fix comment on checks applied to array section
2082 and clean up associated logic.
2084 2023-01-28 Harald Anlauf <anlauf@gmx.de>
2087 * match.cc (gfc_match_common): A USE associated name shall not appear
2088 in a COMMON block (F2018:C8121).
2090 2023-01-27 Tobias Burnus <tobias@codesourcery.com>
2093 * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
2095 2023-01-26 Harald Anlauf <anlauf@gmx.de>
2098 * resolve.cc (check_host_association): Extend host association check
2099 so that it is not restricted to functions. Also prevent NULL pointer
2102 2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
2105 * array.cc (compare_bounds): Return false instead of generating an
2106 internal error on an invalid argument type.
2108 2023-01-24 Harald Anlauf <anlauf@gmx.de>
2111 * simplify.cc (simplify_transformation): Do not try to simplify
2112 transformational intrinsic when the ARRAY argument has a NULL shape.
2114 2023-01-23 Harald Anlauf <anlauf@gmx.de>
2117 * dependency.cc (gfc_check_dependency): Prevent NULL pointer
2118 dereference while recursively checking expressions.
2120 2023-01-23 Harald Anlauf <anlauf@gmx.de>
2123 * interface.cc (get_expr_storage_size): Check array subscript triplets
2124 that we actually have integer values before trying to extract with
2127 2023-01-23 Harald Anlauf <anlauf@gmx.de>
2130 * iresolve.cc (check_charlen_present): Preserve character length if
2131 there is no array constructor.
2133 2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
2136 * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
2137 * primary.cc (match_variable): Add check for PARAMETER in DATA.
2139 2023-01-19 Harald Anlauf <anlauf@gmx.de>
2142 * expr.cc (class_allocatable): Prevent NULL pointer dereference
2144 (class_pointer): Likewise.
2146 2023-01-17 Harald Anlauf <anlauf@gmx.de>
2149 * interface.cc (get_expr_storage_size): Check that we actually have
2150 an integer value before trying to extract it with mpz_get_si.
2152 2023-01-12 Tobias Burnus <tobias@codesourcery.com>
2155 * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
2157 2023-01-11 Jakub Jelinek <jakub@redhat.com>
2160 * f95-lang.cc (gfc_init_builtin_function): Fix up function types
2161 for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
2163 2023-01-10 Harald Anlauf <anlauf@gmx.de>
2166 * frontend-passes.cc (do_subscript): Clear used gmp variables.
2168 2023-01-02 Jakub Jelinek <jakub@redhat.com>
2170 * gfortranspec.cc (lang_specific_driver): Update copyright notice
2172 * gfc-internals.texi: Bump @copying's copyright year.
2173 * gfortran.texi: Ditto.
2174 * intrinsic.texi: Ditto.
2175 * invoke.texi: Ditto.
2178 Copyright (C) 2023 Free Software Foundation, Inc.
2180 Copying and distribution of this file, with or without modification,
2181 are permitted in any medium without royalty provided the copyright
2182 notice and this notice are preserved.