aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-03-29 09:01:23 -0700
committerIan Lance Taylor <iant@golang.org>2023-03-29 09:01:23 -0700
commit6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced (patch)
tree1deecdcfbf185c7044bc861d0ace51285c96cb62 /gcc/fortran
parent795cffe109e28b248a54b8ee583cbae48368c2a7 (diff)
parentaa8f4242efc99f24de73c59d53996f28db28c13f (diff)
downloadgcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.zip
gcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.tar.gz
gcc-6612f4f8cb9b0d5af18ec69ad04e56debc3e6ced.tar.bz2
Merge from trunk revision aa8f4242efc99f24de73c59d53996f28db28c13f.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog1670
-rw-r--r--gcc/fortran/ChangeLog-20224484
-rw-r--r--gcc/fortran/Make-lang.in2
-rw-r--r--gcc/fortran/arith.cc156
-rw-r--r--gcc/fortran/arith.h2
-rw-r--r--gcc/fortran/array.cc29
-rw-r--r--gcc/fortran/bbt.cc2
-rw-r--r--gcc/fortran/check.cc4
-rw-r--r--gcc/fortran/class.cc108
-rw-r--r--gcc/fortran/config-lang.in2
-rw-r--r--gcc/fortran/constructor.cc2
-rw-r--r--gcc/fortran/constructor.h2
-rw-r--r--gcc/fortran/convert.cc2
-rw-r--r--gcc/fortran/cpp.cc4
-rw-r--r--gcc/fortran/cpp.h2
-rw-r--r--gcc/fortran/data.cc9
-rw-r--r--gcc/fortran/data.h2
-rw-r--r--gcc/fortran/decl.cc92
-rw-r--r--gcc/fortran/dependency.cc7
-rw-r--r--gcc/fortran/dependency.h2
-rw-r--r--gcc/fortran/dump-parse-tree.cc70
-rw-r--r--gcc/fortran/error.cc13
-rw-r--r--gcc/fortran/expr.cc31
-rw-r--r--gcc/fortran/f95-lang.cc42
-rw-r--r--gcc/fortran/frontend-passes.cc23
-rw-r--r--gcc/fortran/gfc-diagnostic.def2
-rw-r--r--gcc/fortran/gfc-internals.texi2
-rw-r--r--gcc/fortran/gfortran.h73
-rw-r--r--gcc/fortran/gfortran.texi30
-rw-r--r--gcc/fortran/gfortranspec.cc4
-rw-r--r--gcc/fortran/interface.cc119
-rw-r--r--gcc/fortran/intrinsic.cc26
-rw-r--r--gcc/fortran/intrinsic.h2
-rw-r--r--gcc/fortran/intrinsic.texi784
-rw-r--r--gcc/fortran/invoke.texi402
-rw-r--r--gcc/fortran/io.cc4
-rw-r--r--gcc/fortran/ioparm.def2
-rw-r--r--gcc/fortran/iresolve.cc11
-rw-r--r--gcc/fortran/iso-c-binding.def2
-rw-r--r--gcc/fortran/iso-fortran-env.def2
-rw-r--r--gcc/fortran/lang-specs.h2
-rw-r--r--gcc/fortran/lang.opt2
-rw-r--r--gcc/fortran/libgfortran.h2
-rw-r--r--gcc/fortran/match.cc45
-rw-r--r--gcc/fortran/match.h4
-rw-r--r--gcc/fortran/matchexp.cc2
-rw-r--r--gcc/fortran/mathbuiltins.def2
-rw-r--r--gcc/fortran/misc.cc2
-rw-r--r--gcc/fortran/module.cc2
-rw-r--r--gcc/fortran/openmp.cc811
-rw-r--r--gcc/fortran/options.cc2
-rw-r--r--gcc/fortran/parse.cc115
-rw-r--r--gcc/fortran/parse.h4
-rw-r--r--gcc/fortran/primary.cc21
-rw-r--r--gcc/fortran/resolve.cc521
-rw-r--r--gcc/fortran/scanner.cc2
-rw-r--r--gcc/fortran/scanner.h2
-rw-r--r--gcc/fortran/simplify.cc51
-rw-r--r--gcc/fortran/st.cc5
-rw-r--r--gcc/fortran/symbol.cc26
-rw-r--r--gcc/fortran/target-memory.cc13
-rw-r--r--gcc/fortran/target-memory.h2
-rw-r--r--gcc/fortran/trans-array.cc347
-rw-r--r--gcc/fortran/trans-array.h9
-rw-r--r--gcc/fortran/trans-common.cc2
-rw-r--r--gcc/fortran/trans-const.cc2
-rw-r--r--gcc/fortran/trans-const.h2
-rw-r--r--gcc/fortran/trans-decl.cc131
-rw-r--r--gcc/fortran/trans-expr.cc442
-rw-r--r--gcc/fortran/trans-intrinsic.cc15
-rw-r--r--gcc/fortran/trans-io.cc3
-rw-r--r--gcc/fortran/trans-openmp.cc347
-rw-r--r--gcc/fortran/trans-stmt.cc53
-rw-r--r--gcc/fortran/trans-stmt.h2
-rw-r--r--gcc/fortran/trans-types.cc33
-rw-r--r--gcc/fortran/trans-types.h2
-rw-r--r--gcc/fortran/trans.cc284
-rw-r--r--gcc/fortran/trans.h13
-rw-r--r--gcc/fortran/trigd_fe.inc2
-rw-r--r--gcc/fortran/types.def2
80 files changed, 8783 insertions, 2773 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index a53df93..ff39055 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,1386 +1,516 @@
-2022-09-20 Tobias Burnus <tobias@codesourcery.com>
+2023-03-28 Jakub Jelinek <jakub@redhat.com>
- PR fortran/104143
- * interface.cc (compare_parameter): Permit scalar args to
- 'type(*), dimension(*)'.
+ PR fortran/109314
+ * openmp.cc (gfc_omp_absent_contains_clause): Fix typo in diagnostics
+ - composit -> composite.
-2022-09-20 Harald Anlauf <anlauf@gmx.de>
+2023-03-25 Harald Anlauf <anlauf@gmx.de>
- PR fortran/106986
- * simplify.cc (gfc_simplify_findloc): Do not try to simplify
- intrinsic FINDLOC when the ARRAY argument has a NULL shape.
+ PR fortran/104321
+ * trans-decl.cc (gfc_conv_cfi_to_gfc): Remove dead code.
-2022-09-20 Harald Anlauf <anlauf@gmx.de>
+2023-03-24 Harald Anlauf <anlauf@gmx.de>
- PR fortran/106985
- * expr.cc (gfc_simplify_expr): Avoid NULL pointer dereference.
+ * expr.cc (free_expr0): Free also BOZ strings as part of an expression.
-2022-09-20 José Rui Faustino de Sousa <jrfsousa@gmail.com>
-
- PR fortran/100132
- * trans-types.cc (create_fn_spec): Fix function attributes when
- passing polymorphic pointers.
-
-2022-09-20 Martin Liska <mliska@suse.cz>
-
- PR fortran/106636
- * gfortran.texi: Add back link to ISO_VARYING_STRING.
-
-2022-09-20 Martin Liska <mliska@suse.cz>
-
- * gfortran.texi: Replace "the the" with "the".
-
-2022-09-20 Martin Liska <mliska@suse.cz>
-
- PR fortran/106636
- * gfortran.texi: Remove 2 dead links.
-
-2022-09-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
-
- * libgfortran.h: Declare GFC_FPE_AWAY.
-
-2022-09-15 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/106857
- * simplify.cc (gfc_simplify_pack): Check for NULL pointer dereferences
- while walking through constructors (error recovery).
-
-2022-09-15 Harald Anlauf <anlauf@gmx.de>
- Steven G. Kargl <kargl@gcc.gnu.org>
+2023-03-24 Haochen Gui <guihaoc@gcc.gnu.org>
+ Tobias Burnus <tobias@codesourcery.com>
- PR fortran/104314
- * resolve.cc (deferred_op_assign): Do not try to generate temporary
- for deferred character length assignment if types do not agree.
-
-2022-09-15 Richard Biener <rguenther@suse.de>
-
- * f95-lang.cc (gfc_init_decl_processing): Do not initialize
- void_list_node.
-
-2022-09-14 Julian Brown <julian@codesourcery.com>
-
- * trans-openmp.cc (gfc_trans_omp_clauses): Don't create
- GOMP_MAP_TO_PSET mappings for class metadata, nor GOMP_MAP_POINTER
- mappings for POINTER_TYPE_P decls.
-
-2022-09-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
-
- PR fortran/95644
- * f95-lang.cc (gfc_init_builtin_functions): Declare FMA
- built-ins.
- * mathbuiltins.def: Declare FMA built-ins.
- * trans-intrinsic.cc (conv_intrinsic_ieee_fma): New function.
- (conv_intrinsic_ieee_signbit): New function.
- (gfc_build_intrinsic_lib_fndecls): Add cases for FMA and
- SIGNBIT.
-
-2022-09-08 Tobias Burnus <tobias@codesourcery.com>
-
- PR fortran/106670
- * scanner.cc (skip_fixed_omp_sentinel): Add -Wsurprising warning
- for 'omx' sentinels with -fopenmp.
- * invoke.texi (-Wsurprising): Document additional warning case.
-
-2022-09-06 Tobias Burnus <tobias@codesourcery.com>
-
- * openmp.cc (resolve_omp_clauses): Remove ordered/linear
- check as it is handled now in the middle end.
-
-2022-09-05 Tobias Burnus <tobias@codesourcery.com>
-
- * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle
- omp_cur_iteration and distinguish doacross/depend.
- * gfortran.h (enum gfc_omp_depend_doacross_op): Renamed from
- gfc_omp_depend_op.
- (enum gfc_omp_depend_doacross_op): Add OMP_DOACROSS_SINK_FIRST,
- Rename OMP_DEPEND_SINK to OMP_DOACROSS_SINK.
- (gfc_omp_namelist) Handle renaming, rename depend_op to
- depend_doacross_op.
- (struct gfc_omp_clauses): Add doacross_source.
- * openmp.cc (gfc_match_omp_depend_sink): Renamed to ...
- (gfc_match_omp_doacross_sink): ... this; handle omp_all_memory.
- (enum omp_mask2): Add OMP_CLAUSE_DOACROSS.
- (gfc_match_omp_clauses): Handle 'doacross' and syntax changes to
- depend.
- (gfc_match_omp_depobj): Simplify as sink/source are now impossible.
- (gfc_match_omp_ordered_depend): Request OMP_CLAUSE_DOACROSS.
- (resolve_omp_clauses): Update sink/source checks.
- (gfc_resolve_omp_directive): Resolve EXEC_OMP_ORDERED clauses.
- * parse.cc (decode_omp_directive): Handle 'ordered doacross'.
- * trans-openmp.cc (gfc_trans_omp_clauses): Handle doacross.
- (gfc_trans_omp_do): Fix OMP_FOR_ORIG_DECLS handling if 'ordered'
- clause is present.
- (gfc_trans_omp_depobj): Update for member name change.
-
-2022-09-04 José Rui Faustino de Sousa <jrfsousa@gmail.com>
-
- PR fortran/100136
- * trans-expr.cc (gfc_conv_procedure_call): Add handling of pointer
- expressions.
-
-2022-09-03 José Rui Faustino de Sousa <jrfsousa@gmail.com>
-
- PR fortran/100245
- * trans-expr.cc (trans_class_assignment): Add if clause to handle
- derived type in the LHS.
-
-2022-09-03 Jakub Jelinek <jakub@redhat.com>
-
- * trans-openmp.cc (gfc_trans_omp_clauses): Use
- OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
- OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS
- clause instead of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND
- on it.
-
-2022-09-02 Harald Anlauf <anlauf@gmx.de>
+ PR target/103628
+ * target-memory.cc (gfc_interpret_float): Return FAIL when
+ native_interpret_expr gets a NULL tree.
+ * arith.cc (gfc_hollerith2real): Return NULL when
+ gfc_interpret_float fails.
+ * error.cc (gfc_buffered_p): Define.
+ * gfortran.h (gfc_buffered_p): Declare.
+ * intrinsic.cc: Add diagnostic.h to include list.
+ (do_simplify): Save errorcount and check it at finish. Report a
+ "Cannot simplify expression" error on a bad result if error count
+ doesn't change and no other errors buffered.
+
+2023-03-22 Harald Anlauf <anlauf@gmx.de>
Steven G. Kargl <kargl@gcc.gnu.org>
- PR fortran/99349
- * decl.cc (match_data_constant): Avoid NULL pointer dereference.
-
-2022-08-26 Jakub Jelinek <jakub@redhat.com>
-
- PR fortran/106579
- * trans-intrinsic.cc: Include realmpfr.h.
- (conv_intrinsic_ieee_value): New function.
- (gfc_conv_ieee_arithmetic_function): Handle ieee_value.
+ PR fortran/104572
+ * resolve.cc (gfc_resolve_finalizers): Argument of a FINAL subroutine
+ cannot be an alternate return.
-2022-08-26 Jakub Jelinek <jakub@redhat.com>
+2023-03-21 Harald Anlauf <anlauf@gmx.de>
- PR fortran/106579
- * f95-lang.cc (gfc_init_builtin_functions): Initialize
- BUILT_IN_FPCLASSIFY.
- * libgfortran.h (IEEE_OTHER_VALUE, IEEE_SIGNALING_NAN,
- IEEE_QUIET_NAN, IEEE_NEGATIVE_INF, IEEE_NEGATIVE_NORMAL,
- IEEE_NEGATIVE_DENORMAL, IEEE_NEGATIVE_SUBNORMAL,
- IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO, IEEE_POSITIVE_DENORMAL,
- IEEE_POSITIVE_SUBNORMAL, IEEE_POSITIVE_NORMAL, IEEE_POSITIVE_INF):
- New enum.
- * trans-intrinsic.cc (conv_intrinsic_ieee_class): New function.
- (gfc_conv_ieee_arithmetic_function): Handle ieee_class.
+ PR fortran/99036
+ * decl.cc (gfc_match_modproc): Reject MODULE PROCEDURE if not in a
+ generic module interface.
-2022-08-26 Jakub Jelinek <jakub@redhat.com>
+2023-03-21 Arsen Arsenović <arsen@aarsen.me>
- * f95-lang.cc (gfc_init_builtin_functions): Initialize
- BUILT_IN_ISSIGNALING.
-
-2022-08-25 Tobias Burnus <tobias@codesourcery.com>
+ * invoke.texi: Remove usages of @gol.
+ * intrinsic.texi: Ditto.
- * parse.cc (parse_omp_structured_block): When parsing strictly
- structured blocks, issue an error if the end-directive comes
- before the 'end block'.
+2023-03-21 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/109206
+ * trans-array.cc (gfc_trans_array_constructor_value): Correct
+ incorrect setting of typespec.
+
+2023-03-21 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/109209
+ * resolve.cc (generate_component_assignments): Restore the
+ exclusion of allocatable components from the loop.
+
+2023-03-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/109216
+ * invoke.texi: Correct documentation of how underscores are appended
+ to external names.
+
+2023-03-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/109186
+ * simplify.cc (gfc_simplify_nearest): Fix off-by-one error in setting
+ up real kind-specific maximum exponent for mpfr.
+
+2023-03-20 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/87127
+ * resolve.cc (check_host_association): If an external function
+ is typed but not declared explicitly to be external, change the
+ old symbol from a variable to an external function.
+
+2023-03-19 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/85877
+ * resolve.cc (resolve_fl_procedure): Check for an explicit interface
+ of procedures with the BIND(C) attribute (F2018:15.4.2.2).
+
+2023-03-19 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * gfortran.texi: Mention behavior on overflow.
+
+2023-03-18 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/103854
+ PR fortran/96122
+ PR fortran/37336
+ * class.cc (finalize_component): Include the missing arguments
+ in the call to the component's finalizer wrapper.
+ (has_finalizer_component): Do not return true for procedure
+ pointer components.
+ (finalizer_insert_packed_call): Remove the redundant argument
+ in the call to the final subroutine.
+ (generate_finalization_wrapper): Add support for assumed rank
+ finalizers.
+ (gfc_may_be_finalized): New helper function.
+ * dump-parse-tree.cc (write_proc): Whitespace.
+ * gfortran.h : Add prototype for gfc_may_be_finalized.
+ * resolve.cc (resolve_function): Correct derived types that
+ have an incomplete namespace.
+ (resolve_where, gfc_resolve_where_code_in_forall,
+ gfc_resolve_forall_body, gfc_resolve_code): Check that the op
+ code is still EXEC_ASSIGN. If it is set lhs to must finalize.
+ (is_finalizable_type): New function.
+ (generate_component_assignments): Set must_finalize if needed.
+ (gfc_resolve_finalizers): Error if assumed rank finalizer is
+ not the only one. Warning on lack of scalar finalizer modified
+ to account for assumed rank finalizers.
+ (generate_final_call): New function.
+ (generate_component_assignments): Enclose the outermost call in
+ a block to capture automatic deallocation and final calls.
+ Set must_finalize as required to satisfy the standards. Use an
+ explicit pointer assignment for pointer components to capture
+ finalization of the target. Likewise use explicit assignment
+ for allocatable components. Do not use the temporary copy of
+ the lhs in defined assignment if the component is allocatable.
+ Put the temporary in the same namespace as the lhs symbol if
+ the component may be finalized. Remove the leading assignment
+ from the expansion of assignment of components that have their
+ own defined assignment components. Suppress finalization of
+ assignment of temporary components to the lhs. Make an explicit
+ final call for the rhs function temporary if it exists.
+ (gfc_resolve_code): Set must_finalize for assignments with an
+ array constructor on the rhs.
+ (gfc_resolve_finalizers): Ensure that an assumed rank finalizer
+ is the only finalizer for that type and correct the surprising
+ warning for the lack of a scalar finalizer.
+ (check_defined_assignments): Handle allocatable components.
+ (resolve_fl_derived): Set referenced the vtab for use
+ associated symbols.
+ (resolve_symbol): Set referenced an unreferenced symbol that
+ will be finalized.
+ * trans-array.cc (gfc_trans_array_constructor_value): Add code
+ to finalize the constructor result. Warn that this feature was
+ removed in F2018 and that it is suppressed by -std=2018.
+ (trans_array_constructor): Add finalblock, pass to previous
+ and apply to loop->post if filled.
+ (gfc_add_loop_ss_code): Add se finalblock to outer loop post.
+ (gfc_trans_array_cobounds, gfc_trans_array_bounds): Add any
+ generated finalization code to the main block.
+ (structure_alloc_comps): Add boolean argument to suppress
+ finalization and use it for calls from
+ gfc_deallocate_alloc_comp_no_caf. Otherwise it defaults to
+ false.
+ (gfc_copy_alloc_comp_no_fini): New wrapper for
+ structure_alloc_comps.
+ (gfc_alloc_allocatable_for_assignment): Suppress finalization
+ by setting new arg in call to gfc_deallocate_alloc_comp_no_caf.
+ (gfc_trans_deferred_array): Use gfc_may_be_finalized and do not
+ deallocate the components of entities with a leading '_' in the
+ name that are also marked as artificial.
+ * trans-array.h : Add the new boolean argument to the prototype
+ of gfc_deallocate_alloc_comp_no_caf with a default of false.
+ Add prototype for gfc_copy_alloc_comp_no_fini.
+ * trans-decl.cc(init_intent_out_dt): Tidy up the code.
+ * trans-expr.cc (gfc_init_se): Initialize finalblock.
+ (gfc_conv_procedure_call): Use gfc_finalize_tree_expr to
+ finalize function results. Replace in-line block for class
+ results with call to new function.
+ (gfc_conv_expr): Finalize structure constructors for F2003 and
+ F2008. Warn that this feature was deleted in F2018 and, unlike
+ array constructors, is not default. Add array constructor
+ finalblock to the post block.
+ (gfc_trans_scalar_assign): Suppress finalization by setting new
+ argument in call to gfc_deallocate_alloc_comp_no_caf. Add the
+ finalization blocks to the main block.
+ (gfc_trans_arrayfunc_assign): Use gfc_assignment_finalizer_call
+ and ensure that finalization occurs after the evaluation of the
+ rhs but using the initial value for the lhs. Finalize rhs
+ function results using gfc_finalize_tree_expr.
+ (trans_class_assignment, gfc_trans_assignment_1): As previous
+ function, taking care to order evaluation, assignment and
+ finalization correctly.
+ * trans-io.cc (gfc_trans_transfer): Add the final block.
+ * trans-stmt.cc (gfc_trans_call, gfc_trans_allocate): likewise.
+ (trans_associate_var): Nullify derived allocatable components
+ and finalize function targets with defined assignment
+ components on leaving the block scope.
+ (trans_allocate): Finalize source expressions, if required,
+ and set init_expr artificial temporarily to suppress the
+ finalization in gfc_trans_assignment.
+ * trans.cc (gfc_add_finalizer_call): Do not finalize the
+ temporaries generated in type assignment with defined
+ assignment components.
+ (gfc_assignment_finalizer_call): New function.
+ (gfc_finalize_tree_expr): New function.
+ * trans.h: Add finalblock to gfc_se. Add the prototypes for
+ gfc_finalize_tree_expr and gfc_assignment_finalizer_call.
+
+2023-03-15 Harald Anlauf <anlauf@gmx.de>
+ Tobias Burnus <tobias@codesourcery.com>
-2022-08-24 Harald Anlauf <anlauf@gmx.de>
+ PR fortran/58331
+ * interface.cc (compare_parameter): Adjust check of array dummy
+ arguments to handle the case of CLASS variables.
- PR fortran/103694
- * simplify.cc (simplify_size): The size expression of an array cannot
- be simplified if an error occurs while resolving the array spec.
+2023-03-11 Harald Anlauf <anlauf@gmx.de>
-2022-08-22 Harald Anlauf <anlauf@gmx.de>
+ PR fortran/106945
+ * trans-expr.cc (gfc_copy_class_to_class): Convert element counts in
+ bounds check to common type for comparison.
- PR fortran/106557
- * simplify.cc (gfc_simplify_ibclr): Ensure consistent results of
- the simplification by dropping a redundant memory representation
- of argument x.
- (gfc_simplify_ibset): Likewise.
+2023-03-10 Harald Anlauf <anlauf@gmx.de>
-2022-08-20 Jakub Jelinek <jakub@redhat.com>
+ PR fortran/104332
+ * resolve.cc (resolve_symbol): Avoid NULL pointer dereference while
+ checking a symbol with the BIND(C) attribute.
- PR fortran/46539
- * lang.opt (static-libgfortran, static-libquadmath): Change Fortran
- to Driver.
- * options.cc (gfc_handle_option): Don't handle OPT_static_libgfortran
- nor OPT_static_libquadmath here.
+2023-03-05 Harald Anlauf <anlauf@gmx.de>
+ Tobias Burnus <tobias@codesourcery.com>
-2022-08-18 Harald Anlauf <anlauf@gmx.de>
+ PR fortran/106856
+ * class.cc (gfc_build_class_symbol): Handle update of attributes of
+ existing class container.
+ (gfc_find_derived_vtab): Fix several memory leaks.
+ (find_intrinsic_vtab): Ditto.
+ * decl.cc (attr_decl1): Manage update of symbol attributes from
+ CLASS attributes.
+ * primary.cc (gfc_variable_attr): OPTIONAL shall not be taken or
+ updated from the class container.
+ * symbol.cc (free_old_symbol): Adjust management of symbol versions
+ to not prematurely free array specs while working on the declation
+ of CLASS variables.
- Revert:
- 2022-07-31 Harald Anlauf <anlauf@gmx.de>
+2023-03-01 Tobias Burnus <tobias@codesourcery.com>
- PR fortran/77652
- * check.cc (gfc_check_associated): Make the rank check of POINTER
- vs. TARGET match the allowed forms of pointer assignment for the
- selected Fortran standard.
+ PR middle-end/108546
+ * trans-openmp.cc (gfc_trans_omp_clauses): Fix mapping of
+ type(C_ptr) variables.
-2022-08-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
- Jakub Jelinek <jakub@redhat.com>
+2023-02-27 Harald Anlauf <anlauf@gmx.de>
- PR fortran/46539
- * lang.opt (static-libquadmath): New option.
- * invoke.texi (-static-libquadmath): Document it.
- * options.cc (gfc_handle_option): Error out if -static-libquadmath
- is passed but we do not support it.
+ PR fortran/108937
+ * trans-intrinsic.cc (gfc_conv_intrinsic_ibits): Handle corner case
+ LEN argument of IBITS equal to BITSIZE(I).
-2022-08-17 Tobias Burnus <tobias@codesourcery.com>
+2023-02-25 Mikael Morin <mikael@gcc.gnu.org>
- PR fortran/106566
- * openmp.cc (gfc_match_omp_clauses): Fix setting linear-step value
- to 1 when not specified.
- (gfc_match_omp_declare_simd): Accept module procedures.
+ PR fortran/108923
+ * intrinsic.cc (get_intrinsic_dummy_arg,
+ set_intrinsic_dummy_arg): Rename the former to the latter.
+ Remove the return value, add a reference to the lhs as argument,
+ and do the pointer assignment inside the function. Don't do
+ it if the pointer is already non-NULL.
+ (sort_actual): Update caller.
-2022-08-16 Martin Liska <mliska@suse.cz>
+2023-02-25 Harald Anlauf <anlauf@gmx.de>
- * gfortran.texi: Fix link destination to a valid URL.
+ * arith.cc (gfc_real2int): Clear mpfr variable after use.
-2022-07-31 Harald Anlauf <anlauf@gmx.de>
- Steven G. Kargl <kargl@gcc.gnu.org>
+2023-02-25 Tobias Burnus <tobias@codesourcery.com>
- PR fortran/92805
- * match.cc (gfc_match_small_literal_int): Make gobbling of leading
- whitespace optional.
- (gfc_match_name): Likewise.
- (gfc_match_char): Likewise.
- * match.h (gfc_match_small_literal_int): Adjust prototype.
- (gfc_match_name): Likewise.
- (gfc_match_char): Likewise.
- * primary.cc (match_kind_param): Match small literal int or name
- without gobbling whitespace.
- (get_kind): Do not skip over blanks.
- (match_string_constant): Likewise.
+ PR fortran/108621
+ * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Skip setting of
+ bounds of CFI desc for 'pointer,intent(out)'.
-2022-07-31 Harald Anlauf <anlauf@gmx.de>
+2023-02-24 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
- PR fortran/77652
- * check.cc (gfc_check_associated): Make the rank check of POINTER
- vs. TARGET match the allowed forms of pointer assignment for the
- selected Fortran standard.
+ * trans-decl.cc (gfc_finish_var_decl): Apply attribute.
+ (generate_local_decl): Add diagnostic for dummy and local variables.
-2022-07-29 Tobias Burnus <tobias@codesourcery.com>
+2023-02-24 Mikael Morin <mikael@gcc.gnu.org>
- * openmp.cc (resolve_omp_clauses): Permit assumed-size arrays
- in uniform clause.
+ PR fortran/108923
+ * expr.cc (gfc_free_actual_arglist): Free associated_dummy
+ memory.
+ (gfc_copy_actual_arglist): Make a copy of the associated_dummy
+ field if it is set in the original element.
-2022-07-26 Harald Anlauf <anlauf@gmx.de>
+2023-02-24 Harald Anlauf <anlauf@gmx.de>
- PR fortran/103504
- * interface.cc (get_sym_storage_size): Array bounds and character
- length can only be of integer type.
+ PR fortran/108924
+ * frontend-passes.cc (do_subscript): Clear used gmp variable.
-2022-07-21 Martin Liska <mliska@suse.cz>
+2023-02-23 Arsen Arsenović <arsen@aarsen.me>
- * intrinsic.texi: Remove trailing dots for 2 Fortran fns.
+ * invoke.texi: Reorder index entries around @items.
-2022-07-20 Harald Anlauf <anlauf@gmx.de>
+2023-02-23 Arsen Arsenović <arsen@aarsen.me>
- PR fortran/101330
- * openmp.cc (gfc_match_iterator): Remove left-over code from
- development that could lead to a crash on invalid input.
+ * invoke.texi: Reorder @opindex commands to precede @items they
+ relate to.
-2022-07-19 Harald Anlauf <anlauf@gmx.de>
+2023-02-22 Harald Anlauf <anlauf@gmx.de>
- PR fortran/103590
- * resolve.cc (find_array_spec): Change function result to bool to
- enable error recovery. Generate error message for invalid array
- reference of non-array entity instead of an internal error.
- (gfc_resolve_ref): Use function result from find_array_spec for
- error recovery.
+ PR fortran/96024
+ * resolve.cc (resolve_component): The type of a CHARACTER length
+ expression must be INTEGER.
-2022-07-15 Steve Kargl <kargl@gcc.gnu.org>
+2023-02-21 Harald Anlauf <anlauf@gmx.de>
- PR fortran/104313
- * trans-decl.cc (gfc_generate_return): Do not generate conflicting
- fake results for functions with no result variable under -ff2c.
+ PR fortran/96025
+ * parse.cc (check_function_result_typed): Improve type check of
+ specification expression for character length and return status.
+ (parse_spec): Use status from above.
+ * resolve.cc (resolve_fntype): Prevent use of invalid specification
+ expression for character length.
-2022-07-14 Harald Anlauf <anlauf@gmx.de>
- Steven G. Kargl <kargl@gcc.gnu.org>
+2023-02-16 Patrick Palka <ppalka@redhat.com>
- PR fortran/106209
- * decl.cc (add_init_expr_to_sym): Handle bad initializers for
- implied-shape arrays.
+ * gfortran.h: Mechanically drop static from static inline
+ functions via s/^static inline/inline/g.
-2022-07-12 Harald Anlauf <anlauf@gmx.de>
+2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
- PR fortran/106049
- * simplify.cc (is_constant_array_expr): A non-zero-sized constant
- array shall have a non-empty constructor. When the constructor is
- empty or missing, treat as non-constant.
+ PR fortran/103608
+ * frontend-passes.cc (do_intent): Catch NULL pointer dereference on
+ reference to invalid formal argument.
-2022-07-04 Tobias Burnus <tobias@codesourcery.com>
- Jakub Jelinek <jakub@redhat.com>
+2023-02-15 Steve Kargl <kargl@gcc.gnu.org>
- * gfortran.h (gfc_omp_namelist): Update by creating 'linear' struct,
- move 'linear_op' as 'op' to id and add 'old_modifier' to it.
- * dump-parse-tree.cc (show_omp_namelist): Update accordingly.
- * module.cc (mio_omp_declare_simd): Likewise.
- * trans-openmp.cc (gfc_trans_omp_clauses): Likewise.
- * openmp.cc (resolve_omp_clauses): Likewise; accept new-style
- 'val' modifier with do/simd.
- (gfc_match_omp_clauses): Handle OpenMP 5.2 linear clause syntax.
+ PR fortran/104554
+ * resolve.cc (check_assumed_size_reference): Avoid NULL pointer
+ dereference.
-2022-07-04 Tobias Burnus <tobias@codesourcery.com>
- Chung-Lin Tang <cltang@codesourcery.com>
- Thomas Schwinge <thomas@codesourcery.com>
+2023-02-15 Tobias Burnus <tobias@codesourcery.com>
- * openmp.cc (gfc_match_omp_requires): Remove sorry.
- * parse.cc (decode_omp_directive): Don't regard 'declare target'
- as target usage for 'omp requires'; add more flags to
- omp_requires_mask.
+ PR fortran/108512
+ * openmp.cc (gfc_resolve_omp_parallel_blocks): Handle combined 'loop'
+ directives.
+ (gfc_resolve_do_iterator): Set a source location for added
+ 'private'-clause arguments.
+ * resolve.cc (gfc_resolve_code): Call gfc_resolve_omp_do_blocks
+ also for EXEC_OMP_LOOP and gfc_resolve_omp_parallel_blocks for
+ combined directives with loop + '{masked,master} taskloop (simd)'.
-2022-07-01 Tobias Burnus <tobias@codesourcery.com>
+2023-02-13 Harald Anlauf <anlauf@gmx.de>
- * dump-parse-tree.cc (show_omp_namelist): For the map-type,
- also handle the always modifer and release/delete.
- * openmp.cc (resolve_omp_clauses): Accept tofrom
- map-type modifier for target enter/exit data,
- but use 'to' / 'from' internally.
+ PR fortran/103475
+ * primary.cc (gfc_expr_attr): Avoid NULL pointer dereference for
+ invalid use of CLASS variable.
-2022-06-30 Harald Anlauf <anlauf@gmx.de>
- Steven G. Kargl <kargl@gcc.gnu.org>
+2023-02-13 Rimvydas Jasinskas <rimvydas.jas@gmail.com>
- PR fortran/103137
- PR fortran/103138
- PR fortran/103693
- PR fortran/105243
- * decl.cc (gfc_match_data_decl): Reject CLASS entity declaration
- when it is given the PARAMETER attribute.
+ * decl.cc: Add EXT_ATTR_NOINLINE, EXT_ATTR_NORETURN, EXT_ATTR_WEAK.
+ * gfortran.h (ext_attr_id_t): Ditto.
+ * gfortran.texi (GCC$ ATTRIBUTES): Document them.
+ * trans-decl.cc (build_function_decl): Apply them.
-2022-06-29 Harald Anlauf <anlauf@gmx.de>
+2023-02-09 Harald Anlauf <anlauf@gmx.de>
Steven G. Kargl <kargl@gcc.gnu.org>
- PR fortran/106121
- * simplify.cc (gfc_simplify_extends_type_of): Do not attempt to
- simplify when one of the arguments is a CLASS variable that was
- not properly declared.
-
-2022-06-28 Jakub Jelinek <jakub@redhat.com>
-
- * gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
- * trans-types.h (gfc_real16_use_iec_60559): Declare.
- * trans-types.cc (gfc_real16_use_iec_60559): Define.
- (gfc_init_kinds): When building powerpc64le-linux libgfortran
- on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
- use_iec_60559.
- (gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
- on glibc 2.26 or later.
- * trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
- comment. Handle gfc_real16_use_iec_60559.
- (gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
-
-2022-06-26 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/105691
- * simplify.cc (gfc_simplify_index): Replace old simplification
- code by the equivalent of the runtime library implementation. Use
- HOST_WIDE_INT instead of int for string index, length variables.
-
-2022-06-26 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/105954
- * decl.cc (variable_decl): Adjust upper bounds for explicit-shape
- specs with constant bound expressions to ensure non-negative
- extents.
-
-2022-06-24 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/105813
- * check.cc (gfc_check_unpack): Try to simplify MASK argument to
- UNPACK so that checking of the VECTOR argument can work when MASK
- is a variable.
+ PR fortran/69636
+ PR fortran/103779
+ * intrinsic.cc (gfc_convert_chartype): Recover on invalid character
+ kind in conversion instead of generating an internal error.
-2022-06-18 Harald Anlauf <anlauf@gmx.de>
+2023-02-09 Tobias Burnus <tobias@codesourcery.com>
- PR fortran/105986
- * simplify.cc (gfc_simplify_btest): Add check for POS argument.
- (gfc_simplify_ibclr): Add check for POS argument.
- (gfc_simplify_ibits): Add check for POS and LEN arguments.
- (gfc_simplify_ibset): Add check for POS argument.
+ PR fortran/107424
+ * trans-openmp.cc (struct dovar_init_d): Add 'sym' and
+ 'non_unit_incr' members.
+ (gfc_nonrect_loop_expr): New.
+ (gfc_trans_omp_do): Call it; use normal loop bounds
+ for unit stride - and only create local loop var.
-2022-06-08 Tobias Burnus <tobias@codesourcery.com>
+2023-02-09 Tobias Burnus <tobias@codesourcery.com>
- * openmp.cc (gfc_match_omp_clauses): Check also parent namespace
- for 'requires reverse_offload'.
+ * parse.cc (decode_omp_directive): Really ignore 'assumes' with
+ -fopenmp-simd.
-2022-06-07 Jakub Jelinek <jakub@redhat.com>
+2023-02-08 Steve Kargl <kargl@gcc.gnu.org>
- * trans-openmp.cc (gfc_trans_omp_clauses): Set
- OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER on OMP_CLAUSE_LINEAR
- clauses unconditionally for now.
+ PR fortran/103259
+ * resolve.cc (resolve_common_vars): Avoid NULL pointer dereference
+ when a symbol's location is not set.
-2022-06-03 Tobias Burnus <tobias@codesourcery.com>
+2023-02-07 Harald Anlauf <anlauf@gmx.de>
- * openmp.cc (OMP_SCOPE_CLAUSES): Add firstprivate and allocate.
+ PR fortran/95107
+ * trans-decl.cc (gfc_finish_var_decl): With -fno-automatic, do not
+ make ASSOCIATE variables TREE_STATIC.
-2022-06-02 David Malcolm <dmalcolm@redhat.com>
+2023-02-05 Harald Anlauf <anlauf@gmx.de>
- * f95-lang.cc (gfc_get_sarif_source_language): New.
- (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
+ PR fortran/108592
+ * arith.cc (gfc_arith_divide): Emit integer division truncation
+ warnings using gfc_warning instead of gfc_warning_now to prevent
+ redundant messages.
-2022-05-31 Jason Merrill <jason@redhat.com>
+2023-02-03 Jakub Jelinek <jakub@redhat.com>
- * Make-lang.in (fortran.tags): Look at *.cc.
+ PR fortran/108451
+ * trans-decl.cc (gfc_trans_use_stmts): Call clear_slot before
+ doing continue.
-2022-05-30 Harald Anlauf <anlauf@gmx.de>
+2023-02-01 Harald Anlauf <anlauf@gmx.de>
- PR fortran/91300
- * libgfortran.h: Define new error code LIBERROR_NO_MEMORY.
- * trans-stmt.cc (gfc_trans_allocate): Generate code for setting
- ERRMSG depending on result of STAT result of ALLOCATE.
- * trans.cc (gfc_allocate_using_malloc): Use STAT value of
- LIBERROR_NO_MEMORY in case of failed malloc.
+ PR fortran/108609
+ * expr.cc (find_array_section): Add check to prevent interpreting an
+ mpz non-integer constant as an integer.
-2022-05-28 Tobias Burnus <tobias@codesourcery.com>
+2023-02-01 Tobias Burnus <tobias@codesourcery.com>
- * dump-parse-tree.cc (show_omp_clauses): Handle OMP_LIST_ENTER.
- * gfortran.h: Add OMP_LIST_ENTER.
- * openmp.cc (enum omp_mask2, OMP_DECLARE_TARGET_CLAUSES): Add
- OMP_CLAUSE_ENTER.
- (gfc_match_omp_clauses, gfc_match_omp_declare_target,
- resolve_omp_clauses): Handle 'enter' clause.
+ * openmp.cc (resolve_omp_clauses): Check also for
+ power of two.
-2022-05-27 Tobias Burnus <tobias@codesourcery.com>
- Chung-Lin Tang <cltang@codesourcery.com>
+2023-01-29 Mikael Morin <mikael@gcc.gnu.org>
- * openmp.cc (gfc_check_omp_requires): Fix clause name in error.
+ PR fortran/108450
+ * check.cc (gfc_check_minloc_maxloc): Explicitly set argument name.
+ (gfc_check_findloc): Ditto.
-2022-05-24 Tobias Burnus <tobias@codesourcery.com>
+2023-01-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
- PR c/105378
- * openmp.cc (gfc_match_omp_taskwait): Accept nowait.
+ PR fortran/103506
+ * parse.cc (parse_module): Remove use of a bool error value
+ that prevented proper setting of the namespace pointer.
-2022-05-23 Tobias Burnus <tobias@codesourcery.com>
-
- PR fortran/104949
- * f95-lang.cc (LANG_HOOKS_OMP_ARRAY_SIZE): Redefine.
- * trans-openmp.cc (gfc_omp_array_size): New.
- (gfc_trans_omp_variable_list): Never turn has_device_addr
- to firstprivate.
- * trans.h (gfc_omp_array_size): New.
-
-2022-05-18 Tobias Burnus <tobias@codesourcery.com>
-
- * gfortran.h (enum gfc_omp_depend_op): Add OMP_DEPEND_INOUTSET.
- (gfc_omp_clauses): Enlarge ENUM_BITFIELD.
- * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle
- 'inoutset' depend modifier.
- * openmp.cc (gfc_match_omp_clauses, gfc_match_omp_depobj): Likewise.
- * trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj):
- Likewise.
-
-2022-05-17 Tobias Burnus <tobias@codesourcery.com>
-
- * dump-parse-tree.cc (show_omp_namelist): Handle omp_all_memory.
- * openmp.cc (gfc_match_omp_variable_list, gfc_match_omp_depend_sink,
- gfc_match_omp_clauses, resolve_omp_clauses): Likewise.
- * trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj):
- Likewise.
- * resolve.cc (resolve_symbol): Reject it as symbol.
-
-2022-05-16 Martin Liska <mliska@suse.cz>
-
- * frontend-passes.cc (gfc_code_walker): Use ARRAY_SIZE.
- * openmp.cc (gfc_match_omp_context_selector_specification): Likewise.
- * trans-intrinsic.cc (conv_intrinsic_ieee_builtin): Likewise.
- * trans-types.cc (gfc_get_array_descr_info): Likewise.
-
-2022-05-13 Tobias Burnus <tobias@codesourcery.com>
-
- * trans-openmp.cc (gfc_trans_omp_clauses): When mapping nondescriptor
- array sections, use GOMP_MAP_FIRSTPRIVATE_POINTER instead of
- GOMP_MAP_POINTER for the pointer attachment.
-
-2022-05-11 Harald Anlauf <anlauf@gmx.de>
+2023-01-28 Harald Anlauf <anlauf@gmx.de>
Steven G. Kargl <kargl@gcc.gnu.org>
- PR fortran/105230
- * expr.cc (find_array_section): Correct logic to avoid NULL
- pointer dereference on invalid array section.
-
-2022-05-10 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/105526
- * resolve.cc (check_team): New.
- (gfc_resolve_code): Add checks for arguments to coarray intrinsics
- FORM TEAM, CHANGE TEAM, and SYNC TEAM.
-
-2022-05-09 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/105501
- * match.cc (gfc_match_if): Adjust patterns used for matching.
- (gfc_match_select_rank): Likewise.
- * parse.cc (decode_statement): Likewise.
-
-2022-05-05 Sandra Loosemore <sandra@codesourcery.com>
-
- * gfortran.h (struct gfc_omp_clauses): Add non_rectangular bit.
- * openmp.cc (is_outer_iteration_variable): New function.
- (expr_is_invariant): New function.
- (bound_expr_is_canonical): New function.
- (resolve_omp_do): Replace existing non-rectangularity error with
- check for canonical form and setting non_rectangular bit.
- * trans-openmp.cc (gfc_trans_omp_do): Transfer non_rectangular
- flag to generated tree structure.
-
-2022-05-02 Sandra Loosemore <sandra@codesourcery.com>
-
- * trans-openmp.cc (gfc_trans_omp_critical): Set location on OMP
- tree node.
- (gfc_trans_omp_do): Likewise.
- (gfc_trans_omp_masked): Likewise.
- (gfc_trans_omp_do_simd): Likewise.
- (gfc_trans_omp_scope): Likewise.
- (gfc_trans_omp_taskgroup): Likewise.
- (gfc_trans_omp_taskwait): Likewise.
- (gfc_trans_omp_distribute): Likewise.
- (gfc_trans_omp_taskloop): Likewise.
- (gfc_trans_omp_master_masked_taskloop): Likewise.
-
-2022-04-29 Thomas Koenig <tkoenig@gcc.gnu.org>
-
- * gfortran.texi: Fix exchanged period and letter.
-
-2022-04-28 Thomas Koenig <tkoenig@gcc.gnu.org>
-
- * gfortran.texi: Mention r16_ieee and r16_ibm.
- * invoke.texi: Likewise.
-
-2022-04-27 Mikael Morin <mikael@gcc.gnu.org>
-
- PR fortran/103662
- PR fortran/105379
- * array.cc (compare_bounds): Use bool as return type.
- Support non-constant expressions.
- (gfc_compare_array_spec): Update call to compare_bounds.
-
-2022-04-27 Mikael Morin <mikael@gcc.gnu.org>
-
- PR fortran/102043
- PR fortran/105381
- * trans-array.cc (non_negative_strides_array_p): Inline variable
- orig_decl and merge nested if conditions. Add condition to not
- recurse if the next argument is the same as the current.
-
-2022-04-25 Jakub Jelinek <jakub@redhat.com>
- Thomas Schwinge <thomas@codesourcery.com>
-
- PR fortran/104717
- * trans-openmp.cc (gfc_trans_oacc_construct): Wrap construct body
- in an extra BIND_EXPR.
-
-2022-04-24 Mikael Morin <mikael@gcc.gnu.org>
- Jakub Jelinek <jakub@redhat.com>
-
- PR fortran/103662
- * interface.cc (gfc_compare_derived_types): Support comparing
- unlimited polymorphic fake symbols. Recursively compare class
- descriptor types and virtual table types.
- * resolve.cc (resolve_fl_derived): Add type to the types list
- on unlimited polymorphic short-circuit return.
-
-2022-04-22 Mikael Morin <mikael@gcc.gnu.org>
- Richard Biener <rguenther@suse.de>
-
- PR fortran/102043
- * trans.h (gfc_build_array_ref): Add non_negative_offset
- argument.
- * trans.cc (gfc_build_array_ref): Ditto. Use pointer arithmetic
- if non_negative_offset is false.
- * trans-expr.cc (gfc_conv_substring): Set flag in the call to
- gfc_build_array_ref.
- * trans-array.cc (gfc_get_cfi_dim_item,
- gfc_conv_descriptor_dimension): Same.
- (build_array_ref): Decide on whether to set the flag and update
- the call.
- (gfc_conv_scalarized_array_ref): Same. New argument tmp_array.
- (gfc_conv_tmp_array_ref): Update call to
- gfc_conv_scalarized_ref.
- (non_negative_strides_array_p): New function.
-
-2022-04-22 Mikael Morin <mikael@gcc.gnu.org>
-
- PR fortran/102043
- * trans-array.cc (gfc_conv_expr_descriptor): Use
- gfc_conv_tmp_array_ref.
-
-2022-04-22 Mikael Morin <mikael@gcc.gnu.org>
+ PR fortran/108527
+ * resolve.cc (compare_bound_int): Expression to compare must be of
+ type INTEGER.
+ (compare_bound_mpz_t): Likewise.
+ (check_dimension): Fix comment on checks applied to array section
+ and clean up associated logic.
- PR fortran/102043
- * trans-io.cc: Add handling for the case where the array
- is referenced using pointer arithmetic.
+2023-01-28 Harald Anlauf <anlauf@gmx.de>
-2022-04-22 Mikael Morin <mikael@gcc.gnu.org>
+ PR fortran/108453
+ * match.cc (gfc_match_common): A USE associated name shall not appear
+ in a COMMON block (F2018:C8121).
- PR fortran/102043
- * trans-expr.cc: Pre-evaluate src and dest to variables
- before using them.
+2023-01-27 Tobias Burnus <tobias@codesourcery.com>
-2022-04-21 Fritz Reese <foreese@gcc.gnu.org>
+ PR fortran/108558
+ * trans-openmp.cc (gfc_split_omp_clauses): Handle has_device_addr.
- PR fortran/105310
- * trans-expr.cc (gfc_conv_union_initializer): Pass vec* by reference.
+2023-01-26 Harald Anlauf <anlauf@gmx.de>
-2022-04-13 Tobias Burnus <tobias@codesourcery.com>
-
- PR fortran/105242
- * match.cc (match_exit_cycle): Handle missing OMP LOOP, DO and SIMD
- directives in the EXIT/CYCLE diagnostic.
-
-2022-04-10 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/105184
- * array.cc (match_subscript): Reject assumed size coarray
- specification with missing lower bound.
- * resolve.cc (resolve_allocate_expr): Fix logic for checking
- allocate-coshape-spec in ALLOCATE statement.
-
-2022-04-05 Sandra Loosemore <sandra@codesourcery.com>
-
- * trans-openmp.cc (gfc_split_omp_clauses): Fix mask for
- EXEC_OMP_MASKED_TASKLOOP.
-
-2022-04-05 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104210
- * arith.cc (eval_intrinsic): Avoid NULL pointer dereference.
- (gfc_zero_size_array): Likewise.
-
-2022-04-05 Harald Anlauf <anlauf@gmx.de>
- Steven G. Kargl <kargl@gcc.gnu.org>
-
- PR fortran/105138
- * intrinsic.cc (gfc_is_intrinsic): When a symbol refers to a
- RECURSIVE procedure, it cannot be an INTRINSIC.
-
-2022-03-30 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/100892
- * check.cc (gfc_check_associated): Avoid NULL pointer dereference.
-
-2022-03-29 Harald Anlauf <anlauf@gmx.de>
- Steven G. Kargl <kargl@gcc.gnu.org>
-
- PR fortran/104571
- * resolve.cc (resolve_elemental_actual): Avoid NULL pointer
+ PR fortran/108544
+ * resolve.cc (check_host_association): Extend host association check
+ so that it is not restricted to functions. Also prevent NULL pointer
dereference.
-2022-03-29 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/50549
- * resolve.cc (resolve_structure_cons): Reject pointer assignments
- of character with different lengths in structure constructor.
-
-2022-03-25 Jakub Jelinek <jakub@redhat.com>
-
- PR fortran/103691
- * trans-array.cc (gfc_conv_array_initializer): If TYPE_MAX_VALUE is
- smaller than TYPE_MIN_VALUE (i.e. empty array), ignore the
- initializer; if TYPE_MIN_VALUE is equal to TYPE_MAX_VALUE, use just
- the TYPE_MIN_VALUE as index instead of RANGE_EXPR.
-
-2022-03-23 Tobias Burnus <tobias@codesourcery.com>
-
- PR fortran/103560
- * scanner.cc (add_path_to_list): Don't append '/' to the
- save include path.
- (open_included_file): Use '/' in concatenating path + file name.
- * module.cc (gzopen_included_file_1): Likewise.
-
-2022-03-22 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104999
- * simplify.cc (gfc_simplify_cshift): Ensure temporary holding
- source array stride is initialized.
-
-2022-03-19 Mikael Morin <mikael@gcc.gnu.org>
-
- PR fortran/104228
- PR fortran/104570
- * parse.cc (parse_associate): Use a new distinct gfc_charlen if the
- copied type has one whose length is not known to be constant.
- * resolve.cc (resolve_assoc_var): Reset charlen if it’s shared with
- the associate target regardless of the expression type.
- Don’t reinitialize charlen if it’s deferred.
-
-2022-03-18 Tobias Burnus <tobias@codesourcery.com>
-
- PR fortran/103039
- * trans-openmp.cc (gfc_omp_clause_copy_ctor, gfc_omp_clause_dtor):
- Only privatize pointer for associate names.
-
-2022-03-18 Tobias Burnus <tobias@codesourcery.com>
-
- PR fortran/103039
- * openmp.cc (resolve_omp_clauses): Improve associate-name diagnostic
- for select type/rank.
-
-2022-03-11 Tobias Burnus <tobias@codesourcery.com>
-
- * trans-openmp.cc (gfc_trans_omp_clauses, gfc_omp_finish_clause):
- Obtain size for mapping only if allocatable array is allocated.
+2023-01-25 Steve Kargl <kargl@gcc.gnu.org>
-2022-03-09 Harald Anlauf <anlauf@gmx.de>
+ PR fortran/108528
+ * array.cc (compare_bounds): Return false instead of generating an
+ internal error on an invalid argument type.
- PR fortran/104849
- * expr.cc (find_array_section): Avoid NULL pointer dereference on
- invalid array section.
+2023-01-24 Harald Anlauf <anlauf@gmx.de>
-2022-03-09 Tobias Burnus <tobias@codesourcery.com>
+ PR fortran/108529
+ * simplify.cc (simplify_transformation): Do not try to simplify
+ transformational intrinsic when the ARRAY argument has a NULL shape.
- * trans-intrinsic.cc (gfc_conv_intrinsic_sizeof): Fix CLASS handling.
+2023-01-23 Harald Anlauf <anlauf@gmx.de>
-2022-03-08 Tobias Burnus <tobias@codesourcery.com>
+ PR fortran/108502
+ * dependency.cc (gfc_check_dependency): Prevent NULL pointer
+ dereference while recursively checking expressions.
- PR fortran/104126
- * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Handle NULL
- without MOLD.
+2023-01-23 Harald Anlauf <anlauf@gmx.de>
-2022-03-08 Harald Anlauf <anlauf@gmx.de>
+ PR fortran/108501
+ * interface.cc (get_expr_storage_size): Check array subscript triplets
+ that we actually have integer values before trying to extract with
+ mpz_get_si.
- PR fortran/104811
- * frontend-passes.cc (optimize_minmaxloc): Do not attempt
- frontend-optimization of MINLOC/MAXLOC for character arrays, as
- there is no suitable code yet for inline expansion.
-
-2022-03-07 Tobias Burnus <tobias@codesourcery.com>
-
- PR fortran/99585
- PR fortran/104430
- * trans-expr.cc (conv_parent_component_references): Fix comment;
- simplify comparison.
- (gfc_maybe_dereference_var): Avoid d referencing a nonpointer.
-
-2022-03-07 Tobias Burnus <tobias@codesourcery.com>
-
- * array.cc (gfc_ref_dimen_size): Fix comment typo.
- * dump-parse-tree.cc (gfc_dump_c_prototypes): Likewise.
- * frontend-passes.cc (cfe_code): Likewise.
- * gfortran.texi: Likewise.
- * resolve.cc (generate_component_assignments): Likewise.
- * simplify.cc (gfc_simplify_this_image): Likewise.
- * trans-expr.cc (trans_scalar_class_assign,
- gfc_maybe_dereference_var): Likewise.
- * intrinsic.texi: Remove word duplication.
- * invoke.texi: Likewise.
-
-2022-03-07 Jakub Jelinek <jakub@redhat.com>
-
- * trans-expr.cc: Fix up duplicated word issue in a comment.
- * gfortran.h: Likewise.
- * scanner.cc: Likewise.
-
-2022-03-07 Martin Liska <mliska@suse.cz>
-
- * intrinsic.cc (gfc_is_intrinsic): Remove asterisk from error
- message.
-
-2022-03-07 Martin Liska <mliska@suse.cz>
-
- PR translation/90148
- * intrinsic.cc (gfc_is_intrinsic): Put
- quote to a proper place.
-
-2022-03-03 Kwok Cheung Yeung <kcy@codesourcery.com>
-
- PR fortran/104131
- * openmp.cc (gfc_match_omp_detach): Move check for type of event
- handle to...
- (resolve_omp_clauses) ...here. Also check that the event handle is
- not an array, or an array access or structure element access.
-
-2022-03-02 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104573
- * resolve.cc (resolve_structure_cons): Avoid NULL pointer
- dereference when there is no valid component.
-
-2022-02-24 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/84519
- * dump-parse-tree.cc (show_code_node): Dump QUIET specifier when
- present.
- * match.cc (gfc_match_stopcode): Implement parsing of F2018 QUIET
- specifier. F2018 stopcodes may have non-default integer kind.
- * resolve.cc (gfc_resolve_code): Add checks for QUIET argument.
- * trans-stmt.cc (gfc_trans_stop): Pass QUIET specifier to call of
- library function.
-
-2022-02-22 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104619
- * resolve.cc (resolve_structure_cons): Skip shape check if shape
- of constructor cannot be determined at compile time.
-
-2022-02-20 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/77693
- * data.cc (gfc_assign_data_value): If a variable in a data
- statement has the POINTER attribute, check for allowed initial
- data target that is compatible with pointer assignment.
- * gfortran.h (IS_POINTER): New macro.
-
-2022-02-15 Tobias Burnus <tobias@codesourcery.com>
-
- * trans-openmp.cc (gfc_trans_omp_depobj): Fix to alloc/ptr dummy
- and for c_ptr.
-
-2022-02-15 Tobias Burnus <tobias@codesourcery.com>
-
- * trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj):
- Depend on the proper addr, for ptr/alloc depend on pointee.
-
-2022-02-14 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104211
- * expr.cc (find_array_section): Replace assertion by error
- recovery when encountering bad array constructor.
-
-2022-02-13 Mikael Morin <mikael@gcc.gnu.org>
-
- PR fortran/104228
- * resolve.cc (resolve_assoc_var): Also create a new character
- length for non-dummy associate targets.
- * trans-stmt.cc (trans_associate_var): Initialize character length
- even if no temporary is used for the associate variable.
-
-2022-02-10 Roger Sayle <roger@nextmovesoftware.com>
- Tobias Burnus <tobias@codesourcery.com>
+2023-01-23 Harald Anlauf <anlauf@gmx.de>
- * trans-common.cc (GFC_EQUIV_FMT): New macro respecting the
- target's NO_DOT_IN_LABEL and NO_DOLLAR_IN_LABEL preferences.
- (build_equiv_decl): Use GFC_EQUIV_FMT here.
+ PR fortran/108420
+ * iresolve.cc (check_charlen_present): Preserve character length if
+ there is no array constructor.
-2022-02-10 Tobias Burnus <tobias@codesourcery.com>
+2023-01-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
- PR fortran/104329
- * openmp.cc (resolve_omp_atomic): Defer extra-code assert after
- other diagnostics.
+ PR fortran/102595
+ * data.cc (gfc_assign_data_value): Remove check for PARAMETER in DATA.
+ * primary.cc (match_variable): Add check for PARAMETER in DATA.
-2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
+2023-01-19 Harald Anlauf <anlauf@gmx.de>
- * dump-parse-tree.cc (show_omp_clauses): Added OMP_LIST_HAS_DEVICE_ADDR
- case.
- * gfortran.h: Added OMP_LIST_HAS_DEVICE_ADDR.
- * openmp.cc (enum omp_mask2): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
- (gfc_match_omp_clauses): Parse HAS_DEVICE_ADDR clause.
- (resolve_omp_clauses): Same.
- * trans-openmp.cc (gfc_trans_omp_variable_list): Added
- OMP_LIST_HAS_DEVICE_ADDR case.
- (gfc_trans_omp_clauses): Firstprivatize of array descriptors.
+ PR fortran/108434
+ * expr.cc (class_allocatable): Prevent NULL pointer dereference
+ or invalid read.
+ (class_pointer): Likewise.
-2022-02-09 Harald Anlauf <anlauf@gmx.de>
+2023-01-17 Harald Anlauf <anlauf@gmx.de>
- PR fortran/66193
- * arith.cc (reduce_binary_ac): When reducing binary expressions,
- try simplification. Handle case of empty constructor.
- (reduce_binary_ca): Likewise.
+ PR fortran/108421
+ * interface.cc (get_expr_storage_size): Check that we actually have
+ an integer value before trying to extract it with mpz_get_si.
-2022-02-03 Harald Anlauf <anlauf@gmx.de>
+2023-01-12 Tobias Burnus <tobias@codesourcery.com>
- PR fortran/104311
- * check.cc (gfc_calculate_transfer_sizes): Checks for case when
- storage size of SOURCE is greater than zero while the storage size
- of MOLD is zero and MOLD is an array shall not depend on SIZE.
+ PR fortran/107706
+ * openmp.cc (gfc_resolve_omp_assumptions): Reject nonscalars.
-2022-02-03 Jakub Jelinek <jakub@redhat.com>
+2023-01-11 Jakub Jelinek <jakub@redhat.com>
- PR fortran/104328
- * openmp.cc (is_scalar_intrinsic_expr): If must_be_var && conv_ok
- and expr is conversion, verify it is a conversion from EXPR_VARIABLE
- with non-NULL symtree. Check ->block->next before dereferencing it.
+ PR fortran/108349
+ * f95-lang.cc (gfc_init_builtin_function): Fix up function types
+ for BUILT_IN_REALLOC and BUILT_IN_SINCOS{F,,L}. Formatting fixes.
-2022-02-01 Harald Anlauf <anlauf@gmx.de>
+2023-01-10 Harald Anlauf <anlauf@gmx.de>
- PR fortran/104331
- * simplify.cc (gfc_simplify_eoshift): Avoid NULL pointer
- dereference when shape is not set.
+ PR fortran/97345
+ * frontend-passes.cc (do_subscript): Clear used gmp variables.
-2022-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
+2023-01-02 Jakub Jelinek <jakub@redhat.com>
- PR fortran/103790
- * trans-array.cc (structure_alloc_comps): Prevent descriptor
- stacking for non-array data; do not broadcast caf-tokens.
- * trans-intrinsic.cc (conv_co_collective): Prevent generation
- of unused descriptor.
-
-2022-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
-
- Revert:
- 2022-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
-
- PR fortran/103790
- * trans-array.cc (structure_alloc_comps): Prevent descriptor
- stacking for non-array data; do not broadcast caf-tokens.
- * trans-intrinsic.cc (conv_co_collective): Prevent generation
- of unused descriptor.
-
-2022-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
-
- PR fortran/103790
- * trans-array.cc (structure_alloc_comps): Prevent descriptor
- stacking for non-array data; do not broadcast caf-tokens.
- * trans-intrinsic.cc (conv_co_collective): Prevent generation
- of unused descriptor.
-
-2022-01-27 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104128
- * expr.cc (gfc_copy_expr): Convert internal representation of
- string to wide char in value only for default character kind.
- * target-memory.cc (interpret_array): Pass flag for conversion of
- wide chars.
- (gfc_target_interpret_expr): Likewise.
-
-2022-01-27 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/84784
- * trans-intrinsic.cc (conv_intrinsic_image_status): Convert result
- to resulting (default) integer type.
- (conv_intrinsic_team_number): Likewise.
- (gfc_conv_intrinsic_popcnt_poppar): Likewise.
-
-2022-01-25 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104227
- * check.cc (gfc_calculate_transfer_sizes): Fix checking of arrays
- passed as MOLD argument to the TRANSFER intrinsic for having
- storage size zero.
-
-2022-01-25 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104212
- * check.cc (gfc_check_norm2): Check that optional argument DIM is
- scalar.
- (gfc_check_parity): Likewise.
-
-2022-01-24 Jakub Jelinek <jakub@redhat.com>
-
- * lang.opt (fconvert=): Add EnumSet property and mention also
- r16_ieee and r16_ibm arguments.
- (big-endian, little-endian, native, swap): Add Set(1) property.
- (r16_ieee, r16_ibm): New EnumValue entries with Set(2) property.
- * trans-types.cc (gfc_init_kinds): Emit gfc_fatal_error for
- -fconvert=r16_ieee or -fconvert=r16_ibm when R16_IEEE <=> R16_IBM
- conversions aren't supported.
-
-2022-01-22 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/104127
- * simplify.cc (gfc_simplify_transfer): Ensure that the result
- typespec is set up for TRANSFER with MOLD of type CHARACTER
- including character length even if the result is a zero-sized
- array.
-
-2022-01-20 Sandra Loosemore <sandra@codesourcery.com>
-
- PR fortran/103695
- PR fortran/102621
- * gfortran.h (struct gfc_namespace) Add omp_affinity_iterator
- field.
- * dump-parse-tree.cc (show_iterator): Use it.
- * openmp.cc (gfc_match_iterator): Likewise.
- (resolve_omp_clauses): Likewise.
- * trans-decl.cc (gfc_finish_var_decl): Likewise.
- * trans-openmp.cc (handle_iterator): Likewise.
-
-2022-01-18 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/103692
- * array.cc (gfc_expand_constructor): Handle zero-sized array
- constructors.
-
-2022-01-17 Martin Liska <mliska@suse.cz>
-
- * check.cc (gfc_check_all_any): Rename .c names to .cc.
- * class.cc (find_intrinsic_vtab): Likewise.
- * config-lang.in: Likewise.
- * cpp.cc (cpp_define_builtins): Likewise.
- * data.cc (get_array_index): Likewise.
- * decl.cc (match_clist_expr): Likewise.
- (get_proc_name): Likewise.
- (gfc_verify_c_interop_param): Likewise.
- (gfc_get_pdt_instance): Likewise.
- (gfc_match_formal_arglist): Likewise.
- (gfc_get_type_attr_spec): Likewise.
- * dependency.cc: Likewise.
- * error.cc (gfc_format_decoder): Likewise.
- * expr.cc (check_restricted): Likewise.
- (gfc_build_default_init_expr): Likewise.
- * f95-lang.cc: Likewise.
- * gfc-internals.texi: Likewise.
- * gfortran.h (enum match): Likewise.
- (enum procedure_type): Likewise.
- (enum oacc_routine_lop): Likewise.
- (gfc_get_pdt_instance): Likewise.
- (gfc_end_source_files): Likewise.
- (gfc_mpz_set_hwi): Likewise.
- (gfc_get_option_string): Likewise.
- (gfc_find_sym_in_expr): Likewise.
- (gfc_errors_to_warnings): Likewise.
- (gfc_real_4_kind): Likewise.
- (gfc_free_finalizer): Likewise.
- (gfc_sym_get_dummy_args): Likewise.
- (gfc_check_intrinsic_standard): Likewise.
- (gfc_free_case_list): Likewise.
- (gfc_resolve_oacc_routines): Likewise.
- (gfc_check_vardef_context): Likewise.
- (gfc_free_association_list): Likewise.
- (gfc_implicit_pure_function): Likewise.
- (gfc_ref_dimen_size): Likewise.
- (gfc_compare_actual_formal): Likewise.
- (gfc_resolve_wait): Likewise.
- (gfc_dt_upper_string): Likewise.
- (gfc_generate_module_code): Likewise.
- (gfc_delete_bbt): Likewise.
- (debug): Likewise.
- (gfc_build_block_ns): Likewise.
- (gfc_dep_difference): Likewise.
- (gfc_invalid_null_arg): Likewise.
- (gfc_is_finalizable): Likewise.
- (gfc_fix_implicit_pure): Likewise.
- (gfc_is_size_zero_array): Likewise.
- (gfc_is_reallocatable_lhs): Likewise.
- * gfortranspec.cc: Likewise.
- * interface.cc (compare_actual_expr): Likewise.
- * intrinsic.cc (add_functions): Likewise.
- * iresolve.cc (gfc_resolve_matmul): Likewise.
- (gfc_resolve_alarm_sub): Likewise.
- * iso-c-binding.def: Likewise.
- * lang-specs.h: Likewise.
- * libgfortran.h (GFC_STDERR_UNIT_NUMBER): Likewise.
- * match.cc (gfc_match_label): Likewise.
- (gfc_match_symbol): Likewise.
- (match_derived_type_spec): Likewise.
- (copy_ts_from_selector_to_associate): Likewise.
- * match.h (gfc_match_call): Likewise.
- (gfc_get_common): Likewise.
- (gfc_match_omp_end_single): Likewise.
- (gfc_match_volatile): Likewise.
- (gfc_match_bind_c): Likewise.
- (gfc_match_literal_constant): Likewise.
- (gfc_match_init_expr): Likewise.
- (gfc_match_array_constructor): Likewise.
- (gfc_match_end_interface): Likewise.
- (gfc_match_print): Likewise.
- (gfc_match_expr): Likewise.
- * matchexp.cc (next_operator): Likewise.
- * mathbuiltins.def: Likewise.
- * module.cc (free_true_name): Likewise.
- * openmp.cc (gfc_resolve_omp_parallel_blocks): Likewise.
- (gfc_omp_save_and_clear_state): Likewise.
- * parse.cc (parse_union): Likewise.
- (set_syms_host_assoc): Likewise.
- * resolve.cc (resolve_actual_arglist): Likewise.
- (resolve_elemental_actual): Likewise.
- (check_host_association): Likewise.
- (resolve_typebound_function): Likewise.
- (resolve_typebound_subroutine): Likewise.
- (gfc_resolve_expr): Likewise.
- (resolve_assoc_var): Likewise.
- (resolve_typebound_procedures): Likewise.
- (resolve_equivalence_derived): Likewise.
- * simplify.cc (simplify_bound): Likewise.
- * symbol.cc (gfc_set_default_type): Likewise.
- (gfc_add_ext_attribute): Likewise.
- * target-memory.cc (gfc_target_interpret_expr): Likewise.
- * target-memory.h (gfc_target_interpret_expr): Likewise.
- * trans-array.cc (gfc_get_cfi_dim_sm): Likewise.
- (gfc_conv_shift_descriptor_lbound): Likewise.
- (gfc_could_be_alias): Likewise.
- (gfc_get_dataptr_offset): Likewise.
- * trans-const.cc: Likewise.
- * trans-decl.cc (trans_function_start): Likewise.
- (gfc_trans_deferred_vars): Likewise.
- (generate_local_decl): Likewise.
- (gfc_generate_function_code): Likewise.
- * trans-expr.cc (gfc_vptr_size_get): Likewise.
- (gfc_trans_class_array_init_assign): Likewise.
- (POWI_TABLE_SIZE): Likewise.
- (gfc_conv_procedure_call): Likewise.
- (gfc_trans_arrayfunc_assign): Likewise.
- * trans-intrinsic.cc (gfc_conv_intrinsic_len): Likewise.
- (gfc_conv_intrinsic_loc): Likewise.
- (conv_intrinsic_event_query): Likewise.
- * trans-io.cc (gfc_build_st_parameter): Likewise.
- * trans-openmp.cc (gfc_omp_check_optional_argument): Likewise.
- (gfc_omp_unshare_expr_r): Likewise.
- (gfc_trans_omp_array_section): Likewise.
- (gfc_trans_omp_clauses): Likewise.
- * trans-stmt.cc (trans_associate_var): Likewise.
- (gfc_trans_deallocate): Likewise.
- * trans-stmt.h (gfc_trans_class_init_assign): Likewise.
- (gfc_trans_deallocate): Likewise.
- (gfc_trans_oacc_declare): Likewise.
- * trans-types.cc: Likewise.
- * trans-types.h (enum gfc_packed): Likewise.
- * trans.cc (N_): Likewise.
- (trans_code): Likewise.
- * trans.h (gfc_build_compare_string): Likewise.
- (gfc_conv_expr_type): Likewise.
- (gfc_trans_deferred_vars): Likewise.
- (getdecls): Likewise.
- (gfc_get_array_descr_info): Likewise.
- (gfc_omp_firstprivatize_type_sizes): Likewise.
- (GTY): Likewise.
-
-2022-01-17 Martin Liska <mliska@suse.cz>
-
- * arith.c: Moved to...
- * arith.cc: ...here.
- * array.c: Moved to...
- * array.cc: ...here.
- * bbt.c: Moved to...
- * bbt.cc: ...here.
- * check.c: Moved to...
- * check.cc: ...here.
- * class.c: Moved to...
- * class.cc: ...here.
- * constructor.c: Moved to...
- * constructor.cc: ...here.
- * convert.c: Moved to...
- * convert.cc: ...here.
- * cpp.c: Moved to...
- * cpp.cc: ...here.
- * data.c: Moved to...
- * data.cc: ...here.
- * decl.c: Moved to...
- * decl.cc: ...here.
- * dependency.c: Moved to...
- * dependency.cc: ...here.
- * dump-parse-tree.c: Moved to...
- * dump-parse-tree.cc: ...here.
- * error.c: Moved to...
- * error.cc: ...here.
- * expr.c: Moved to...
- * expr.cc: ...here.
- * f95-lang.c: Moved to...
- * f95-lang.cc: ...here.
- * frontend-passes.c: Moved to...
- * frontend-passes.cc: ...here.
- * gfortranspec.c: Moved to...
- * gfortranspec.cc: ...here.
- * interface.c: Moved to...
- * interface.cc: ...here.
- * intrinsic.c: Moved to...
- * intrinsic.cc: ...here.
- * io.c: Moved to...
- * io.cc: ...here.
- * iresolve.c: Moved to...
- * iresolve.cc: ...here.
- * match.c: Moved to...
- * match.cc: ...here.
- * matchexp.c: Moved to...
- * matchexp.cc: ...here.
- * misc.c: Moved to...
- * misc.cc: ...here.
- * module.c: Moved to...
- * module.cc: ...here.
- * openmp.c: Moved to...
- * openmp.cc: ...here.
- * options.c: Moved to...
- * options.cc: ...here.
- * parse.c: Moved to...
- * parse.cc: ...here.
- * primary.c: Moved to...
- * primary.cc: ...here.
- * resolve.c: Moved to...
- * resolve.cc: ...here.
- * scanner.c: Moved to...
- * scanner.cc: ...here.
- * simplify.c: Moved to...
- * simplify.cc: ...here.
- * st.c: Moved to...
- * st.cc: ...here.
- * symbol.c: Moved to...
- * symbol.cc: ...here.
- * target-memory.c: Moved to...
- * target-memory.cc: ...here.
- * trans-array.c: Moved to...
- * trans-array.cc: ...here.
- * trans-common.c: Moved to...
- * trans-common.cc: ...here.
- * trans-const.c: Moved to...
- * trans-const.cc: ...here.
- * trans-decl.c: Moved to...
- * trans-decl.cc: ...here.
- * trans-expr.c: Moved to...
- * trans-expr.cc: ...here.
- * trans-intrinsic.c: Moved to...
- * trans-intrinsic.cc: ...here.
- * trans-io.c: Moved to...
- * trans-io.cc: ...here.
- * trans-openmp.c: Moved to...
- * trans-openmp.cc: ...here.
- * trans-stmt.c: Moved to...
- * trans-stmt.cc: ...here.
- * trans-types.c: Moved to...
- * trans-types.cc: ...here.
- * trans.c: Moved to...
- * trans.cc: ...here.
-
-2022-01-17 Andrew Stubbs <ams@codesourcery.com>
-
- * openmp.c (gfc_match_omp_requires): Don't "sorry" dynamic_allocators.
-
-2022-01-15 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/83079
- * target-memory.c (gfc_interpret_character): Result length is
- in bytes and thus depends on the character kind.
- * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Compute correct
- string length for the result of the TRANSFER intrinsic and for
- temporaries for the different character kinds.
-
-2022-01-14 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/99256
- * intrinsic.c: Do not check formal argument type when checking
- arguments of intrinsics for alternate return specifiers.
-
-2022-01-14 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/103782
- * expr.c (gfc_simplify_expr): Adjust logic for when to scalarize a
- call of an intrinsic which may have been overloaded.
-
-2022-01-13 Hafiz Abid Qadeer <abidh@codesourcery.com>
-
- * dump-parse-tree.c (show_omp_clauses): Handle OMP_LIST_ALLOCATE.
- * gfortran.h (OMP_LIST_ALLOCATE): New enum value.
- * openmp.c (enum omp_mask1): Add OMP_CLAUSE_ALLOCATE.
- (gfc_match_omp_clauses): Handle OMP_CLAUSE_ALLOCATE
- (OMP_PARALLEL_CLAUSES, OMP_DO_CLAUSES, OMP_SECTIONS_CLAUSES)
- (OMP_TASK_CLAUSES, OMP_TASKLOOP_CLAUSES, OMP_TARGET_CLAUSES)
- (OMP_TEAMS_CLAUSES, OMP_DISTRIBUTE_CLAUSES)
- (OMP_SINGLE_CLAUSES): Add OMP_CLAUSE_ALLOCATE.
- (OMP_TASKGROUP_CLAUSES): New.
- (gfc_match_omp_taskgroup): Use OMP_TASKGROUP_CLAUSES instead of
- OMP_CLAUSE_TASK_REDUCTION.
- (resolve_omp_clauses): Handle OMP_LIST_ALLOCATE.
- (resolve_omp_do): Avoid warning when loop iteration variable is
- in allocate clause.
- * trans-openmp.c (gfc_trans_omp_clauses): Handle translation of
- allocate clause.
- (gfc_split_omp_clauses): Update for OMP_LIST_ALLOCATE.
-
-2022-01-13 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/67804
- * primary.c (gfc_match_structure_constructor): Recover from errors
- that occurred while checking for a valid structure constructor in
- a DATA statement.
-
-2022-01-11 Thomas Koenig <tkoenig@gcc.gnu.org>
-
- * libgfortran.h (unit_convert): Add flags.
-
-2022-01-11 Jakub Jelinek <jakub@redhat.com>
-
- * trans-types.c (gfc_init_kinds): When setting abi_kind to 17, if not
- targetting glibc 2.32 or later and -fbuilding-libgfortran, set
- gfc_real16_is_float128 and c_float128 in gfc_real_kinds.
- (gfc_build_real_type): Don't set c_long_double if c_float128 is
- already set.
- * trans-intrinsic.c (builtin_decl_for_precision): Don't use
- long_double_built_in if gfc_real16_is_float128 and
- long_double_type_node == gfc_float128_type_node.
- * lang.opt (fbuilding-libgfortran): New undocumented option.
-
-2022-01-11 Jakub Jelinek <jakub@redhat.com>
-
- * trans-intrinsic.c (gfc_get_intrinsic_lib_fndecl): Use
- gfc_type_abi_kind.
-
-2022-01-11 Jakub Jelinek <jakub@redhat.com>
-
- * trans-io.c (transfer_array_desc): Pass abi kind instead of kind
- to libgfortran.
-
-2022-01-11 Jakub Jelinek <jakub@redhat.com>
-
- * trans-io.c (transfer_namelist_element): Use gfc_type_abi_kind,
- formatting fixes.
- (transfer_expr): Use gfc_type_abi_kind, use *REAL128* APIs even
- for abi_kind == 17.
-
-2022-01-11 Jakub Jelinek <jakub@redhat.com>
-
- * gfortran.h (gfc_real_info): Add abi_kind member.
- (gfc_type_abi_kind): Declare.
- * trans-types.c (gfc_init_kinds): Initialize abi_kind.
- * intrinsic.c (gfc_type_abi_kind): New function.
- (conv_name): Use it.
- * iresolve.c (resolve_transformational, gfc_resolve_abs,
- gfc_resolve_char_achar, gfc_resolve_acos, gfc_resolve_acosh,
- gfc_resolve_aimag, gfc_resolve_and, gfc_resolve_aint, gfc_resolve_all,
- gfc_resolve_anint, gfc_resolve_any, gfc_resolve_asin,
- gfc_resolve_asinh, gfc_resolve_atan, gfc_resolve_atanh,
- gfc_resolve_atan2, gfc_resolve_bessel_n2, gfc_resolve_ceiling,
- gfc_resolve_cmplx, gfc_resolve_complex, gfc_resolve_cos,
- gfc_resolve_cosh, gfc_resolve_count, gfc_resolve_dble,
- gfc_resolve_dim, gfc_resolve_dot_product, gfc_resolve_dprod,
- gfc_resolve_exp, gfc_resolve_floor, gfc_resolve_hypot,
- gfc_resolve_int, gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long,
- gfc_resolve_log, gfc_resolve_log10, gfc_resolve_logical,
- gfc_resolve_matmul, gfc_resolve_minmax, gfc_resolve_maxloc,
- gfc_resolve_findloc, gfc_resolve_maxval, gfc_resolve_merge,
- gfc_resolve_minloc, gfc_resolve_minval, gfc_resolve_mod,
- gfc_resolve_modulo, gfc_resolve_nearest, gfc_resolve_or,
- gfc_resolve_real, gfc_resolve_realpart, gfc_resolve_reshape,
- gfc_resolve_sign, gfc_resolve_sin, gfc_resolve_sinh, gfc_resolve_sqrt,
- gfc_resolve_tan, gfc_resolve_tanh, gfc_resolve_transpose,
- gfc_resolve_trigd, gfc_resolve_xor, gfc_resolve_random_number):
- Likewise.
- * trans-decl.c (gfc_build_intrinsic_function_decls): Likewise.
-
-2022-01-10 Paul Thomas <pault@gcc.gnu.org>
-
- PR fortran/103366
- * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Allow unlimited
- polymorphic actual argument passed to assumed type formal.
-
-2022-01-09 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/103777
- * simplify.c (gfc_simplify_maskr): Check validity of argument 'I'
- before simplifying.
- (gfc_simplify_maskl): Likewise.
-
-2022-01-09 Harald Anlauf <anlauf@gmx.de>
-
- PR fortran/101762
- * expr.c (gfc_check_pointer_assign): For pointer initialization
- targets, check that subscripts and substring indices in
- specifications are constant expressions.
-
-2022-01-09 Mikael Morin <mikael@gcc.gnu.org>
-
- PR fortran/103789
- * trans-array.c (arg_evaluated_for_scalarization): Add MASKL, MASKR,
- SCAN and VERIFY to the list of intrinsics whose KIND argument is to be
- ignored.
-
-2022-01-07 Sandra Loosemore <sandra@codesourcery.com>
-
- PR fortran/103898
- * trans-intrinsic.c (gfc_conv_intrinsic_size): Make size_var
- actually be a variable and fix surrounding code.
-
-2022-01-06 Steve Kargl <kargl@gcc.gnu.org>
- Sandra Loosemore <sandra@codesourcery.com>
-
- PR fortran/103287
- * interface.c (argument_rank_mismatch): Replace incorrect assertion
- with return.
-
-2022-01-05 Sandra Loosemore <sandra@codesourcery.com>
-
- PR fortran/103258
- * decl.c (gfc_match_char_spec): Suppress errors around call
- to gfc_reduce_init_expr.
- * error.c (gfc_query_suppress_errors): New.
- * gfortran.h (gfc_query_suppress_errors): Declare.
- * symbol.c (gfc_set_default_type): Check gfc_query_suppress_errors.
-
-2022-01-03 Sandra Loosemore <sandra@codesourcery.com>
-
- PR fortran/103390
- * expr.c (gfc_is_simply_contiguous): Make it smarter about
- function calls.
- * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Do not generate
- copy loops for array expressions that are not "variables" (lvalues).
-
-2022-01-03 Jakub Jelinek <jakub@redhat.com>
-
- * gfortranspec.c (lang_specific_driver): Update copyright notice
+ * gfortranspec.cc (lang_specific_driver): Update copyright notice
dates.
* gfc-internals.texi: Bump @copying's copyright year.
* gfortran.texi: Ditto.
@@ -1388,7 +518,7 @@
* invoke.texi: Ditto.
-Copyright (C) 2022 Free Software Foundation, Inc.
+Copyright (C) 2023 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
diff --git a/gcc/fortran/ChangeLog-2022 b/gcc/fortran/ChangeLog-2022
new file mode 100644
index 0000000..253af76
--- /dev/null
+++ b/gcc/fortran/ChangeLog-2022
@@ -0,0 +1,4484 @@
+2022-12-30 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/102331
+ * decl.cc (attr_decl1): Guard against NULL pointer.
+ * parse.cc (match_deferred_characteristics): Include BT_CLASS in check for
+ derived being undefined.
+
+2022-12-23 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/108131
+ * array.cc (match_array_element_spec): Avoid too early simplification
+ of matched array element specs that can lead to a misinterpretation
+ when used as array bounds in array declarations.
+
+2022-12-23 Julian Brown <julian@codesourcery.com>
+
+ * dump-parse-tree.cc (show_attr): Fix OMP-UDR-ARTIFICIAL-VAR typo.
+ * trans-openmp.cc (gfc_trans_omp_array_section): Replace stray unicode
+ m-dash character with hyphen.
+
+2022-12-23 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/106731
+ * trans-array.cc (gfc_trans_auto_array_allocation): Remove gcc_assert (!TREE_STATIC()).
+
+2022-12-22 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/69604
+ * match.cc (chk_stmt_fcn_body): New function. Check for invalid uses
+ of statement functions arguments.
+ (gfc_match_st_function): Use above.
+
+2022-12-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/95375
+ * decl.cc (verify_bind_c_sym): Extend interoperability check to
+ CLASS variables.
+
+2022-12-18 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/107397
+ * decl.cc (add_init_expr_to_sym): Add check with new error message.
+
+2022-12-14 Julian Brown <julian@codesourcery.com>
+
+ PR fortran/107214
+ * gfortran.h (gfc_symbol): Add data_mark, dev_mark, gen_mark and
+ reduc_mark bitfields.
+ * openmp.cc (resolve_omp_clauses): Use above bitfields to improve
+ duplicate clause detection.
+
+2022-12-14 Julian Brown <julian@codesourcery.com>
+
+ * trans-openmp.cc (gfc_add_firstprivate_if_unmapped): New function.
+ (gfc_split_omp_clauses): Call above.
+
+2022-12-13 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/107423
+ * parse.cc (parse_spec): Avoid NULL pointer dereference when parsing
+ a function and an error occured.
+
+2022-12-12 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/102180
+ * array.cc (match_array_element_spec): Add check for bad
+ assumed-implied-spec.
+ (gfc_match_array_spec): Reorder logic so that the first bad array
+ element spec may trigger an error.
+
+2022-12-11 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/107995
+ * interface.cc (gfc_check_dummy_characteristics): Reject statement
+ function dummy arguments.
+
+2022-12-11 Tobias Burnus <tobias@codesourcery.com>
+
+ * openmp.cc (gfc_match_omp_context_selector_specification):
+ Remove spurious 's' in an error message.
+
+2022-12-10 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106911
+ * simplify.cc (gfc_simplify_ishftc): If the SIZE argument is known
+ to be outside the allowed range, terminate simplification.
+
+2022-12-10 Tobias Burnus <tobias@codesourcery.com>
+
+ * match.cc (gfc_match_member_sep): Use %<...%> in gfc_error.
+ * openmp.cc (gfc_match_oacc_routine, gfc_match_omp_context_selector,
+ gfc_match_omp_context_selector_specification,
+ gfc_match_omp_declare_variant, resolve_omp_clauses): Likewise;
+ use %qs instead of '%s'.
+ * primary.cc (match_real_constant, gfc_match_varspec): Likewise.
+ * resolve.cc (gfc_resolve_formal_arglist, resolve_operator,
+ resolve_ordinary_assign): Likewise.
+
+2022-12-09 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/107872
+ * resolve.cc (derived_inaccessible): Skip over allocatable components
+ to prevent an infinite loop.
+
+2022-12-09 Tobias Burnus <tobias@codesourcery.com>
+
+ * dump-parse-tree.cc (show_omp_namelist): Improve OMP_LIST_ALLOCATE
+ output.
+ * gfortran.h (struct gfc_omp_namelist): Add 'align' to 'u'.
+ (gfc_free_omp_namelist): Add bool arg.
+ * match.cc (gfc_free_omp_namelist): Likewise; free 'u.align'.
+ * openmp.cc (gfc_free_omp_clauses, gfc_match_omp_clause_reduction,
+ gfc_match_omp_flush): Update call.
+ (gfc_match_omp_clauses): Match 'align/allocate modifers in
+ 'allocate' clause.
+ (resolve_omp_clauses): Resolve align.
+ * st.cc (gfc_free_statement): Update call
+ * trans-openmp.cc (gfc_trans_omp_clauses): Handle 'align'.
+
+2022-12-08 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/108025
+ * symbol.cc (gfc_add_contiguous): Diagnose and reject duplicate
+ CONTIGUOUS attribute.
+
+2022-12-07 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/108010
+ * arith.cc (reduce_unary): Handle zero-sized arrays.
+ (reduce_binary_aa): Likewise.
+
+2022-12-04 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107922
+ * simplify.cc (gfc_simplify_unpack): Terminate simplification when
+ array-valued argument FIELD does not provide enough elements.
+
+2022-12-04 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107870
+ * intrinsic.texi: Fix typo in documentation of intrinsic FLOOR.
+ Describe the optional KIND argument to intrinsics as a scalar
+ constant expression, in accordance with the current standard.
+
+2022-12-04 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107899
+ * resolve.cc (resolve_deallocate_expr): Avoid NULL pointer dereference
+ on invalid CLASS variable.
+
+2022-11-30 Martin Liska <mliska@suse.cz>
+
+ * parse.cc (parse_omp_structured_block): Remove extra semicolon.
+
+2022-11-29 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/107874
+ * simplify.cc (gfc_simplify_merge): When simplifying MERGE with a
+ constant scalar MASK, ensure that arguments TSOURCE and FSOURCE are
+ either constant or will be evaluated.
+ * trans-intrinsic.cc (gfc_conv_intrinsic_merge): Evaluate arguments
+ before generating conditional expression.
+
+2022-11-28 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107819
+ * trans-stmt.cc (gfc_conv_elemental_dependencies): In checking for
+ elemental dependencies, treat dummy argument with VALUE attribute
+ as implicitly having intent(in).
+
+2022-11-28 Tobias Burnus <tobias@codesourcery.com>
+
+ * openmp.cc (OMP_DO_CLAUSES, OMP_SCOPE_CLAUSES,
+ OMP_SECTIONS_CLAUSES): Add 'nowait'.
+ (OMP_SINGLE_CLAUSES): Add 'nowait' and 'copyprivate'.
+ (gfc_match_omp_distribute_parallel_do,
+ gfc_match_omp_distribute_parallel_do_simd,
+ gfc_match_omp_parallel_do,
+ gfc_match_omp_parallel_do_simd,
+ gfc_match_omp_parallel_sections,
+ gfc_match_omp_teams_distribute_parallel_do,
+ gfc_match_omp_teams_distribute_parallel_do_simd): Disallow 'nowait'.
+ (gfc_match_omp_workshare): Match 'nowait' clause.
+ (gfc_match_omp_end_single): Use clause matcher for 'nowait'.
+ (resolve_omp_clauses): Reject 'nowait' + 'copyprivate'.
+ * parse.cc (decode_omp_directive): Break too long line.
+ (parse_omp_do, parse_omp_structured_block): Diagnose duplicated
+ 'nowait' clause.
+
+2022-11-23 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/107577
+ * resolve.cc (find_array_spec): Choose appropriate locus either of
+ bad array reference or of non-array entity in error message.
+
+2022-11-18 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107576
+ * interface.cc (gfc_procedure_use): Reject NULL as actual argument
+ when there is no explicit procedure interface.
+
+2022-11-17 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ PR fortran/99884
+ * io.cc (check_open_constraints): Remove double spaces.
+
+2022-11-16 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/107707
+ * interface.cc (gfc_compare_actual_formal): Check that we actually
+ have integer values before asking gmp_* to use them.
+
+2022-11-16 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107681
+ * resolve.cc (resolve_fl_var_and_proc): Prevent NULL pointer
+ dereference with reference to bad CLASS variable.
+
+2022-11-16 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107680
+ * arith.cc (arith_power): Check that operands are properly converted
+ before attempting to simplify.
+
+2022-11-15 Lewis Hyatt <lhyatt@gmail.com>
+
+ * cpp.cc (gfc_cpp_init): Use special_fname_builtin () rather than a
+ hardcoded string (which was also incorrectly left untranslated
+ previously.)
+ * error.cc (gfc_diagnostic_build_locus_prefix): Likewise.
+ * f95-lang.cc (gfc_init): Likewise.
+
+2022-11-14 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107444
+ * trans-openmp.cc (gfc_omp_check_optional_argument): Adjust to change
+ of prefix of internal symbol for presence status to '.'.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * gfortran.texi: Port from Sphinx.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * doc/gfc-internals/code-that-interacts-with-the-user.rst: New file.
+ * doc/gfc-internals/command-line-options.rst: New file.
+ * doc/gfc-internals/conf.py: New file.
+ * doc/gfc-internals/copyright.rst: New file.
+ * doc/gfc-internals/error-handling.rst: New file.
+ * doc/gfc-internals/frontend-data-structures.rst: New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages.rst: New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/accessing-declarations.rst:
+ New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/basic-data-structures.rst:
+ New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/converting-expressions-to-tree.rst:
+ New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/translating-statements.rst:
+ New file.
+ * doc/gfc-internals/gfccode.rst: New file.
+ * doc/gfc-internals/gfcexpr.rst: New file.
+ * doc/gfc-internals/gnu-free-documentation-license.rst: New file.
+ * doc/gfc-internals/index.rst: New file.
+ * doc/gfc-internals/indices-and-tables.rst: New file.
+ * doc/gfc-internals/internals-of-fortran-2003-oop-features.rst: New file.
+ * doc/gfc-internals/introduction.rst: New file.
+ * doc/gfc-internals/symbol-versioning.rst: New file.
+ * doc/gfc-internals/the-libgfortran-runtime-library.rst: New file.
+ * doc/gfc-internals/type-bound-operators.rst: New file.
+ * doc/gfc-internals/type-bound-procedures.rst: New file.
+ * doc/gfortran/about-gnu-fortran.rst: New file.
+ * doc/gfortran/coarray-programming.rst: New file.
+ * doc/gfortran/compiler-characteristics.rst: New file.
+ * doc/gfortran/compiler-characteristics/asynchronous-i-o.rst: New file.
+ * doc/gfortran/compiler-characteristics/data-consistency-and-durability.rst: New file.
+ * doc/gfortran/compiler-characteristics/evaluation-of-logical-expressions.rst: New file.
+ * doc/gfortran/compiler-characteristics/file-format-of-unformatted-sequential-files.rst:
+ New file.
+ * doc/gfortran/compiler-characteristics/file-operations-on-symbolic-links.rst: New file.
+ * doc/gfortran/compiler-characteristics/files-opened-without-an-explicit-action=-specifier.rst:
+ New file.
+ * doc/gfortran/compiler-characteristics/internal-representation-of-logical-variables.rst:
+ New file.
+ * doc/gfortran/compiler-characteristics/kind-type-parameters.rst: New file.
+ * doc/gfortran/compiler-characteristics/max-and-min-intrinsics-with-real-nan-arguments.rst:
+ New file.
+ * doc/gfortran/compiler-characteristics/thread-safety-of-the-runtime-library.rst: New file.
+ * doc/gfortran/conf.py: New file.
+ * doc/gfortran/contributing.rst: New file.
+ * doc/gfortran/contributors-to-gnu-fortran.rst: New file.
+ * doc/gfortran/copyright.rst: New file.
+ * doc/gfortran/extensions-implemented-in-gnu-fortran.rst: New file.
+ * doc/gfortran/extensions-not-implemented-in-gnu-fortran.rst: New file.
+ * doc/gfortran/extensions.rst: New file.
+ * doc/gfortran/function-abi-documentation.rst: New file.
+ * doc/gfortran/funding.rst: New file.
+ * doc/gfortran/general-public-license-3.rst: New file.
+ * doc/gfortran/gnu-fortran-and-gcc.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/description.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/enable-and-customize-preprocessing.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/environment-variables-affecting-gfortran.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/influencing-runtime-behavior.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/influencing-the-linking-step.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/option-summary.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/options-controlling-fortran-dialect.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/options-for-code-generation-conventions.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/options-for-debugging-your-program-or-gnu-fortran.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/options-for-directory-search.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/options-for-interoperability-with-other-languages.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/options-to-request-or-suppress-errors-and-warnings.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-compiler-directives.rst: New file.
+ * doc/gfortran/gnu-free-documentation-license.rst: New file.
+ * doc/gfortran/index.rst: New file.
+ * doc/gfortran/indices-and-tables.rst: New file.
+ * doc/gfortran/interoperability-with-c.rst: New file.
+ * doc/gfortran/intrinsic-modules.rst: New file.
+ * doc/gfortran/intrinsic-modules/ieee-modules-ieeeexceptions-ieeearithmetic-and-ieeefeatures.rst:
+ New file.
+ * doc/gfortran/intrinsic-modules/isocbinding.rst: New file.
+ * doc/gfortran/intrinsic-modules/isofortranenv.rst: New file.
+ * doc/gfortran/intrinsic-modules/openacc-module-openacc.rst: New file.
+ * doc/gfortran/intrinsic-modules/openmp-modules-omplib-and-omplibkinds.rst: New file.
+ * doc/gfortran/intrinsic-procedures.rst: New file.
+ * doc/gfortran/intrinsic-procedures/abort.rst: New file.
+ * doc/gfortran/intrinsic-procedures/abs.rst: New file.
+ * doc/gfortran/intrinsic-procedures/access.rst: New file.
+ * doc/gfortran/intrinsic-procedures/achar.rst: New file.
+ * doc/gfortran/intrinsic-procedures/acos.rst: New file.
+ * doc/gfortran/intrinsic-procedures/acosd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/acosh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/adjustl.rst: New file.
+ * doc/gfortran/intrinsic-procedures/adjustr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/aimag.rst: New file.
+ * doc/gfortran/intrinsic-procedures/aint.rst: New file.
+ * doc/gfortran/intrinsic-procedures/alarm.rst: New file.
+ * doc/gfortran/intrinsic-procedures/all.rst: New file.
+ * doc/gfortran/intrinsic-procedures/allocated.rst: New file.
+ * doc/gfortran/intrinsic-procedures/and.rst: New file.
+ * doc/gfortran/intrinsic-procedures/anint.rst: New file.
+ * doc/gfortran/intrinsic-procedures/any.rst: New file.
+ * doc/gfortran/intrinsic-procedures/asin.rst: New file.
+ * doc/gfortran/intrinsic-procedures/asind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/asinh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/associated.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atan2.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atan2d.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atanh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicadd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomiccas.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicdefine.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicfetchadd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicfetchand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicfetchor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicfetchxor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicref.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicxor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/backtrace.rst: New file.
+ * doc/gfortran/intrinsic-procedures/besselj0.rst: New file.
+ * doc/gfortran/intrinsic-procedures/besselj1.rst: New file.
+ * doc/gfortran/intrinsic-procedures/besseljn.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bessely0.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bessely1.rst: New file.
+ * doc/gfortran/intrinsic-procedures/besselyn.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bge.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bgt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bitsize.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ble.rst: New file.
+ * doc/gfortran/intrinsic-procedures/blt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/btest.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cassociated.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ceiling.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cfpointer.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cfprocpointer.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cfunloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/char.rst: New file.
+ * doc/gfortran/intrinsic-procedures/chdir.rst: New file.
+ * doc/gfortran/intrinsic-procedures/chmod.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cmplx.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cobroadcast.rst: New file.
+ * doc/gfortran/intrinsic-procedures/comax.rst: New file.
+ * doc/gfortran/intrinsic-procedures/comin.rst: New file.
+ * doc/gfortran/intrinsic-procedures/commandargumentcount.rst: New file.
+ * doc/gfortran/intrinsic-procedures/compileroptions.rst: New file.
+ * doc/gfortran/intrinsic-procedures/compilerversion.rst: New file.
+ * doc/gfortran/intrinsic-procedures/complex.rst: New file.
+ * doc/gfortran/intrinsic-procedures/conjg.rst: New file.
+ * doc/gfortran/intrinsic-procedures/coreduce.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cos.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cosd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cosh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cosum.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cotan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cotand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/count.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cputime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cshift.rst: New file.
+ * doc/gfortran/intrinsic-procedures/csizeof.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ctime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dateandtime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dble.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dcmplx.rst: New file.
+ * doc/gfortran/intrinsic-procedures/digits.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dim.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dotproduct.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dprod.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dreal.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dshiftl.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dshiftr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dtime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/eoshift.rst: New file.
+ * doc/gfortran/intrinsic-procedures/epsilon.rst: New file.
+ * doc/gfortran/intrinsic-procedures/erf.rst: New file.
+ * doc/gfortran/intrinsic-procedures/erfc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/erfcscaled.rst: New file.
+ * doc/gfortran/intrinsic-procedures/etime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/eventquery.rst: New file.
+ * doc/gfortran/intrinsic-procedures/executecommandline.rst: New file.
+ * doc/gfortran/intrinsic-procedures/exit.rst: New file.
+ * doc/gfortran/intrinsic-procedures/exp.rst: New file.
+ * doc/gfortran/intrinsic-procedures/exponent.rst: New file.
+ * doc/gfortran/intrinsic-procedures/extendstypeof.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fdate.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fget.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fgetc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/findloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/floor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/flush.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fnum.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fput.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fputc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fraction.rst: New file.
+ * doc/gfortran/intrinsic-procedures/free.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fseek.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fstat.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ftell.rst: New file.
+ * doc/gfortran/intrinsic-procedures/gamma.rst: New file.
+ * doc/gfortran/intrinsic-procedures/gerror.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getarg.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getcommand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getcommandargument.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getcwd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getenv.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getenvironmentvariable.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getgid.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getlog.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getpid.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getuid.rst: New file.
+ * doc/gfortran/intrinsic-procedures/gmtime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/hostnm.rst: New file.
+ * doc/gfortran/intrinsic-procedures/huge.rst: New file.
+ * doc/gfortran/intrinsic-procedures/hypot.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iachar.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iall.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iany.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iargc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ibclr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ibits.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ibset.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ichar.rst: New file.
+ * doc/gfortran/intrinsic-procedures/idate.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ieor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ierrno.rst: New file.
+ * doc/gfortran/intrinsic-procedures/imageindex.rst: New file.
+ * doc/gfortran/intrinsic-procedures/index.rst: New file.
+ * doc/gfortran/intrinsic-procedures/int.rst: New file.
+ * doc/gfortran/intrinsic-procedures/int2.rst: New file.
+ * doc/gfortran/intrinsic-procedures/int8.rst: New file.
+ * doc/gfortran/intrinsic-procedures/introduction-to-intrinsic-procedures.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ior.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iparity.rst: New file.
+ * doc/gfortran/intrinsic-procedures/irand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/isatty.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iscontiguous.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ishft.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ishftc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/isiostatend.rst: New file.
+ * doc/gfortran/intrinsic-procedures/isiostateor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/isnan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/itime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/kill.rst: New file.
+ * doc/gfortran/intrinsic-procedures/kind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lbound.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lcobound.rst: New file.
+ * doc/gfortran/intrinsic-procedures/leadz.rst: New file.
+ * doc/gfortran/intrinsic-procedures/len.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lentrim.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lge.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lgt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/link.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lle.rst: New file.
+ * doc/gfortran/intrinsic-procedures/llt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lnblnk.rst: New file.
+ * doc/gfortran/intrinsic-procedures/loc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/log.rst: New file.
+ * doc/gfortran/intrinsic-procedures/log10.rst: New file.
+ * doc/gfortran/intrinsic-procedures/loggamma.rst: New file.
+ * doc/gfortran/intrinsic-procedures/logical.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lshift.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lstat.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ltime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/malloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maskl.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maskr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/matmul.rst: New file.
+ * doc/gfortran/intrinsic-procedures/max.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maxexponent.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maxloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maxval.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mclock.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mclock8.rst: New file.
+ * doc/gfortran/intrinsic-procedures/merge.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mergebits.rst: New file.
+ * doc/gfortran/intrinsic-procedures/min.rst: New file.
+ * doc/gfortran/intrinsic-procedures/minexponent.rst: New file.
+ * doc/gfortran/intrinsic-procedures/minloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/minval.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mod.rst: New file.
+ * doc/gfortran/intrinsic-procedures/modulo.rst: New file.
+ * doc/gfortran/intrinsic-procedures/movealloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mvbits.rst: New file.
+ * doc/gfortran/intrinsic-procedures/nearest.rst: New file.
+ * doc/gfortran/intrinsic-procedures/newline.rst: New file.
+ * doc/gfortran/intrinsic-procedures/nint.rst: New file.
+ * doc/gfortran/intrinsic-procedures/norm2.rst: New file.
+ * doc/gfortran/intrinsic-procedures/not.rst: New file.
+ * doc/gfortran/intrinsic-procedures/null.rst: New file.
+ * doc/gfortran/intrinsic-procedures/numimages.rst: New file.
+ * doc/gfortran/intrinsic-procedures/or.rst: New file.
+ * doc/gfortran/intrinsic-procedures/pack.rst: New file.
+ * doc/gfortran/intrinsic-procedures/parity.rst: New file.
+ * doc/gfortran/intrinsic-procedures/perror.rst: New file.
+ * doc/gfortran/intrinsic-procedures/popcnt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/poppar.rst: New file.
+ * doc/gfortran/intrinsic-procedures/precision.rst: New file.
+ * doc/gfortran/intrinsic-procedures/present.rst: New file.
+ * doc/gfortran/intrinsic-procedures/product.rst: New file.
+ * doc/gfortran/intrinsic-procedures/radix.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ran.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/randominit.rst: New file.
+ * doc/gfortran/intrinsic-procedures/randomnumber.rst: New file.
+ * doc/gfortran/intrinsic-procedures/randomseed.rst: New file.
+ * doc/gfortran/intrinsic-procedures/range.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rank.rst: New file.
+ * doc/gfortran/intrinsic-procedures/real.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rename.rst: New file.
+ * doc/gfortran/intrinsic-procedures/repeat.rst: New file.
+ * doc/gfortran/intrinsic-procedures/reshape.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rrspacing.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rshift.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sametypeas.rst: New file.
+ * doc/gfortran/intrinsic-procedures/scale.rst: New file.
+ * doc/gfortran/intrinsic-procedures/scan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/secnds.rst: New file.
+ * doc/gfortran/intrinsic-procedures/second.rst: New file.
+ * doc/gfortran/intrinsic-procedures/selectedcharkind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/selectedintkind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/selectedrealkind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/setexponent.rst: New file.
+ * doc/gfortran/intrinsic-procedures/shape.rst: New file.
+ * doc/gfortran/intrinsic-procedures/shifta.rst: New file.
+ * doc/gfortran/intrinsic-procedures/shiftl.rst: New file.
+ * doc/gfortran/intrinsic-procedures/shiftr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sign.rst: New file.
+ * doc/gfortran/intrinsic-procedures/signal.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sin.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sinh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/size.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sizeof.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sleep.rst: New file.
+ * doc/gfortran/intrinsic-procedures/spacing.rst: New file.
+ * doc/gfortran/intrinsic-procedures/spread.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sqrt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/srand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/stat.rst: New file.
+ * doc/gfortran/intrinsic-procedures/storagesize.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sum.rst: New file.
+ * doc/gfortran/intrinsic-procedures/symlnk.rst: New file.
+ * doc/gfortran/intrinsic-procedures/system.rst: New file.
+ * doc/gfortran/intrinsic-procedures/systemclock.rst: New file.
+ * doc/gfortran/intrinsic-procedures/tan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/tand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/tanh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/thisimage.rst: New file.
+ * doc/gfortran/intrinsic-procedures/time.rst: New file.
+ * doc/gfortran/intrinsic-procedures/time8.rst: New file.
+ * doc/gfortran/intrinsic-procedures/tiny.rst: New file.
+ * doc/gfortran/intrinsic-procedures/trailz.rst: New file.
+ * doc/gfortran/intrinsic-procedures/transfer.rst: New file.
+ * doc/gfortran/intrinsic-procedures/transpose.rst: New file.
+ * doc/gfortran/intrinsic-procedures/trim.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ttynam.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ubound.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ucobound.rst: New file.
+ * doc/gfortran/intrinsic-procedures/umask.rst: New file.
+ * doc/gfortran/intrinsic-procedures/unlink.rst: New file.
+ * doc/gfortran/intrinsic-procedures/unpack.rst: New file.
+ * doc/gfortran/intrinsic-procedures/verify.rst: New file.
+ * doc/gfortran/intrinsic-procedures/xor.rst: New file.
+ * doc/gfortran/introduction.rst: New file.
+ * doc/gfortran/mixed-language-programming.rst: New file.
+ * doc/gfortran/naming-and-argument-passing-conventions.rst: New file.
+ * doc/gfortran/non-fortran-main-program.rst: New file.
+ * doc/gfortran/projects.rst: New file.
+ * doc/gfortran/runtime.rst: New file.
+ * doc/gfortran/runtime/gfortranconvertunit.rst: New file.
+ * doc/gfortran/runtime/gfortranerrorbacktrace.rst: New file.
+ * doc/gfortran/runtime/gfortranformattedbuffersize.rst: New file.
+ * doc/gfortran/runtime/gfortranlistseparator.rst: New file.
+ * doc/gfortran/runtime/gfortranoptionalplus.rst: New file.
+ * doc/gfortran/runtime/gfortranshowlocus.rst: New file.
+ * doc/gfortran/runtime/gfortranstderrunit.rst: New file.
+ * doc/gfortran/runtime/gfortranstdinunit.rst: New file.
+ * doc/gfortran/runtime/gfortranstdoutunit.rst: New file.
+ * doc/gfortran/runtime/gfortranunbufferedall.rst: New file.
+ * doc/gfortran/runtime/gfortranunbufferedpreconnected.rst: New file.
+ * doc/gfortran/runtime/gfortranunformattedbuffersize.rst: New file.
+ * doc/gfortran/runtime/tmpdir.rst: New file.
+ * doc/gfortran/standards.rst: New file.
+ * doc/gfortran/type-and-enum-abi-documentation.rst: New file.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * Make-lang.in: Support Sphinx based documentation.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * gfc-internals.texi: Removed.
+ * gfortran.texi: Removed.
+ * intrinsic.texi: Removed.
+ * invoke.texi: Removed.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * Make-lang.in: Support --with-sphinx-build.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * Make-lang.in:
+ Support installation if sphinx-build is missing.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-09 Martin Liska <mliska@suse.cz>
+
+ * doc/gfortran/intrinsic-procedures/aint.rst: Simplify function
+ declaration.
+ * doc/gfortran/intrinsic-procedures/int.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/anint.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/char.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/real.rst: Likewise.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * doc/gfc-internals/code-that-interacts-with-the-user.rst:
+ Add trailing newline.
+ * doc/gfc-internals/command-line-options.rst:
+ Add trailing newline.
+ * doc/gfc-internals/copyright.rst:
+ Add trailing newline.
+ * doc/gfc-internals/error-handling.rst:
+ Add trailing newline.
+ * doc/gfc-internals/frontend-data-structures.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/accessing-declarations.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/basic-data-structures.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/converting-expressions-to-tree.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/translating-statements.rst:
+ Add trailing newline.
+ * doc/gfc-internals/gfccode.rst:
+ Add trailing newline.
+ * doc/gfc-internals/gfcexpr.rst:
+ Add trailing newline.
+ * doc/gfc-internals/gnu-free-documentation-license.rst:
+ Add trailing newline.
+ * doc/gfc-internals/index.rst:
+ Add trailing newline.
+ * doc/gfc-internals/indices-and-tables.rst:
+ Add trailing newline.
+ * doc/gfc-internals/internals-of-fortran-2003-oop-features.rst:
+ Add trailing newline.
+ * doc/gfc-internals/introduction.rst:
+ Add trailing newline.
+ * doc/gfc-internals/symbol-versioning.rst:
+ Add trailing newline.
+ * doc/gfc-internals/the-libgfortran-runtime-library.rst:
+ Add trailing newline.
+ * doc/gfc-internals/type-bound-operators.rst:
+ Add trailing newline.
+ * doc/gfc-internals/type-bound-procedures.rst:
+ Add trailing newline.
+ * doc/gfortran/about-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/coarray-programming.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/asynchronous-i-o.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/data-consistency-and-durability.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/evaluation-of-logical-expressions.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/file-format-of-unformatted-sequential-files.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/file-operations-on-symbolic-links.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/files-opened-without-an-explicit-action=-specifier.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/internal-representation-of-logical-variables.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/kind-type-parameters.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/max-and-min-intrinsics-with-real-nan-arguments.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/thread-safety-of-the-runtime-library.rst:
+ Add trailing newline.
+ * doc/gfortran/contributing.rst:
+ Add trailing newline.
+ * doc/gfortran/contributors-to-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/copyright.rst:
+ Add trailing newline.
+ * doc/gfortran/extensions-implemented-in-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/extensions-not-implemented-in-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/extensions.rst:
+ Add trailing newline.
+ * doc/gfortran/function-abi-documentation.rst:
+ Add trailing newline.
+ * doc/gfortran/funding.rst:
+ Add trailing newline.
+ * doc/gfortran/general-public-license-3.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-and-gcc.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/description.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/enable-and-customize-preprocessing.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/environment-variables-affecting-gfortran.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/influencing-runtime-behavior.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/influencing-the-linking-step.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/option-summary.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-controlling-fortran-dialect.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-for-code-generation-conventions.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-for-debugging-your-program-or-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-for-directory-search.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-for-interoperability-with-other-languages.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-to-request-or-suppress-errors-and-warnings.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-compiler-directives.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-free-documentation-license.rst:
+ Add trailing newline.
+ * doc/gfortran/index.rst:
+ Add trailing newline.
+ * doc/gfortran/indices-and-tables.rst:
+ Add trailing newline.
+ * doc/gfortran/interoperability-with-c.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/ieee-modules-ieeeexceptions-ieeearithmetic-and-ieeefeatures.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/isocbinding.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/isofortranenv.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/openacc-module-openacc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/openmp-modules-omplib-and-omplibkinds.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/abort.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/abs.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/access.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/achar.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/acos.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/acosd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/acosh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/adjustl.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/adjustr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/aimag.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/alarm.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/all.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/allocated.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/and.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/any.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/asin.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/asind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/asinh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/associated.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atan2.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atan2d.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atanh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicadd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomiccas.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicdefine.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicfetchadd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicfetchand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicfetchor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicfetchxor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicref.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicxor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/backtrace.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/besselj0.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/besselj1.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/besseljn.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bessely0.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bessely1.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/besselyn.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bge.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bgt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bitsize.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ble.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/blt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/btest.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cassociated.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ceiling.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cfpointer.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cfprocpointer.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cfunloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/chdir.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/chmod.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cmplx.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cobroadcast.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/comax.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/comin.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/commandargumentcount.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/compileroptions.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/compilerversion.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/complex.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/conjg.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/coreduce.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cos.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cosd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cosh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cosum.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cotan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cotand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/count.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cputime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cshift.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/csizeof.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ctime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dateandtime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dble.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dcmplx.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/digits.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dim.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dotproduct.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dprod.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dreal.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dshiftl.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dshiftr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dtime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/eoshift.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/epsilon.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/erf.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/erfc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/erfcscaled.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/etime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/eventquery.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/executecommandline.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/exit.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/exp.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/exponent.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/extendstypeof.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fdate.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fget.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fgetc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/findloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/floor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/flush.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fnum.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fput.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fputc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fraction.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/free.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fseek.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fstat.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ftell.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/gamma.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/gerror.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getarg.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getcommand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getcommandargument.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getcwd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getenv.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getenvironmentvariable.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getgid.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getlog.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getpid.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getuid.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/gmtime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/hostnm.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/huge.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/hypot.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iachar.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iall.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iany.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iargc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ibclr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ibits.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ibset.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ichar.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/idate.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ieor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ierrno.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/imageindex.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/index.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/int2.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/int8.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/introduction-to-intrinsic-procedures.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ior.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iparity.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/irand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/isatty.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iscontiguous.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ishft.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ishftc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/isiostatend.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/isiostateor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/isnan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/itime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/kill.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/kind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lbound.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lcobound.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/leadz.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/len.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lentrim.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lge.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lgt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/link.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lle.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/llt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lnblnk.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/loc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/log.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/log10.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/loggamma.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/logical.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lshift.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lstat.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ltime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/malloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maskl.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maskr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/matmul.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/max.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maxexponent.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maxloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maxval.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mclock.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mclock8.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/merge.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mergebits.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/min.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/minexponent.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/minloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/minval.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mod.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/modulo.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/movealloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mvbits.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/nearest.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/newline.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/nint.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/norm2.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/not.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/null.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/numimages.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/or.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/pack.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/parity.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/perror.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/popcnt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/poppar.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/precision.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/present.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/product.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/radix.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ran.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/randominit.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/randomnumber.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/randomseed.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/range.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rank.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rename.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/repeat.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/reshape.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rrspacing.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rshift.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sametypeas.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/scale.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/scan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/secnds.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/second.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/selectedcharkind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/selectedintkind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/selectedrealkind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/setexponent.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/shape.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/shifta.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/shiftl.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/shiftr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sign.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/signal.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sin.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sinh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/size.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sizeof.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sleep.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/spacing.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/spread.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sqrt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/srand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/stat.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/storagesize.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sum.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/symlnk.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/system.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/systemclock.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/tan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/tand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/tanh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/thisimage.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/time.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/time8.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/tiny.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/trailz.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/transfer.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/transpose.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/trim.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ttynam.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ubound.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ucobound.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/umask.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/unlink.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/unpack.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/verify.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/xor.rst:
+ Add trailing newline.
+ * doc/gfortran/introduction.rst:
+ Add trailing newline.
+ * doc/gfortran/mixed-language-programming.rst:
+ Add trailing newline.
+ * doc/gfortran/naming-and-argument-passing-conventions.rst:
+ Add trailing newline.
+ * doc/gfortran/non-fortran-main-program.rst:
+ Add trailing newline.
+ * doc/gfortran/projects.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranconvertunit.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranerrorbacktrace.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranformattedbuffersize.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranlistseparator.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranoptionalplus.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranshowlocus.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranstderrunit.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranstdinunit.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranstdoutunit.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranunbufferedall.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranunbufferedpreconnected.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranunformattedbuffersize.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/tmpdir.rst:
+ Add trailing newline.
+ * doc/gfortran/standards.rst:
+ Add trailing newline.
+ * doc/gfortran/type-and-enum-abi-documentation.rst:
+ Add trailing newline.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * doc/gfc-internals/conf.py: Add newline at last line.
+ * doc/gfortran/conf.py: Add newline at last line.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ Revert:
+ 2022-11-10 Martin Liska <mliska@suse.cz>
+
+ * doc/gfortran/intrinsic-procedures/abs.rst: Move label directly before title.
+ * doc/gfortran/intrinsic-procedures/acos.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/acosd.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/acosh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/aimag.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/aint.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/anint.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/asin.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/asind.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/asinh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atan.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atan2.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atan2d.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atand.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atanh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/besselj0.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/besselj1.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/besseljn.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/bessely0.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/bessely1.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/besselyn.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/btest.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/char.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/conjg.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cos.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cosd.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cosh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cotan.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cotand.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/dim.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/dprod.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/erf.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/erfc.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/exp.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/gamma.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/iand.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ibclr.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ibits.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ibset.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ichar.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ieor.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/index.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/int.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ior.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ishft.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ishftc.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/len.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/lge.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/lgt.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/lle.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/llt.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/log.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/log10.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/loggamma.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/max.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/min.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/mod.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/mvbits.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/nint.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/not.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/real.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sign.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sin.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sind.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sinh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sqrt.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/tan.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/tand.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/tanh.rst: Likewise.
+
+2022-11-14 Martin Liska <mliska@suse.cz>
+
+ * doc/gfortran/naming-and-argument-passing-conventions.rst:
+ Revert.
+
+2022-11-13 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/94104
+ * interface.cc (gfc_compare_actual_formal): Improve error message
+ dependent on Fortran standard level.
+
+2021-11-06 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
+
+ * gfortran.h (gfc_check_include): Remove declaration.
+
+2022-11-12 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107444
+ * trans-decl.cc (create_function_arglist): Extend presence status
+ to all intrinsic types, and change prefix of internal symbol to '.'.
+ * trans-expr.cc (gfc_conv_expr_present): Align to changes in
+ create_function_arglist.
+ (gfc_conv_procedure_call): Fix generation of procedure arguments for
+ the case of character dummy arguments with optional+value attribute.
+ * trans-types.cc (gfc_get_function_type): Synchronize with changes
+ to create_function_arglist.
+ * doc/gfortran/naming-and-argument-passing-conventions.rst: Clarify
+ the gfortran argument passing conventions with regard to OPTIONAL
+ dummy arguments of intrinsic type.
+
+2022-11-10 Martin Liska <mliska@suse.cz>
+
+ * doc/gfortran/intrinsic-procedures/abs.rst: Move label directly before title.
+ * doc/gfortran/intrinsic-procedures/acos.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/acosd.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/acosh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/aimag.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/aint.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/anint.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/asin.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/asind.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/asinh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atan.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atan2.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atan2d.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atand.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/atanh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/besselj0.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/besselj1.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/besseljn.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/bessely0.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/bessely1.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/besselyn.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/btest.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/char.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/conjg.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cos.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cosd.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cosh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cotan.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/cotand.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/dim.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/dprod.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/erf.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/erfc.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/exp.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/gamma.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/iand.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ibclr.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ibits.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ibset.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ichar.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ieor.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/index.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/int.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ior.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ishft.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/ishftc.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/len.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/lge.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/lgt.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/lle.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/llt.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/log.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/log10.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/loggamma.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/max.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/min.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/mod.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/mvbits.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/nint.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/not.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/real.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sign.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sin.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sind.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sinh.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/sqrt.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/tan.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/tand.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/tanh.rst: Likewise.
+
+2022-11-10 Martin Liska <mliska@suse.cz>
+
+ * doc/gfc-internals/conf.py: Add newline at last line.
+ * doc/gfortran/conf.py: Add newline at last line.
+
+2022-11-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107559
+ * resolve.cc (resolve_equivalence): Avoid NULL pointer dereference
+ while emitting diagnostics for bad EQUIVALENCEs.
+
+2022-11-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107441
+ * trans-decl.cc (create_function_arglist): Adjust the ordering of
+ automatically generated hidden procedure arguments to match the
+ documented ABI for gfortran.
+ * trans-types.cc (gfc_get_function_type): Separate hidden parameters
+ so that the presence flag for optional+value arguments come before
+ string length, coarray token and offset, as required.
+
+2022-11-09 Martin Liska <mliska@suse.cz>
+
+ * doc/gfc-internals/code-that-interacts-with-the-user.rst:
+ Add trailing newline.
+ * doc/gfc-internals/command-line-options.rst:
+ Add trailing newline.
+ * doc/gfc-internals/copyright.rst:
+ Add trailing newline.
+ * doc/gfc-internals/error-handling.rst:
+ Add trailing newline.
+ * doc/gfc-internals/frontend-data-structures.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/accessing-declarations.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/basic-data-structures.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/converting-expressions-to-tree.rst:
+ Add trailing newline.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/translating-statements.rst:
+ Add trailing newline.
+ * doc/gfc-internals/gfccode.rst:
+ Add trailing newline.
+ * doc/gfc-internals/gfcexpr.rst:
+ Add trailing newline.
+ * doc/gfc-internals/gnu-free-documentation-license.rst:
+ Add trailing newline.
+ * doc/gfc-internals/index.rst:
+ Add trailing newline.
+ * doc/gfc-internals/indices-and-tables.rst:
+ Add trailing newline.
+ * doc/gfc-internals/internals-of-fortran-2003-oop-features.rst:
+ Add trailing newline.
+ * doc/gfc-internals/introduction.rst:
+ Add trailing newline.
+ * doc/gfc-internals/symbol-versioning.rst:
+ Add trailing newline.
+ * doc/gfc-internals/the-libgfortran-runtime-library.rst:
+ Add trailing newline.
+ * doc/gfc-internals/type-bound-operators.rst:
+ Add trailing newline.
+ * doc/gfc-internals/type-bound-procedures.rst:
+ Add trailing newline.
+ * doc/gfortran/about-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/coarray-programming.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/asynchronous-i-o.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/data-consistency-and-durability.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/evaluation-of-logical-expressions.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/file-format-of-unformatted-sequential-files.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/file-operations-on-symbolic-links.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/files-opened-without-an-explicit-action=-specifier.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/internal-representation-of-logical-variables.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/kind-type-parameters.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/max-and-min-intrinsics-with-real-nan-arguments.rst:
+ Add trailing newline.
+ * doc/gfortran/compiler-characteristics/thread-safety-of-the-runtime-library.rst:
+ Add trailing newline.
+ * doc/gfortran/contributing.rst:
+ Add trailing newline.
+ * doc/gfortran/contributors-to-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/copyright.rst:
+ Add trailing newline.
+ * doc/gfortran/extensions-implemented-in-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/extensions-not-implemented-in-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/extensions.rst:
+ Add trailing newline.
+ * doc/gfortran/function-abi-documentation.rst:
+ Add trailing newline.
+ * doc/gfortran/funding.rst:
+ Add trailing newline.
+ * doc/gfortran/general-public-license-3.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-and-gcc.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/description.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/enable-and-customize-preprocessing.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/environment-variables-affecting-gfortran.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/influencing-runtime-behavior.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/influencing-the-linking-step.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/option-summary.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-controlling-fortran-dialect.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-for-code-generation-conventions.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-for-debugging-your-program-or-gnu-fortran.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-for-directory-search.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-for-interoperability-with-other-languages.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-command-options/options-to-request-or-suppress-errors-and-warnings.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-fortran-compiler-directives.rst:
+ Add trailing newline.
+ * doc/gfortran/gnu-free-documentation-license.rst:
+ Add trailing newline.
+ * doc/gfortran/index.rst:
+ Add trailing newline.
+ * doc/gfortran/indices-and-tables.rst:
+ Add trailing newline.
+ * doc/gfortran/interoperability-with-c.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/ieee-modules-ieeeexceptions-ieeearithmetic-and-ieeefeatures.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/isocbinding.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/isofortranenv.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/openacc-module-openacc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-modules/openmp-modules-omplib-and-omplibkinds.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/abort.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/abs.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/access.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/achar.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/acos.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/acosd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/acosh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/adjustl.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/adjustr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/aimag.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/alarm.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/all.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/allocated.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/and.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/any.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/asin.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/asind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/asinh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/associated.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atan2.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atan2d.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atanh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicadd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomiccas.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicdefine.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicfetchadd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicfetchand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicfetchor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicfetchxor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicref.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/atomicxor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/backtrace.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/besselj0.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/besselj1.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/besseljn.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bessely0.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bessely1.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/besselyn.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bge.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bgt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/bitsize.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ble.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/blt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/btest.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cassociated.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ceiling.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cfpointer.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cfprocpointer.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cfunloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/chdir.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/chmod.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cmplx.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cobroadcast.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/comax.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/comin.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/commandargumentcount.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/compileroptions.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/compilerversion.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/complex.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/conjg.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/coreduce.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cos.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cosd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cosh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cosum.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cotan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cotand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/count.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cputime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/cshift.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/csizeof.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ctime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dateandtime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dble.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dcmplx.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/digits.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dim.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dotproduct.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dprod.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dreal.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dshiftl.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dshiftr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/dtime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/eoshift.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/epsilon.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/erf.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/erfc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/erfcscaled.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/etime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/eventquery.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/executecommandline.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/exit.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/exp.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/exponent.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/extendstypeof.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fdate.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fget.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fgetc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/findloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/floor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/flush.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fnum.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fput.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fputc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fraction.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/free.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fseek.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/fstat.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ftell.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/gamma.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/gerror.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getarg.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getcommand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getcommandargument.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getcwd.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getenv.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getenvironmentvariable.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getgid.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getlog.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getpid.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/getuid.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/gmtime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/hostnm.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/huge.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/hypot.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iachar.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iall.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iany.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iargc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ibclr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ibits.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ibset.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ichar.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/idate.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ieor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ierrno.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/imageindex.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/index.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/int2.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/int8.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/introduction-to-intrinsic-procedures.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ior.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iparity.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/irand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/isatty.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/iscontiguous.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ishft.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ishftc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/isiostatend.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/isiostateor.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/isnan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/itime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/kill.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/kind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lbound.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lcobound.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/leadz.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/len.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lentrim.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lge.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lgt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/link.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lle.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/llt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lnblnk.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/loc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/log.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/log10.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/loggamma.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/logical.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lshift.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/lstat.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ltime.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/malloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maskl.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maskr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/matmul.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/max.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maxexponent.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maxloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/maxval.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mclock.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mclock8.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/merge.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mergebits.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/min.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/minexponent.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/minloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/minval.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mod.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/modulo.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/movealloc.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/mvbits.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/nearest.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/newline.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/nint.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/norm2.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/not.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/null.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/numimages.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/or.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/pack.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/parity.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/perror.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/popcnt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/poppar.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/precision.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/present.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/product.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/radix.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ran.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/randominit.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/randomnumber.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/randomseed.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/range.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rank.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rename.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/repeat.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/reshape.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rrspacing.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/rshift.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sametypeas.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/scale.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/scan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/secnds.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/second.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/selectedcharkind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/selectedintkind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/selectedrealkind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/setexponent.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/shape.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/shifta.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/shiftl.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/shiftr.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sign.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/signal.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sin.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sind.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sinh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/size.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sizeof.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sleep.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/spacing.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/spread.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sqrt.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/srand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/stat.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/storagesize.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/sum.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/symlnk.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/system.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/systemclock.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/tan.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/tand.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/tanh.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/thisimage.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/time.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/time8.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/tiny.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/trailz.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/transfer.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/transpose.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/trim.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ttynam.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ubound.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/ucobound.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/umask.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/unlink.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/unpack.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/verify.rst:
+ Add trailing newline.
+ * doc/gfortran/intrinsic-procedures/xor.rst:
+ Add trailing newline.
+ * doc/gfortran/introduction.rst:
+ Add trailing newline.
+ * doc/gfortran/mixed-language-programming.rst:
+ Add trailing newline.
+ * doc/gfortran/naming-and-argument-passing-conventions.rst:
+ Add trailing newline.
+ * doc/gfortran/non-fortran-main-program.rst:
+ Add trailing newline.
+ * doc/gfortran/projects.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranconvertunit.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranerrorbacktrace.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranformattedbuffersize.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranlistseparator.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranoptionalplus.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranshowlocus.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranstderrunit.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranstdinunit.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranstdoutunit.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranunbufferedall.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranunbufferedpreconnected.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/gfortranunformattedbuffersize.rst:
+ Add trailing newline.
+ * doc/gfortran/runtime/tmpdir.rst:
+ Add trailing newline.
+ * doc/gfortran/standards.rst:
+ Add trailing newline.
+ * doc/gfortran/type-and-enum-abi-documentation.rst:
+ Add trailing newline.
+
+2022-11-09 Martin Liska <mliska@suse.cz>
+
+ * doc/gfortran/intrinsic-procedures/aint.rst: Simplify function
+ declaration.
+ * doc/gfortran/intrinsic-procedures/int.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/anint.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/char.rst: Likewise.
+ * doc/gfortran/intrinsic-procedures/real.rst: Likewise.
+
+2022-11-09 Martin Liska <mliska@suse.cz>
+
+ * Make-lang.in:
+ Support installation if sphinx-build is missing.
+
+2022-11-09 Martin Liska <mliska@suse.cz>
+
+ * Make-lang.in: Support --with-sphinx-build.
+
+2022-11-09 Martin Liska <mliska@suse.cz>
+
+ * gfc-internals.texi: Removed.
+ * gfortran.texi: Removed.
+ * intrinsic.texi: Removed.
+ * invoke.texi: Removed.
+
+2022-11-09 Martin Liska <mliska@suse.cz>
+
+ * Make-lang.in: Support Sphinx based documentation.
+
+2022-11-09 Martin Liska <mliska@suse.cz>
+
+ * doc/gfc-internals/code-that-interacts-with-the-user.rst: New file.
+ * doc/gfc-internals/command-line-options.rst: New file.
+ * doc/gfc-internals/conf.py: New file.
+ * doc/gfc-internals/copyright.rst: New file.
+ * doc/gfc-internals/error-handling.rst: New file.
+ * doc/gfc-internals/frontend-data-structures.rst: New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages.rst: New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/accessing-declarations.rst:
+ New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/basic-data-structures.rst:
+ New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/converting-expressions-to-tree.rst:
+ New file.
+ * doc/gfc-internals/generating-the-intermediate-language-for-later-stages/translating-statements.rst:
+ New file.
+ * doc/gfc-internals/gfccode.rst: New file.
+ * doc/gfc-internals/gfcexpr.rst: New file.
+ * doc/gfc-internals/gnu-free-documentation-license.rst: New file.
+ * doc/gfc-internals/index.rst: New file.
+ * doc/gfc-internals/indices-and-tables.rst: New file.
+ * doc/gfc-internals/internals-of-fortran-2003-oop-features.rst: New file.
+ * doc/gfc-internals/introduction.rst: New file.
+ * doc/gfc-internals/symbol-versioning.rst: New file.
+ * doc/gfc-internals/the-libgfortran-runtime-library.rst: New file.
+ * doc/gfc-internals/type-bound-operators.rst: New file.
+ * doc/gfc-internals/type-bound-procedures.rst: New file.
+ * doc/gfortran/about-gnu-fortran.rst: New file.
+ * doc/gfortran/coarray-programming.rst: New file.
+ * doc/gfortran/compiler-characteristics.rst: New file.
+ * doc/gfortran/compiler-characteristics/asynchronous-i-o.rst: New file.
+ * doc/gfortran/compiler-characteristics/data-consistency-and-durability.rst: New file.
+ * doc/gfortran/compiler-characteristics/evaluation-of-logical-expressions.rst: New file.
+ * doc/gfortran/compiler-characteristics/file-format-of-unformatted-sequential-files.rst:
+ New file.
+ * doc/gfortran/compiler-characteristics/file-operations-on-symbolic-links.rst: New file.
+ * doc/gfortran/compiler-characteristics/files-opened-without-an-explicit-action=-specifier.rst:
+ New file.
+ * doc/gfortran/compiler-characteristics/internal-representation-of-logical-variables.rst:
+ New file.
+ * doc/gfortran/compiler-characteristics/kind-type-parameters.rst: New file.
+ * doc/gfortran/compiler-characteristics/max-and-min-intrinsics-with-real-nan-arguments.rst:
+ New file.
+ * doc/gfortran/compiler-characteristics/thread-safety-of-the-runtime-library.rst: New file.
+ * doc/gfortran/conf.py: New file.
+ * doc/gfortran/contributing.rst: New file.
+ * doc/gfortran/contributors-to-gnu-fortran.rst: New file.
+ * doc/gfortran/copyright.rst: New file.
+ * doc/gfortran/extensions-implemented-in-gnu-fortran.rst: New file.
+ * doc/gfortran/extensions-not-implemented-in-gnu-fortran.rst: New file.
+ * doc/gfortran/extensions.rst: New file.
+ * doc/gfortran/function-abi-documentation.rst: New file.
+ * doc/gfortran/funding.rst: New file.
+ * doc/gfortran/general-public-license-3.rst: New file.
+ * doc/gfortran/gnu-fortran-and-gcc.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/description.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/enable-and-customize-preprocessing.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/environment-variables-affecting-gfortran.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/influencing-runtime-behavior.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/influencing-the-linking-step.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/option-summary.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/options-controlling-fortran-dialect.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/options-for-code-generation-conventions.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/options-for-debugging-your-program-or-gnu-fortran.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/options-for-directory-search.rst: New file.
+ * doc/gfortran/gnu-fortran-command-options/options-for-interoperability-with-other-languages.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-command-options/options-to-request-or-suppress-errors-and-warnings.rst:
+ New file.
+ * doc/gfortran/gnu-fortran-compiler-directives.rst: New file.
+ * doc/gfortran/gnu-free-documentation-license.rst: New file.
+ * doc/gfortran/index.rst: New file.
+ * doc/gfortran/indices-and-tables.rst: New file.
+ * doc/gfortran/interoperability-with-c.rst: New file.
+ * doc/gfortran/intrinsic-modules.rst: New file.
+ * doc/gfortran/intrinsic-modules/ieee-modules-ieeeexceptions-ieeearithmetic-and-ieeefeatures.rst:
+ New file.
+ * doc/gfortran/intrinsic-modules/isocbinding.rst: New file.
+ * doc/gfortran/intrinsic-modules/isofortranenv.rst: New file.
+ * doc/gfortran/intrinsic-modules/openacc-module-openacc.rst: New file.
+ * doc/gfortran/intrinsic-modules/openmp-modules-omplib-and-omplibkinds.rst: New file.
+ * doc/gfortran/intrinsic-procedures.rst: New file.
+ * doc/gfortran/intrinsic-procedures/abort.rst: New file.
+ * doc/gfortran/intrinsic-procedures/abs.rst: New file.
+ * doc/gfortran/intrinsic-procedures/access.rst: New file.
+ * doc/gfortran/intrinsic-procedures/achar.rst: New file.
+ * doc/gfortran/intrinsic-procedures/acos.rst: New file.
+ * doc/gfortran/intrinsic-procedures/acosd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/acosh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/adjustl.rst: New file.
+ * doc/gfortran/intrinsic-procedures/adjustr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/aimag.rst: New file.
+ * doc/gfortran/intrinsic-procedures/aint.rst: New file.
+ * doc/gfortran/intrinsic-procedures/alarm.rst: New file.
+ * doc/gfortran/intrinsic-procedures/all.rst: New file.
+ * doc/gfortran/intrinsic-procedures/allocated.rst: New file.
+ * doc/gfortran/intrinsic-procedures/and.rst: New file.
+ * doc/gfortran/intrinsic-procedures/anint.rst: New file.
+ * doc/gfortran/intrinsic-procedures/any.rst: New file.
+ * doc/gfortran/intrinsic-procedures/asin.rst: New file.
+ * doc/gfortran/intrinsic-procedures/asind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/asinh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/associated.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atan2.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atan2d.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atanh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicadd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomiccas.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicdefine.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicfetchadd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicfetchand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicfetchor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicfetchxor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicref.rst: New file.
+ * doc/gfortran/intrinsic-procedures/atomicxor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/backtrace.rst: New file.
+ * doc/gfortran/intrinsic-procedures/besselj0.rst: New file.
+ * doc/gfortran/intrinsic-procedures/besselj1.rst: New file.
+ * doc/gfortran/intrinsic-procedures/besseljn.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bessely0.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bessely1.rst: New file.
+ * doc/gfortran/intrinsic-procedures/besselyn.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bge.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bgt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/bitsize.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ble.rst: New file.
+ * doc/gfortran/intrinsic-procedures/blt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/btest.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cassociated.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ceiling.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cfpointer.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cfprocpointer.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cfunloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/char.rst: New file.
+ * doc/gfortran/intrinsic-procedures/chdir.rst: New file.
+ * doc/gfortran/intrinsic-procedures/chmod.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cmplx.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cobroadcast.rst: New file.
+ * doc/gfortran/intrinsic-procedures/comax.rst: New file.
+ * doc/gfortran/intrinsic-procedures/comin.rst: New file.
+ * doc/gfortran/intrinsic-procedures/commandargumentcount.rst: New file.
+ * doc/gfortran/intrinsic-procedures/compileroptions.rst: New file.
+ * doc/gfortran/intrinsic-procedures/compilerversion.rst: New file.
+ * doc/gfortran/intrinsic-procedures/complex.rst: New file.
+ * doc/gfortran/intrinsic-procedures/conjg.rst: New file.
+ * doc/gfortran/intrinsic-procedures/coreduce.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cos.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cosd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cosh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cosum.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cotan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cotand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/count.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cputime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/cshift.rst: New file.
+ * doc/gfortran/intrinsic-procedures/csizeof.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ctime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dateandtime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dble.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dcmplx.rst: New file.
+ * doc/gfortran/intrinsic-procedures/digits.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dim.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dotproduct.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dprod.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dreal.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dshiftl.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dshiftr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/dtime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/eoshift.rst: New file.
+ * doc/gfortran/intrinsic-procedures/epsilon.rst: New file.
+ * doc/gfortran/intrinsic-procedures/erf.rst: New file.
+ * doc/gfortran/intrinsic-procedures/erfc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/erfcscaled.rst: New file.
+ * doc/gfortran/intrinsic-procedures/etime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/eventquery.rst: New file.
+ * doc/gfortran/intrinsic-procedures/executecommandline.rst: New file.
+ * doc/gfortran/intrinsic-procedures/exit.rst: New file.
+ * doc/gfortran/intrinsic-procedures/exp.rst: New file.
+ * doc/gfortran/intrinsic-procedures/exponent.rst: New file.
+ * doc/gfortran/intrinsic-procedures/extendstypeof.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fdate.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fget.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fgetc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/findloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/floor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/flush.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fnum.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fput.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fputc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fraction.rst: New file.
+ * doc/gfortran/intrinsic-procedures/free.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fseek.rst: New file.
+ * doc/gfortran/intrinsic-procedures/fstat.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ftell.rst: New file.
+ * doc/gfortran/intrinsic-procedures/gamma.rst: New file.
+ * doc/gfortran/intrinsic-procedures/gerror.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getarg.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getcommand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getcommandargument.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getcwd.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getenv.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getenvironmentvariable.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getgid.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getlog.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getpid.rst: New file.
+ * doc/gfortran/intrinsic-procedures/getuid.rst: New file.
+ * doc/gfortran/intrinsic-procedures/gmtime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/hostnm.rst: New file.
+ * doc/gfortran/intrinsic-procedures/huge.rst: New file.
+ * doc/gfortran/intrinsic-procedures/hypot.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iachar.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iall.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iany.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iargc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ibclr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ibits.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ibset.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ichar.rst: New file.
+ * doc/gfortran/intrinsic-procedures/idate.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ieor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ierrno.rst: New file.
+ * doc/gfortran/intrinsic-procedures/imageindex.rst: New file.
+ * doc/gfortran/intrinsic-procedures/index.rst: New file.
+ * doc/gfortran/intrinsic-procedures/int.rst: New file.
+ * doc/gfortran/intrinsic-procedures/int2.rst: New file.
+ * doc/gfortran/intrinsic-procedures/int8.rst: New file.
+ * doc/gfortran/intrinsic-procedures/introduction-to-intrinsic-procedures.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ior.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iparity.rst: New file.
+ * doc/gfortran/intrinsic-procedures/irand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/isatty.rst: New file.
+ * doc/gfortran/intrinsic-procedures/iscontiguous.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ishft.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ishftc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/isiostatend.rst: New file.
+ * doc/gfortran/intrinsic-procedures/isiostateor.rst: New file.
+ * doc/gfortran/intrinsic-procedures/isnan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/itime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/kill.rst: New file.
+ * doc/gfortran/intrinsic-procedures/kind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lbound.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lcobound.rst: New file.
+ * doc/gfortran/intrinsic-procedures/leadz.rst: New file.
+ * doc/gfortran/intrinsic-procedures/len.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lentrim.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lge.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lgt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/link.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lle.rst: New file.
+ * doc/gfortran/intrinsic-procedures/llt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lnblnk.rst: New file.
+ * doc/gfortran/intrinsic-procedures/loc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/log.rst: New file.
+ * doc/gfortran/intrinsic-procedures/log10.rst: New file.
+ * doc/gfortran/intrinsic-procedures/loggamma.rst: New file.
+ * doc/gfortran/intrinsic-procedures/logical.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lshift.rst: New file.
+ * doc/gfortran/intrinsic-procedures/lstat.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ltime.rst: New file.
+ * doc/gfortran/intrinsic-procedures/malloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maskl.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maskr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/matmul.rst: New file.
+ * doc/gfortran/intrinsic-procedures/max.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maxexponent.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maxloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/maxval.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mclock.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mclock8.rst: New file.
+ * doc/gfortran/intrinsic-procedures/merge.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mergebits.rst: New file.
+ * doc/gfortran/intrinsic-procedures/min.rst: New file.
+ * doc/gfortran/intrinsic-procedures/minexponent.rst: New file.
+ * doc/gfortran/intrinsic-procedures/minloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/minval.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mod.rst: New file.
+ * doc/gfortran/intrinsic-procedures/modulo.rst: New file.
+ * doc/gfortran/intrinsic-procedures/movealloc.rst: New file.
+ * doc/gfortran/intrinsic-procedures/mvbits.rst: New file.
+ * doc/gfortran/intrinsic-procedures/nearest.rst: New file.
+ * doc/gfortran/intrinsic-procedures/newline.rst: New file.
+ * doc/gfortran/intrinsic-procedures/nint.rst: New file.
+ * doc/gfortran/intrinsic-procedures/norm2.rst: New file.
+ * doc/gfortran/intrinsic-procedures/not.rst: New file.
+ * doc/gfortran/intrinsic-procedures/null.rst: New file.
+ * doc/gfortran/intrinsic-procedures/numimages.rst: New file.
+ * doc/gfortran/intrinsic-procedures/or.rst: New file.
+ * doc/gfortran/intrinsic-procedures/pack.rst: New file.
+ * doc/gfortran/intrinsic-procedures/parity.rst: New file.
+ * doc/gfortran/intrinsic-procedures/perror.rst: New file.
+ * doc/gfortran/intrinsic-procedures/popcnt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/poppar.rst: New file.
+ * doc/gfortran/intrinsic-procedures/precision.rst: New file.
+ * doc/gfortran/intrinsic-procedures/present.rst: New file.
+ * doc/gfortran/intrinsic-procedures/product.rst: New file.
+ * doc/gfortran/intrinsic-procedures/radix.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ran.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/randominit.rst: New file.
+ * doc/gfortran/intrinsic-procedures/randomnumber.rst: New file.
+ * doc/gfortran/intrinsic-procedures/randomseed.rst: New file.
+ * doc/gfortran/intrinsic-procedures/range.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rank.rst: New file.
+ * doc/gfortran/intrinsic-procedures/real.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rename.rst: New file.
+ * doc/gfortran/intrinsic-procedures/repeat.rst: New file.
+ * doc/gfortran/intrinsic-procedures/reshape.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rrspacing.rst: New file.
+ * doc/gfortran/intrinsic-procedures/rshift.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sametypeas.rst: New file.
+ * doc/gfortran/intrinsic-procedures/scale.rst: New file.
+ * doc/gfortran/intrinsic-procedures/scan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/secnds.rst: New file.
+ * doc/gfortran/intrinsic-procedures/second.rst: New file.
+ * doc/gfortran/intrinsic-procedures/selectedcharkind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/selectedintkind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/selectedrealkind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/setexponent.rst: New file.
+ * doc/gfortran/intrinsic-procedures/shape.rst: New file.
+ * doc/gfortran/intrinsic-procedures/shifta.rst: New file.
+ * doc/gfortran/intrinsic-procedures/shiftl.rst: New file.
+ * doc/gfortran/intrinsic-procedures/shiftr.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sign.rst: New file.
+ * doc/gfortran/intrinsic-procedures/signal.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sin.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sind.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sinh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/size.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sizeof.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sleep.rst: New file.
+ * doc/gfortran/intrinsic-procedures/spacing.rst: New file.
+ * doc/gfortran/intrinsic-procedures/spread.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sqrt.rst: New file.
+ * doc/gfortran/intrinsic-procedures/srand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/stat.rst: New file.
+ * doc/gfortran/intrinsic-procedures/storagesize.rst: New file.
+ * doc/gfortran/intrinsic-procedures/sum.rst: New file.
+ * doc/gfortran/intrinsic-procedures/symlnk.rst: New file.
+ * doc/gfortran/intrinsic-procedures/system.rst: New file.
+ * doc/gfortran/intrinsic-procedures/systemclock.rst: New file.
+ * doc/gfortran/intrinsic-procedures/tan.rst: New file.
+ * doc/gfortran/intrinsic-procedures/tand.rst: New file.
+ * doc/gfortran/intrinsic-procedures/tanh.rst: New file.
+ * doc/gfortran/intrinsic-procedures/thisimage.rst: New file.
+ * doc/gfortran/intrinsic-procedures/time.rst: New file.
+ * doc/gfortran/intrinsic-procedures/time8.rst: New file.
+ * doc/gfortran/intrinsic-procedures/tiny.rst: New file.
+ * doc/gfortran/intrinsic-procedures/trailz.rst: New file.
+ * doc/gfortran/intrinsic-procedures/transfer.rst: New file.
+ * doc/gfortran/intrinsic-procedures/transpose.rst: New file.
+ * doc/gfortran/intrinsic-procedures/trim.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ttynam.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ubound.rst: New file.
+ * doc/gfortran/intrinsic-procedures/ucobound.rst: New file.
+ * doc/gfortran/intrinsic-procedures/umask.rst: New file.
+ * doc/gfortran/intrinsic-procedures/unlink.rst: New file.
+ * doc/gfortran/intrinsic-procedures/unpack.rst: New file.
+ * doc/gfortran/intrinsic-procedures/verify.rst: New file.
+ * doc/gfortran/intrinsic-procedures/xor.rst: New file.
+ * doc/gfortran/introduction.rst: New file.
+ * doc/gfortran/mixed-language-programming.rst: New file.
+ * doc/gfortran/naming-and-argument-passing-conventions.rst: New file.
+ * doc/gfortran/non-fortran-main-program.rst: New file.
+ * doc/gfortran/projects.rst: New file.
+ * doc/gfortran/runtime.rst: New file.
+ * doc/gfortran/runtime/gfortranconvertunit.rst: New file.
+ * doc/gfortran/runtime/gfortranerrorbacktrace.rst: New file.
+ * doc/gfortran/runtime/gfortranformattedbuffersize.rst: New file.
+ * doc/gfortran/runtime/gfortranlistseparator.rst: New file.
+ * doc/gfortran/runtime/gfortranoptionalplus.rst: New file.
+ * doc/gfortran/runtime/gfortranshowlocus.rst: New file.
+ * doc/gfortran/runtime/gfortranstderrunit.rst: New file.
+ * doc/gfortran/runtime/gfortranstdinunit.rst: New file.
+ * doc/gfortran/runtime/gfortranstdoutunit.rst: New file.
+ * doc/gfortran/runtime/gfortranunbufferedall.rst: New file.
+ * doc/gfortran/runtime/gfortranunbufferedpreconnected.rst: New file.
+ * doc/gfortran/runtime/gfortranunformattedbuffersize.rst: New file.
+ * doc/gfortran/runtime/tmpdir.rst: New file.
+ * doc/gfortran/standards.rst: New file.
+ * doc/gfortran/type-and-enum-abi-documentation.rst: New file.
+
+2022-11-07 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/107508
+ * trans-array.cc (gfc_alloc_allocatable_for_assignment): Fix
+ string-length check, plug memory leak, and avoid generation of
+ effectively no-op code.
+ * trans-expr.cc (alloc_scalar_allocatable_for_assignment): Extend
+ comment; minor cleanup.
+
+2022-11-03 Tobias Burnus <tobias@codesourcery.com>
+
+ * openmp.cc (gfc_match_omp_clauses): Permit derived types for
+ the 'to' and 'from' clauses of 'target update'.
+ * trans-openmp.cc (gfc_trans_omp_clauses): Fixes for
+ derived-type changes; fix size for scalars.
+
+2022-10-28 Joseph Myers <joseph@codesourcery.com>
+
+ * trans-types.cc (gfc_get_function_type): Do not use
+ build_varargs_function_type_vec for unprototyped function.
+
+2022-10-26 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103413
+ * symbol.cc (gfc_type_compatible): A boz-literal-constant has no type
+ and thus is not considered compatible to any type.
+
+2022-10-21 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/100097
+ PR fortran/100098
+ * trans-array.cc (gfc_trans_class_array): New function to
+ initialize class descriptor's TKR information.
+ * trans-array.h (gfc_trans_class_array): Add function prototype.
+ * trans-decl.cc (gfc_trans_deferred_vars): Add calls to the new
+ function for both pointers and allocatables.
+
+2022-10-20 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/105633
+ * expr.cc (find_array_section): Move check for NULL pointers so
+ that both subscript triplets and vector subscripts are covered.
+
+2022-10-17 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/104330
+ * simplify.cc (gfc_simplify_image_index): Do not dereference NULL
+ pointer.
+
+2022-10-17 Harald Anlauf <anlauf@gmx.de>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/93483
+ PR fortran/107216
+ PR fortran/107219
+ * arith.cc (reduce_unary): Handled expressions are EXP_CONSTANT and
+ EXPR_ARRAY. Do not attempt to reduce otherwise.
+ (reduce_binary_ac): Likewise.
+ (reduce_binary_ca): Likewise.
+ (reduce_binary_aa): Moved check for EXP_CONSTANT and EXPR_ARRAY
+ from here ...
+ (reduce_binary): ... to here.
+ (eval_intrinsic): Catch failed reductions.
+ * gfortran.h (GFC_INTRINSIC_OPS): New enum ARITH_NOT_REDUCED to keep
+ track of expressions that were not reduced by the arithmetic evaluation
+ code.
+
+2022-10-17 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107272
+ * arith.cc (gfc_arith_not): Operand must be of type BT_LOGICAL.
+ (gfc_arith_and): Likewise.
+ (gfc_arith_or): Likewise.
+ (gfc_arith_eqv): Likewise.
+ (gfc_arith_neqv): Likewise.
+ (gfc_arith_eq): Compare consistency of types of operands.
+ (gfc_arith_ne): Likewise.
+ (gfc_arith_gt): Likewise.
+ (gfc_arith_ge): Likewise.
+ (gfc_arith_lt): Likewise.
+ (gfc_arith_le): Likewise.
+
+2022-10-17 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/107266
+ * trans-expr.cc (gfc_conv_string_parameter): Use passed
+ type to honor character kind.
+ * trans-types.cc (gfc_sym_type): Honor character kind.
+ * trans-decl.cc (gfc_conv_cfi_to_gfc): Fix handling kind=4
+ character strings.
+
+2022-10-14 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/100971
+ * resolve.cc (resolve_transfer): Extend check for permissibility
+ of polymorphic elements in a data transfer to arrays.
+
+2022-10-12 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107217
+ * arith.cc (gfc_arith_plus): Compare consistency of types of operands.
+ (gfc_arith_minus): Likewise.
+ (gfc_arith_times): Likewise.
+ (gfc_arith_divide): Likewise.
+ (arith_power): Check that both operands are of numeric type.
+
+2022-10-11 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107215
+ * arith.cc (gfc_int2int): Check validity of type of source expr.
+ (gfc_int2real): Likewise.
+ (gfc_int2complex): Likewise.
+ (gfc_real2int): Likewise.
+ (gfc_real2real): Likewise.
+ (gfc_complex2int): Likewise.
+ (gfc_complex2real): Likewise.
+ (gfc_complex2complex): Likewise.
+ (gfc_log2log): Likewise.
+ (gfc_log2int): Likewise.
+ (gfc_int2log): Likewise.
+
+2022-10-10 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-openmp.cc (gfc_trans_omp_assume): Use create_tmp_var_raw
+ instead of gfc_create_var for TARGET_EXPR slot creation. Create it
+ with boolean_type_node and convert.
+
+2022-10-08 Harald Anlauf <anlauf@gmx.de>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/107000
+ * arith.cc (gfc_arith_error): Define error message for
+ ARITH_INVALID_TYPE.
+ (reduce_unary): Catch arithmetic expressions with invalid type.
+ (reduce_binary_ac): Likewise.
+ (reduce_binary_ca): Likewise.
+ (reduce_binary_aa): Likewise.
+ (eval_intrinsic): Likewise.
+ (gfc_real2complex): Source expression must be of type REAL.
+ * gfortran.h (enum arith): Add ARITH_INVALID_TYPE.
+
+2022-10-06 Tobias Burnus <tobias@codesourcery.com>
+
+ * trans-openmp.cc (gfc_trans_omp_assume): New.
+ (gfc_trans_omp_directive): Call it.
+
+2022-10-05 Tobias Burnus <tobias@codesourcery.com>
+
+ * dump-parse-tree.cc (show_omp_assumes): New.
+ (show_omp_clauses, show_namespace): Call it.
+ (show_omp_node, show_code_node): Handle OpenMP ASSUME.
+ * gfortran.h (enum gfc_statement): Add ST_OMP_ASSUME,
+ ST_OMP_END_ASSUME, ST_OMP_ASSUMES and ST_NOTHING.
+ (gfc_exec_op): Add EXEC_OMP_ASSUME.
+ (gfc_omp_assumptions): New struct.
+ (gfc_get_omp_assumptions): New XCNEW #define.
+ (gfc_omp_clauses, gfc_namespace): Add assume member.
+ (gfc_resolve_omp_assumptions): New prototype.
+ * match.h (gfc_match_omp_assume, gfc_match_omp_assumes): New.
+ * openmp.cc (omp_code_to_statement): Forward declare.
+ (enum gfc_omp_directive_kind, struct gfc_omp_directive): New.
+ (gfc_free_omp_clauses): Free assume member and its struct data.
+ (enum omp_mask2): Add OMP_CLAUSE_ASSUMPTIONS.
+ (gfc_omp_absent_contains_clause): New.
+ (gfc_match_omp_clauses): Call it; optionally use passed
+ omp_clauses argument.
+ (omp_verify_merge_absent_contains, gfc_match_omp_assume,
+ gfc_match_omp_assumes, gfc_resolve_omp_assumptions): New.
+ (resolve_omp_clauses): Call the latter.
+ (gfc_resolve_omp_directive, omp_code_to_statement): Handle
+ EXEC_OMP_ASSUME.
+ * parse.cc (decode_omp_directive): Parse OpenMP ASSUME(S).
+ (next_statement, parse_executable, parse_omp_structured_block):
+ Handle ST_OMP_ASSUME.
+ (case_omp_decl): Add ST_OMP_ASSUMES.
+ (gfc_ascii_statement): Handle Assumes, optional return
+ string without '!$OMP '/'!$ACC ' prefix.
+ * parse.h (gfc_ascii_statement): Add optional bool arg to prototype.
+ * resolve.cc (gfc_resolve_blocks, gfc_resolve_code): Add
+ EXEC_OMP_ASSUME.
+ (gfc_resolve): Resolve ASSUMES directive.
+ * symbol.cc (gfc_free_namespace): Free omp_assumes member.
+ * st.cc (gfc_free_statement): Handle EXEC_OMP_ASSUME.
+ * trans-openmp.cc (gfc_trans_omp_directive): Likewise.
+ * trans.cc (trans_code): Likewise.
+
+2022-10-04 Tobias Burnus <tobias@codesourcery.com>
+
+ * parse.cc (decode_omp_directive): Handle '(end) loop' and 'scan'
+ also with -fopenmp-simd.
+
+2022-10-01 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/100040
+ PR fortran/100029
+ * trans-expr.cc (gfc_conv_class_to_class): Add code to have
+ assumed-rank arrays recognized as full arrays and fix the type
+ of the array assignment.
+ (gfc_conv_procedure_call): Change order of code blocks such that
+ the free of ALLOCATABLE dummy arguments with INTENT(OUT) occurs
+ first.
+
+2022-09-30 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/105318
+ * openmp.cc (resolve_omp_clauses): Update is_device_ptr restrictions
+ for OpenMP 5.1 and map to has_device_addr where applicable; map
+ use_device_ptr to use_device_addr where applicable.
+ Silence integer-range warning for device(omp_{initial,invalid}_device).
+
+2022-09-27 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/107054
+ * simplify.cc (gfc_simplify_unpack): Replace assert by condition
+ that terminates simplification when there are not enough elements
+ in the constructor of argument VECTOR.
+
+2022-09-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/41453
+ * trans-expr.cc (gfc_conv_procedure_call): Allow strictly
+ matching derived types.
+
+2022-09-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/41453
+ PR fortran/99169
+ * trans-expr.cc (gfc_conv_procedure_call): Remove conditions
+ on ALLOCATABLE and POINTER attributes guarding clobber
+ generation.
+
+2022-09-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/41453
+ PR fortran/87401
+ * trans-expr.cc (gfc_conv_procedure_call): Remove condition
+ disabling clobber generation for ASSOCIATE variables.
+
+2022-09-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/41453
+ PR fortran/87395
+ * trans-expr.cc (gfc_conv_procedure_call): Remove condition
+ on SAVE attribute guarding clobber generation.
+
+2022-09-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/41453
+ PR fortran/87395
+ * trans-expr.cc (gfc_conv_procedure_call): Remove condition
+ disabling clobber generation for dummy variables. Remove
+ obsolete comment.
+
+2022-09-25 Harald Anlauf <anlauf@gmx.de>
+ Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/105012
+ * trans-expr.cc (gfc_conv_procedure_call): Use dummy
+ information from associated_dummy if there is no information
+ from the procedure interface.
+
+2022-09-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/106817
+ * trans-expr.cc (gfc_conv_procedure_call): Collect all clobbers
+ to their own separate block. Append the block of clobbers to
+ the procedure preliminary block after the argument evaluation
+ codes for all the arguments.
+
+2022-09-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/105012
+ * trans-expr.cc (gfc_conv_procedure_call): Retrieve variable
+ from the just calculated variable reference.
+
+2022-09-25 Mikael Morin <mikael@gcc.gnu.org>
+
+ * trans.h (gfc_conv_expr_reference): Remove add_clobber
+ argument.
+ * trans-expr.cc (gfc_conv_expr_reference): Ditto. Inline code
+ depending on add_clobber and conditions controlling it ...
+ (gfc_conv_procedure_call): ... to here.
+
+2022-09-22 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/100103
+ * trans-array.cc (gfc_is_reallocatable_lhs): Add select rank
+ temporary associate names as possible targets of automatic
+ reallocation.
+
+2022-09-22 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/82868
+ * trans-decl.cc (generate_coarray_sym_init): Skip symbol
+ if attr.associate_var.
+
+2022-09-20 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/104143
+ * interface.cc (compare_parameter): Permit scalar args to
+ 'type(*), dimension(*)'.
+
+2022-09-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106986
+ * simplify.cc (gfc_simplify_findloc): Do not try to simplify
+ intrinsic FINDLOC when the ARRAY argument has a NULL shape.
+
+2022-09-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106985
+ * expr.cc (gfc_simplify_expr): Avoid NULL pointer dereference.
+
+2022-09-20 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/100132
+ * trans-types.cc (create_fn_spec): Fix function attributes when
+ passing polymorphic pointers.
+
+2022-09-20 Martin Liska <mliska@suse.cz>
+
+ PR fortran/106636
+ * gfortran.texi: Add back link to ISO_VARYING_STRING.
+
+2022-09-20 Martin Liska <mliska@suse.cz>
+
+ * gfortran.texi: Replace "the the" with "the".
+
+2022-09-20 Martin Liska <mliska@suse.cz>
+
+ PR fortran/106636
+ * gfortran.texi: Remove 2 dead links.
+
+2022-09-19 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * libgfortran.h: Declare GFC_FPE_AWAY.
+
+2022-09-15 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106857
+ * simplify.cc (gfc_simplify_pack): Check for NULL pointer dereferences
+ while walking through constructors (error recovery).
+
+2022-09-15 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/104314
+ * resolve.cc (deferred_op_assign): Do not try to generate temporary
+ for deferred character length assignment if types do not agree.
+
+2022-09-15 Richard Biener <rguenther@suse.de>
+
+ * f95-lang.cc (gfc_init_decl_processing): Do not initialize
+ void_list_node.
+
+2022-09-14 Julian Brown <julian@codesourcery.com>
+
+ * trans-openmp.cc (gfc_trans_omp_clauses): Don't create
+ GOMP_MAP_TO_PSET mappings for class metadata, nor GOMP_MAP_POINTER
+ mappings for POINTER_TYPE_P decls.
+
+2022-09-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/95644
+ * f95-lang.cc (gfc_init_builtin_functions): Declare FMA
+ built-ins.
+ * mathbuiltins.def: Declare FMA built-ins.
+ * trans-intrinsic.cc (conv_intrinsic_ieee_fma): New function.
+ (conv_intrinsic_ieee_signbit): New function.
+ (gfc_build_intrinsic_lib_fndecls): Add cases for FMA and
+ SIGNBIT.
+
+2022-09-08 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/106670
+ * scanner.cc (skip_fixed_omp_sentinel): Add -Wsurprising warning
+ for 'omx' sentinels with -fopenmp.
+ * invoke.texi (-Wsurprising): Document additional warning case.
+
+2022-09-06 Tobias Burnus <tobias@codesourcery.com>
+
+ * openmp.cc (resolve_omp_clauses): Remove ordered/linear
+ check as it is handled now in the middle end.
+
+2022-09-05 Tobias Burnus <tobias@codesourcery.com>
+
+ * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle
+ omp_cur_iteration and distinguish doacross/depend.
+ * gfortran.h (enum gfc_omp_depend_doacross_op): Renamed from
+ gfc_omp_depend_op.
+ (enum gfc_omp_depend_doacross_op): Add OMP_DOACROSS_SINK_FIRST,
+ Rename OMP_DEPEND_SINK to OMP_DOACROSS_SINK.
+ (gfc_omp_namelist) Handle renaming, rename depend_op to
+ depend_doacross_op.
+ (struct gfc_omp_clauses): Add doacross_source.
+ * openmp.cc (gfc_match_omp_depend_sink): Renamed to ...
+ (gfc_match_omp_doacross_sink): ... this; handle omp_all_memory.
+ (enum omp_mask2): Add OMP_CLAUSE_DOACROSS.
+ (gfc_match_omp_clauses): Handle 'doacross' and syntax changes to
+ depend.
+ (gfc_match_omp_depobj): Simplify as sink/source are now impossible.
+ (gfc_match_omp_ordered_depend): Request OMP_CLAUSE_DOACROSS.
+ (resolve_omp_clauses): Update sink/source checks.
+ (gfc_resolve_omp_directive): Resolve EXEC_OMP_ORDERED clauses.
+ * parse.cc (decode_omp_directive): Handle 'ordered doacross'.
+ * trans-openmp.cc (gfc_trans_omp_clauses): Handle doacross.
+ (gfc_trans_omp_do): Fix OMP_FOR_ORIG_DECLS handling if 'ordered'
+ clause is present.
+ (gfc_trans_omp_depobj): Update for member name change.
+
+2022-09-04 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/100136
+ * trans-expr.cc (gfc_conv_procedure_call): Add handling of pointer
+ expressions.
+
+2022-09-03 José Rui Faustino de Sousa <jrfsousa@gmail.com>
+
+ PR fortran/100245
+ * trans-expr.cc (trans_class_assignment): Add if clause to handle
+ derived type in the LHS.
+
+2022-09-03 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-openmp.cc (gfc_trans_omp_clauses): Use
+ OMP_CLAUSE_DOACROSS_SINK_NEGATIVE instead of
+ OMP_CLAUSE_DEPEND_SINK_NEGATIVE, build OMP_CLAUSE_DOACROSS
+ clause instead of OMP_CLAUSE_DEPEND and set OMP_CLAUSE_DOACROSS_DEPEND
+ on it.
+
+2022-09-02 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/99349
+ * decl.cc (match_data_constant): Avoid NULL pointer dereference.
+
+2022-08-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/106579
+ * trans-intrinsic.cc: Include realmpfr.h.
+ (conv_intrinsic_ieee_value): New function.
+ (gfc_conv_ieee_arithmetic_function): Handle ieee_value.
+
+2022-08-26 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/106579
+ * f95-lang.cc (gfc_init_builtin_functions): Initialize
+ BUILT_IN_FPCLASSIFY.
+ * libgfortran.h (IEEE_OTHER_VALUE, IEEE_SIGNALING_NAN,
+ IEEE_QUIET_NAN, IEEE_NEGATIVE_INF, IEEE_NEGATIVE_NORMAL,
+ IEEE_NEGATIVE_DENORMAL, IEEE_NEGATIVE_SUBNORMAL,
+ IEEE_NEGATIVE_ZERO, IEEE_POSITIVE_ZERO, IEEE_POSITIVE_DENORMAL,
+ IEEE_POSITIVE_SUBNORMAL, IEEE_POSITIVE_NORMAL, IEEE_POSITIVE_INF):
+ New enum.
+ * trans-intrinsic.cc (conv_intrinsic_ieee_class): New function.
+ (gfc_conv_ieee_arithmetic_function): Handle ieee_class.
+
+2022-08-26 Jakub Jelinek <jakub@redhat.com>
+
+ * f95-lang.cc (gfc_init_builtin_functions): Initialize
+ BUILT_IN_ISSIGNALING.
+
+2022-08-25 Tobias Burnus <tobias@codesourcery.com>
+
+ * parse.cc (parse_omp_structured_block): When parsing strictly
+ structured blocks, issue an error if the end-directive comes
+ before the 'end block'.
+
+2022-08-24 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103694
+ * simplify.cc (simplify_size): The size expression of an array cannot
+ be simplified if an error occurs while resolving the array spec.
+
+2022-08-22 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106557
+ * simplify.cc (gfc_simplify_ibclr): Ensure consistent results of
+ the simplification by dropping a redundant memory representation
+ of argument x.
+ (gfc_simplify_ibset): Likewise.
+
+2022-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/46539
+ * lang.opt (static-libgfortran, static-libquadmath): Change Fortran
+ to Driver.
+ * options.cc (gfc_handle_option): Don't handle OPT_static_libgfortran
+ nor OPT_static_libquadmath here.
+
+2022-08-18 Harald Anlauf <anlauf@gmx.de>
+
+ Revert:
+ 2022-07-31 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/77652
+ * check.cc (gfc_check_associated): Make the rank check of POINTER
+ vs. TARGET match the allowed forms of pointer assignment for the
+ selected Fortran standard.
+
+2022-08-17 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/46539
+ * lang.opt (static-libquadmath): New option.
+ * invoke.texi (-static-libquadmath): Document it.
+ * options.cc (gfc_handle_option): Error out if -static-libquadmath
+ is passed but we do not support it.
+
+2022-08-17 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/106566
+ * openmp.cc (gfc_match_omp_clauses): Fix setting linear-step value
+ to 1 when not specified.
+ (gfc_match_omp_declare_simd): Accept module procedures.
+
+2022-08-16 Martin Liska <mliska@suse.cz>
+
+ * gfortran.texi: Fix link destination to a valid URL.
+
+2022-07-31 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/92805
+ * match.cc (gfc_match_small_literal_int): Make gobbling of leading
+ whitespace optional.
+ (gfc_match_name): Likewise.
+ (gfc_match_char): Likewise.
+ * match.h (gfc_match_small_literal_int): Adjust prototype.
+ (gfc_match_name): Likewise.
+ (gfc_match_char): Likewise.
+ * primary.cc (match_kind_param): Match small literal int or name
+ without gobbling whitespace.
+ (get_kind): Do not skip over blanks.
+ (match_string_constant): Likewise.
+
+2022-07-31 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/77652
+ * check.cc (gfc_check_associated): Make the rank check of POINTER
+ vs. TARGET match the allowed forms of pointer assignment for the
+ selected Fortran standard.
+
+2022-07-29 Tobias Burnus <tobias@codesourcery.com>
+
+ * openmp.cc (resolve_omp_clauses): Permit assumed-size arrays
+ in uniform clause.
+
+2022-07-26 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103504
+ * interface.cc (get_sym_storage_size): Array bounds and character
+ length can only be of integer type.
+
+2022-07-21 Martin Liska <mliska@suse.cz>
+
+ * intrinsic.texi: Remove trailing dots for 2 Fortran fns.
+
+2022-07-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/101330
+ * openmp.cc (gfc_match_iterator): Remove left-over code from
+ development that could lead to a crash on invalid input.
+
+2022-07-19 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103590
+ * resolve.cc (find_array_spec): Change function result to bool to
+ enable error recovery. Generate error message for invalid array
+ reference of non-array entity instead of an internal error.
+ (gfc_resolve_ref): Use function result from find_array_spec for
+ error recovery.
+
+2022-07-15 Steve Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/104313
+ * trans-decl.cc (gfc_generate_return): Do not generate conflicting
+ fake results for functions with no result variable under -ff2c.
+
+2022-07-14 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/106209
+ * decl.cc (add_init_expr_to_sym): Handle bad initializers for
+ implied-shape arrays.
+
+2022-07-12 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/106049
+ * simplify.cc (is_constant_array_expr): A non-zero-sized constant
+ array shall have a non-empty constructor. When the constructor is
+ empty or missing, treat as non-constant.
+
+2022-07-04 Tobias Burnus <tobias@codesourcery.com>
+ Jakub Jelinek <jakub@redhat.com>
+
+ * gfortran.h (gfc_omp_namelist): Update by creating 'linear' struct,
+ move 'linear_op' as 'op' to id and add 'old_modifier' to it.
+ * dump-parse-tree.cc (show_omp_namelist): Update accordingly.
+ * module.cc (mio_omp_declare_simd): Likewise.
+ * trans-openmp.cc (gfc_trans_omp_clauses): Likewise.
+ * openmp.cc (resolve_omp_clauses): Likewise; accept new-style
+ 'val' modifier with do/simd.
+ (gfc_match_omp_clauses): Handle OpenMP 5.2 linear clause syntax.
+
+2022-07-04 Tobias Burnus <tobias@codesourcery.com>
+ Chung-Lin Tang <cltang@codesourcery.com>
+ Thomas Schwinge <thomas@codesourcery.com>
+
+ * openmp.cc (gfc_match_omp_requires): Remove sorry.
+ * parse.cc (decode_omp_directive): Don't regard 'declare target'
+ as target usage for 'omp requires'; add more flags to
+ omp_requires_mask.
+
+2022-07-01 Tobias Burnus <tobias@codesourcery.com>
+
+ * dump-parse-tree.cc (show_omp_namelist): For the map-type,
+ also handle the always modifer and release/delete.
+ * openmp.cc (resolve_omp_clauses): Accept tofrom
+ map-type modifier for target enter/exit data,
+ but use 'to' / 'from' internally.
+
+2022-06-30 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/103137
+ PR fortran/103138
+ PR fortran/103693
+ PR fortran/105243
+ * decl.cc (gfc_match_data_decl): Reject CLASS entity declaration
+ when it is given the PARAMETER attribute.
+
+2022-06-29 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/106121
+ * simplify.cc (gfc_simplify_extends_type_of): Do not attempt to
+ simplify when one of the arguments is a CLASS variable that was
+ not properly declared.
+
+2022-06-28 Jakub Jelinek <jakub@redhat.com>
+
+ * gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
+ * trans-types.h (gfc_real16_use_iec_60559): Declare.
+ * trans-types.cc (gfc_real16_use_iec_60559): Define.
+ (gfc_init_kinds): When building powerpc64le-linux libgfortran
+ on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
+ use_iec_60559.
+ (gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
+ on glibc 2.26 or later.
+ * trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
+ comment. Handle gfc_real16_use_iec_60559.
+ (gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
+
+2022-06-26 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/105691
+ * simplify.cc (gfc_simplify_index): Replace old simplification
+ code by the equivalent of the runtime library implementation. Use
+ HOST_WIDE_INT instead of int for string index, length variables.
+
+2022-06-26 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/105954
+ * decl.cc (variable_decl): Adjust upper bounds for explicit-shape
+ specs with constant bound expressions to ensure non-negative
+ extents.
+
+2022-06-24 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/105813
+ * check.cc (gfc_check_unpack): Try to simplify MASK argument to
+ UNPACK so that checking of the VECTOR argument can work when MASK
+ is a variable.
+
+2022-06-18 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/105986
+ * simplify.cc (gfc_simplify_btest): Add check for POS argument.
+ (gfc_simplify_ibclr): Add check for POS argument.
+ (gfc_simplify_ibits): Add check for POS and LEN arguments.
+ (gfc_simplify_ibset): Add check for POS argument.
+
+2022-06-08 Tobias Burnus <tobias@codesourcery.com>
+
+ * openmp.cc (gfc_match_omp_clauses): Check also parent namespace
+ for 'requires reverse_offload'.
+
+2022-06-07 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-openmp.cc (gfc_trans_omp_clauses): Set
+ OMP_CLAUSE_LINEAR_OLD_LINEAR_MODIFIER on OMP_CLAUSE_LINEAR
+ clauses unconditionally for now.
+
+2022-06-03 Tobias Burnus <tobias@codesourcery.com>
+
+ * openmp.cc (OMP_SCOPE_CLAUSES): Add firstprivate and allocate.
+
+2022-06-02 David Malcolm <dmalcolm@redhat.com>
+
+ * f95-lang.cc (gfc_get_sarif_source_language): New.
+ (LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE): Redefine.
+
+2022-05-31 Jason Merrill <jason@redhat.com>
+
+ * Make-lang.in (fortran.tags): Look at *.cc.
+
+2022-05-30 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/91300
+ * libgfortran.h: Define new error code LIBERROR_NO_MEMORY.
+ * trans-stmt.cc (gfc_trans_allocate): Generate code for setting
+ ERRMSG depending on result of STAT result of ALLOCATE.
+ * trans.cc (gfc_allocate_using_malloc): Use STAT value of
+ LIBERROR_NO_MEMORY in case of failed malloc.
+
+2022-05-28 Tobias Burnus <tobias@codesourcery.com>
+
+ * dump-parse-tree.cc (show_omp_clauses): Handle OMP_LIST_ENTER.
+ * gfortran.h: Add OMP_LIST_ENTER.
+ * openmp.cc (enum omp_mask2, OMP_DECLARE_TARGET_CLAUSES): Add
+ OMP_CLAUSE_ENTER.
+ (gfc_match_omp_clauses, gfc_match_omp_declare_target,
+ resolve_omp_clauses): Handle 'enter' clause.
+
+2022-05-27 Tobias Burnus <tobias@codesourcery.com>
+ Chung-Lin Tang <cltang@codesourcery.com>
+
+ * openmp.cc (gfc_check_omp_requires): Fix clause name in error.
+
+2022-05-24 Tobias Burnus <tobias@codesourcery.com>
+
+ PR c/105378
+ * openmp.cc (gfc_match_omp_taskwait): Accept nowait.
+
+2022-05-23 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/104949
+ * f95-lang.cc (LANG_HOOKS_OMP_ARRAY_SIZE): Redefine.
+ * trans-openmp.cc (gfc_omp_array_size): New.
+ (gfc_trans_omp_variable_list): Never turn has_device_addr
+ to firstprivate.
+ * trans.h (gfc_omp_array_size): New.
+
+2022-05-18 Tobias Burnus <tobias@codesourcery.com>
+
+ * gfortran.h (enum gfc_omp_depend_op): Add OMP_DEPEND_INOUTSET.
+ (gfc_omp_clauses): Enlarge ENUM_BITFIELD.
+ * dump-parse-tree.cc (show_omp_namelist, show_omp_clauses): Handle
+ 'inoutset' depend modifier.
+ * openmp.cc (gfc_match_omp_clauses, gfc_match_omp_depobj): Likewise.
+ * trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj):
+ Likewise.
+
+2022-05-17 Tobias Burnus <tobias@codesourcery.com>
+
+ * dump-parse-tree.cc (show_omp_namelist): Handle omp_all_memory.
+ * openmp.cc (gfc_match_omp_variable_list, gfc_match_omp_depend_sink,
+ gfc_match_omp_clauses, resolve_omp_clauses): Likewise.
+ * trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj):
+ Likewise.
+ * resolve.cc (resolve_symbol): Reject it as symbol.
+
+2022-05-16 Martin Liska <mliska@suse.cz>
+
+ * frontend-passes.cc (gfc_code_walker): Use ARRAY_SIZE.
+ * openmp.cc (gfc_match_omp_context_selector_specification): Likewise.
+ * trans-intrinsic.cc (conv_intrinsic_ieee_builtin): Likewise.
+ * trans-types.cc (gfc_get_array_descr_info): Likewise.
+
+2022-05-13 Tobias Burnus <tobias@codesourcery.com>
+
+ * trans-openmp.cc (gfc_trans_omp_clauses): When mapping nondescriptor
+ array sections, use GOMP_MAP_FIRSTPRIVATE_POINTER instead of
+ GOMP_MAP_POINTER for the pointer attachment.
+
+2022-05-11 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/105230
+ * expr.cc (find_array_section): Correct logic to avoid NULL
+ pointer dereference on invalid array section.
+
+2022-05-10 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/105526
+ * resolve.cc (check_team): New.
+ (gfc_resolve_code): Add checks for arguments to coarray intrinsics
+ FORM TEAM, CHANGE TEAM, and SYNC TEAM.
+
+2022-05-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/105501
+ * match.cc (gfc_match_if): Adjust patterns used for matching.
+ (gfc_match_select_rank): Likewise.
+ * parse.cc (decode_statement): Likewise.
+
+2022-05-05 Sandra Loosemore <sandra@codesourcery.com>
+
+ * gfortran.h (struct gfc_omp_clauses): Add non_rectangular bit.
+ * openmp.cc (is_outer_iteration_variable): New function.
+ (expr_is_invariant): New function.
+ (bound_expr_is_canonical): New function.
+ (resolve_omp_do): Replace existing non-rectangularity error with
+ check for canonical form and setting non_rectangular bit.
+ * trans-openmp.cc (gfc_trans_omp_do): Transfer non_rectangular
+ flag to generated tree structure.
+
+2022-05-02 Sandra Loosemore <sandra@codesourcery.com>
+
+ * trans-openmp.cc (gfc_trans_omp_critical): Set location on OMP
+ tree node.
+ (gfc_trans_omp_do): Likewise.
+ (gfc_trans_omp_masked): Likewise.
+ (gfc_trans_omp_do_simd): Likewise.
+ (gfc_trans_omp_scope): Likewise.
+ (gfc_trans_omp_taskgroup): Likewise.
+ (gfc_trans_omp_taskwait): Likewise.
+ (gfc_trans_omp_distribute): Likewise.
+ (gfc_trans_omp_taskloop): Likewise.
+ (gfc_trans_omp_master_masked_taskloop): Likewise.
+
+2022-04-29 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * gfortran.texi: Fix exchanged period and letter.
+
+2022-04-28 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * gfortran.texi: Mention r16_ieee and r16_ibm.
+ * invoke.texi: Likewise.
+
+2022-04-27 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/103662
+ PR fortran/105379
+ * array.cc (compare_bounds): Use bool as return type.
+ Support non-constant expressions.
+ (gfc_compare_array_spec): Update call to compare_bounds.
+
+2022-04-27 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/102043
+ PR fortran/105381
+ * trans-array.cc (non_negative_strides_array_p): Inline variable
+ orig_decl and merge nested if conditions. Add condition to not
+ recurse if the next argument is the same as the current.
+
+2022-04-25 Jakub Jelinek <jakub@redhat.com>
+ Thomas Schwinge <thomas@codesourcery.com>
+
+ PR fortran/104717
+ * trans-openmp.cc (gfc_trans_oacc_construct): Wrap construct body
+ in an extra BIND_EXPR.
+
+2022-04-24 Mikael Morin <mikael@gcc.gnu.org>
+ Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/103662
+ * interface.cc (gfc_compare_derived_types): Support comparing
+ unlimited polymorphic fake symbols. Recursively compare class
+ descriptor types and virtual table types.
+ * resolve.cc (resolve_fl_derived): Add type to the types list
+ on unlimited polymorphic short-circuit return.
+
+2022-04-22 Mikael Morin <mikael@gcc.gnu.org>
+ Richard Biener <rguenther@suse.de>
+
+ PR fortran/102043
+ * trans.h (gfc_build_array_ref): Add non_negative_offset
+ argument.
+ * trans.cc (gfc_build_array_ref): Ditto. Use pointer arithmetic
+ if non_negative_offset is false.
+ * trans-expr.cc (gfc_conv_substring): Set flag in the call to
+ gfc_build_array_ref.
+ * trans-array.cc (gfc_get_cfi_dim_item,
+ gfc_conv_descriptor_dimension): Same.
+ (build_array_ref): Decide on whether to set the flag and update
+ the call.
+ (gfc_conv_scalarized_array_ref): Same. New argument tmp_array.
+ (gfc_conv_tmp_array_ref): Update call to
+ gfc_conv_scalarized_ref.
+ (non_negative_strides_array_p): New function.
+
+2022-04-22 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/102043
+ * trans-array.cc (gfc_conv_expr_descriptor): Use
+ gfc_conv_tmp_array_ref.
+
+2022-04-22 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/102043
+ * trans-io.cc: Add handling for the case where the array
+ is referenced using pointer arithmetic.
+
+2022-04-22 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/102043
+ * trans-expr.cc: Pre-evaluate src and dest to variables
+ before using them.
+
+2022-04-21 Fritz Reese <foreese@gcc.gnu.org>
+
+ PR fortran/105310
+ * trans-expr.cc (gfc_conv_union_initializer): Pass vec* by reference.
+
+2022-04-13 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/105242
+ * match.cc (match_exit_cycle): Handle missing OMP LOOP, DO and SIMD
+ directives in the EXIT/CYCLE diagnostic.
+
+2022-04-10 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/105184
+ * array.cc (match_subscript): Reject assumed size coarray
+ specification with missing lower bound.
+ * resolve.cc (resolve_allocate_expr): Fix logic for checking
+ allocate-coshape-spec in ALLOCATE statement.
+
+2022-04-05 Sandra Loosemore <sandra@codesourcery.com>
+
+ * trans-openmp.cc (gfc_split_omp_clauses): Fix mask for
+ EXEC_OMP_MASKED_TASKLOOP.
+
+2022-04-05 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104210
+ * arith.cc (eval_intrinsic): Avoid NULL pointer dereference.
+ (gfc_zero_size_array): Likewise.
+
+2022-04-05 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/105138
+ * intrinsic.cc (gfc_is_intrinsic): When a symbol refers to a
+ RECURSIVE procedure, it cannot be an INTRINSIC.
+
+2022-03-30 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/100892
+ * check.cc (gfc_check_associated): Avoid NULL pointer dereference.
+
+2022-03-29 Harald Anlauf <anlauf@gmx.de>
+ Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/104571
+ * resolve.cc (resolve_elemental_actual): Avoid NULL pointer
+ dereference.
+
+2022-03-29 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/50549
+ * resolve.cc (resolve_structure_cons): Reject pointer assignments
+ of character with different lengths in structure constructor.
+
+2022-03-25 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/103691
+ * trans-array.cc (gfc_conv_array_initializer): If TYPE_MAX_VALUE is
+ smaller than TYPE_MIN_VALUE (i.e. empty array), ignore the
+ initializer; if TYPE_MIN_VALUE is equal to TYPE_MAX_VALUE, use just
+ the TYPE_MIN_VALUE as index instead of RANGE_EXPR.
+
+2022-03-23 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/103560
+ * scanner.cc (add_path_to_list): Don't append '/' to the
+ save include path.
+ (open_included_file): Use '/' in concatenating path + file name.
+ * module.cc (gzopen_included_file_1): Likewise.
+
+2022-03-22 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104999
+ * simplify.cc (gfc_simplify_cshift): Ensure temporary holding
+ source array stride is initialized.
+
+2022-03-19 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/104228
+ PR fortran/104570
+ * parse.cc (parse_associate): Use a new distinct gfc_charlen if the
+ copied type has one whose length is not known to be constant.
+ * resolve.cc (resolve_assoc_var): Reset charlen if it’s shared with
+ the associate target regardless of the expression type.
+ Don’t reinitialize charlen if it’s deferred.
+
+2022-03-18 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/103039
+ * trans-openmp.cc (gfc_omp_clause_copy_ctor, gfc_omp_clause_dtor):
+ Only privatize pointer for associate names.
+
+2022-03-18 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/103039
+ * openmp.cc (resolve_omp_clauses): Improve associate-name diagnostic
+ for select type/rank.
+
+2022-03-11 Tobias Burnus <tobias@codesourcery.com>
+
+ * trans-openmp.cc (gfc_trans_omp_clauses, gfc_omp_finish_clause):
+ Obtain size for mapping only if allocatable array is allocated.
+
+2022-03-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104849
+ * expr.cc (find_array_section): Avoid NULL pointer dereference on
+ invalid array section.
+
+2022-03-09 Tobias Burnus <tobias@codesourcery.com>
+
+ * trans-intrinsic.cc (gfc_conv_intrinsic_sizeof): Fix CLASS handling.
+
+2022-03-08 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/104126
+ * trans-expr.cc (gfc_conv_gfc_desc_to_cfi_desc): Handle NULL
+ without MOLD.
+
+2022-03-08 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104811
+ * frontend-passes.cc (optimize_minmaxloc): Do not attempt
+ frontend-optimization of MINLOC/MAXLOC for character arrays, as
+ there is no suitable code yet for inline expansion.
+
+2022-03-07 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/99585
+ PR fortran/104430
+ * trans-expr.cc (conv_parent_component_references): Fix comment;
+ simplify comparison.
+ (gfc_maybe_dereference_var): Avoid d referencing a nonpointer.
+
+2022-03-07 Tobias Burnus <tobias@codesourcery.com>
+
+ * array.cc (gfc_ref_dimen_size): Fix comment typo.
+ * dump-parse-tree.cc (gfc_dump_c_prototypes): Likewise.
+ * frontend-passes.cc (cfe_code): Likewise.
+ * gfortran.texi: Likewise.
+ * resolve.cc (generate_component_assignments): Likewise.
+ * simplify.cc (gfc_simplify_this_image): Likewise.
+ * trans-expr.cc (trans_scalar_class_assign,
+ gfc_maybe_dereference_var): Likewise.
+ * intrinsic.texi: Remove word duplication.
+ * invoke.texi: Likewise.
+
+2022-03-07 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-expr.cc: Fix up duplicated word issue in a comment.
+ * gfortran.h: Likewise.
+ * scanner.cc: Likewise.
+
+2022-03-07 Martin Liska <mliska@suse.cz>
+
+ * intrinsic.cc (gfc_is_intrinsic): Remove asterisk from error
+ message.
+
+2022-03-07 Martin Liska <mliska@suse.cz>
+
+ PR translation/90148
+ * intrinsic.cc (gfc_is_intrinsic): Put
+ quote to a proper place.
+
+2022-03-03 Kwok Cheung Yeung <kcy@codesourcery.com>
+
+ PR fortran/104131
+ * openmp.cc (gfc_match_omp_detach): Move check for type of event
+ handle to...
+ (resolve_omp_clauses) ...here. Also check that the event handle is
+ not an array, or an array access or structure element access.
+
+2022-03-02 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104573
+ * resolve.cc (resolve_structure_cons): Avoid NULL pointer
+ dereference when there is no valid component.
+
+2022-02-24 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/84519
+ * dump-parse-tree.cc (show_code_node): Dump QUIET specifier when
+ present.
+ * match.cc (gfc_match_stopcode): Implement parsing of F2018 QUIET
+ specifier. F2018 stopcodes may have non-default integer kind.
+ * resolve.cc (gfc_resolve_code): Add checks for QUIET argument.
+ * trans-stmt.cc (gfc_trans_stop): Pass QUIET specifier to call of
+ library function.
+
+2022-02-22 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104619
+ * resolve.cc (resolve_structure_cons): Skip shape check if shape
+ of constructor cannot be determined at compile time.
+
+2022-02-20 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/77693
+ * data.cc (gfc_assign_data_value): If a variable in a data
+ statement has the POINTER attribute, check for allowed initial
+ data target that is compatible with pointer assignment.
+ * gfortran.h (IS_POINTER): New macro.
+
+2022-02-15 Tobias Burnus <tobias@codesourcery.com>
+
+ * trans-openmp.cc (gfc_trans_omp_depobj): Fix to alloc/ptr dummy
+ and for c_ptr.
+
+2022-02-15 Tobias Burnus <tobias@codesourcery.com>
+
+ * trans-openmp.cc (gfc_trans_omp_clauses, gfc_trans_omp_depobj):
+ Depend on the proper addr, for ptr/alloc depend on pointee.
+
+2022-02-14 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104211
+ * expr.cc (find_array_section): Replace assertion by error
+ recovery when encountering bad array constructor.
+
+2022-02-13 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/104228
+ * resolve.cc (resolve_assoc_var): Also create a new character
+ length for non-dummy associate targets.
+ * trans-stmt.cc (trans_associate_var): Initialize character length
+ even if no temporary is used for the associate variable.
+
+2022-02-10 Roger Sayle <roger@nextmovesoftware.com>
+ Tobias Burnus <tobias@codesourcery.com>
+
+ * trans-common.cc (GFC_EQUIV_FMT): New macro respecting the
+ target's NO_DOT_IN_LABEL and NO_DOLLAR_IN_LABEL preferences.
+ (build_equiv_decl): Use GFC_EQUIV_FMT here.
+
+2022-02-10 Tobias Burnus <tobias@codesourcery.com>
+
+ PR fortran/104329
+ * openmp.cc (resolve_omp_atomic): Defer extra-code assert after
+ other diagnostics.
+
+2022-02-10 Marcel Vollweiler <marcel@codesourcery.com>
+
+ * dump-parse-tree.cc (show_omp_clauses): Added OMP_LIST_HAS_DEVICE_ADDR
+ case.
+ * gfortran.h: Added OMP_LIST_HAS_DEVICE_ADDR.
+ * openmp.cc (enum omp_mask2): Added OMP_CLAUSE_HAS_DEVICE_ADDR.
+ (gfc_match_omp_clauses): Parse HAS_DEVICE_ADDR clause.
+ (resolve_omp_clauses): Same.
+ * trans-openmp.cc (gfc_trans_omp_variable_list): Added
+ OMP_LIST_HAS_DEVICE_ADDR case.
+ (gfc_trans_omp_clauses): Firstprivatize of array descriptors.
+
+2022-02-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/66193
+ * arith.cc (reduce_binary_ac): When reducing binary expressions,
+ try simplification. Handle case of empty constructor.
+ (reduce_binary_ca): Likewise.
+
+2022-02-03 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104311
+ * check.cc (gfc_calculate_transfer_sizes): Checks for case when
+ storage size of SOURCE is greater than zero while the storage size
+ of MOLD is zero and MOLD is an array shall not depend on SIZE.
+
+2022-02-03 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/104328
+ * openmp.cc (is_scalar_intrinsic_expr): If must_be_var && conv_ok
+ and expr is conversion, verify it is a conversion from EXPR_VARIABLE
+ with non-NULL symtree. Check ->block->next before dereferencing it.
+
+2022-02-01 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104331
+ * simplify.cc (gfc_simplify_eoshift): Avoid NULL pointer
+ dereference when shape is not set.
+
+2022-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/103790
+ * trans-array.cc (structure_alloc_comps): Prevent descriptor
+ stacking for non-array data; do not broadcast caf-tokens.
+ * trans-intrinsic.cc (conv_co_collective): Prevent generation
+ of unused descriptor.
+
+2022-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ Revert:
+ 2022-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/103790
+ * trans-array.cc (structure_alloc_comps): Prevent descriptor
+ stacking for non-array data; do not broadcast caf-tokens.
+ * trans-intrinsic.cc (conv_co_collective): Prevent generation
+ of unused descriptor.
+
+2022-01-28 Andre Vehreschild <vehre@gcc.gnu.org>
+
+ PR fortran/103790
+ * trans-array.cc (structure_alloc_comps): Prevent descriptor
+ stacking for non-array data; do not broadcast caf-tokens.
+ * trans-intrinsic.cc (conv_co_collective): Prevent generation
+ of unused descriptor.
+
+2022-01-27 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104128
+ * expr.cc (gfc_copy_expr): Convert internal representation of
+ string to wide char in value only for default character kind.
+ * target-memory.cc (interpret_array): Pass flag for conversion of
+ wide chars.
+ (gfc_target_interpret_expr): Likewise.
+
+2022-01-27 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/84784
+ * trans-intrinsic.cc (conv_intrinsic_image_status): Convert result
+ to resulting (default) integer type.
+ (conv_intrinsic_team_number): Likewise.
+ (gfc_conv_intrinsic_popcnt_poppar): Likewise.
+
+2022-01-25 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104227
+ * check.cc (gfc_calculate_transfer_sizes): Fix checking of arrays
+ passed as MOLD argument to the TRANSFER intrinsic for having
+ storage size zero.
+
+2022-01-25 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104212
+ * check.cc (gfc_check_norm2): Check that optional argument DIM is
+ scalar.
+ (gfc_check_parity): Likewise.
+
+2022-01-24 Jakub Jelinek <jakub@redhat.com>
+
+ * lang.opt (fconvert=): Add EnumSet property and mention also
+ r16_ieee and r16_ibm arguments.
+ (big-endian, little-endian, native, swap): Add Set(1) property.
+ (r16_ieee, r16_ibm): New EnumValue entries with Set(2) property.
+ * trans-types.cc (gfc_init_kinds): Emit gfc_fatal_error for
+ -fconvert=r16_ieee or -fconvert=r16_ibm when R16_IEEE <=> R16_IBM
+ conversions aren't supported.
+
+2022-01-22 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/104127
+ * simplify.cc (gfc_simplify_transfer): Ensure that the result
+ typespec is set up for TRANSFER with MOLD of type CHARACTER
+ including character length even if the result is a zero-sized
+ array.
+
+2022-01-20 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR fortran/103695
+ PR fortran/102621
+ * gfortran.h (struct gfc_namespace) Add omp_affinity_iterator
+ field.
+ * dump-parse-tree.cc (show_iterator): Use it.
+ * openmp.cc (gfc_match_iterator): Likewise.
+ (resolve_omp_clauses): Likewise.
+ * trans-decl.cc (gfc_finish_var_decl): Likewise.
+ * trans-openmp.cc (handle_iterator): Likewise.
+
+2022-01-18 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103692
+ * array.cc (gfc_expand_constructor): Handle zero-sized array
+ constructors.
+
+2022-01-17 Martin Liska <mliska@suse.cz>
+
+ * check.cc (gfc_check_all_any): Rename .c names to .cc.
+ * class.cc (find_intrinsic_vtab): Likewise.
+ * config-lang.in: Likewise.
+ * cpp.cc (cpp_define_builtins): Likewise.
+ * data.cc (get_array_index): Likewise.
+ * decl.cc (match_clist_expr): Likewise.
+ (get_proc_name): Likewise.
+ (gfc_verify_c_interop_param): Likewise.
+ (gfc_get_pdt_instance): Likewise.
+ (gfc_match_formal_arglist): Likewise.
+ (gfc_get_type_attr_spec): Likewise.
+ * dependency.cc: Likewise.
+ * error.cc (gfc_format_decoder): Likewise.
+ * expr.cc (check_restricted): Likewise.
+ (gfc_build_default_init_expr): Likewise.
+ * f95-lang.cc: Likewise.
+ * gfc-internals.texi: Likewise.
+ * gfortran.h (enum match): Likewise.
+ (enum procedure_type): Likewise.
+ (enum oacc_routine_lop): Likewise.
+ (gfc_get_pdt_instance): Likewise.
+ (gfc_end_source_files): Likewise.
+ (gfc_mpz_set_hwi): Likewise.
+ (gfc_get_option_string): Likewise.
+ (gfc_find_sym_in_expr): Likewise.
+ (gfc_errors_to_warnings): Likewise.
+ (gfc_real_4_kind): Likewise.
+ (gfc_free_finalizer): Likewise.
+ (gfc_sym_get_dummy_args): Likewise.
+ (gfc_check_intrinsic_standard): Likewise.
+ (gfc_free_case_list): Likewise.
+ (gfc_resolve_oacc_routines): Likewise.
+ (gfc_check_vardef_context): Likewise.
+ (gfc_free_association_list): Likewise.
+ (gfc_implicit_pure_function): Likewise.
+ (gfc_ref_dimen_size): Likewise.
+ (gfc_compare_actual_formal): Likewise.
+ (gfc_resolve_wait): Likewise.
+ (gfc_dt_upper_string): Likewise.
+ (gfc_generate_module_code): Likewise.
+ (gfc_delete_bbt): Likewise.
+ (debug): Likewise.
+ (gfc_build_block_ns): Likewise.
+ (gfc_dep_difference): Likewise.
+ (gfc_invalid_null_arg): Likewise.
+ (gfc_is_finalizable): Likewise.
+ (gfc_fix_implicit_pure): Likewise.
+ (gfc_is_size_zero_array): Likewise.
+ (gfc_is_reallocatable_lhs): Likewise.
+ * gfortranspec.cc: Likewise.
+ * interface.cc (compare_actual_expr): Likewise.
+ * intrinsic.cc (add_functions): Likewise.
+ * iresolve.cc (gfc_resolve_matmul): Likewise.
+ (gfc_resolve_alarm_sub): Likewise.
+ * iso-c-binding.def: Likewise.
+ * lang-specs.h: Likewise.
+ * libgfortran.h (GFC_STDERR_UNIT_NUMBER): Likewise.
+ * match.cc (gfc_match_label): Likewise.
+ (gfc_match_symbol): Likewise.
+ (match_derived_type_spec): Likewise.
+ (copy_ts_from_selector_to_associate): Likewise.
+ * match.h (gfc_match_call): Likewise.
+ (gfc_get_common): Likewise.
+ (gfc_match_omp_end_single): Likewise.
+ (gfc_match_volatile): Likewise.
+ (gfc_match_bind_c): Likewise.
+ (gfc_match_literal_constant): Likewise.
+ (gfc_match_init_expr): Likewise.
+ (gfc_match_array_constructor): Likewise.
+ (gfc_match_end_interface): Likewise.
+ (gfc_match_print): Likewise.
+ (gfc_match_expr): Likewise.
+ * matchexp.cc (next_operator): Likewise.
+ * mathbuiltins.def: Likewise.
+ * module.cc (free_true_name): Likewise.
+ * openmp.cc (gfc_resolve_omp_parallel_blocks): Likewise.
+ (gfc_omp_save_and_clear_state): Likewise.
+ * parse.cc (parse_union): Likewise.
+ (set_syms_host_assoc): Likewise.
+ * resolve.cc (resolve_actual_arglist): Likewise.
+ (resolve_elemental_actual): Likewise.
+ (check_host_association): Likewise.
+ (resolve_typebound_function): Likewise.
+ (resolve_typebound_subroutine): Likewise.
+ (gfc_resolve_expr): Likewise.
+ (resolve_assoc_var): Likewise.
+ (resolve_typebound_procedures): Likewise.
+ (resolve_equivalence_derived): Likewise.
+ * simplify.cc (simplify_bound): Likewise.
+ * symbol.cc (gfc_set_default_type): Likewise.
+ (gfc_add_ext_attribute): Likewise.
+ * target-memory.cc (gfc_target_interpret_expr): Likewise.
+ * target-memory.h (gfc_target_interpret_expr): Likewise.
+ * trans-array.cc (gfc_get_cfi_dim_sm): Likewise.
+ (gfc_conv_shift_descriptor_lbound): Likewise.
+ (gfc_could_be_alias): Likewise.
+ (gfc_get_dataptr_offset): Likewise.
+ * trans-const.cc: Likewise.
+ * trans-decl.cc (trans_function_start): Likewise.
+ (gfc_trans_deferred_vars): Likewise.
+ (generate_local_decl): Likewise.
+ (gfc_generate_function_code): Likewise.
+ * trans-expr.cc (gfc_vptr_size_get): Likewise.
+ (gfc_trans_class_array_init_assign): Likewise.
+ (POWI_TABLE_SIZE): Likewise.
+ (gfc_conv_procedure_call): Likewise.
+ (gfc_trans_arrayfunc_assign): Likewise.
+ * trans-intrinsic.cc (gfc_conv_intrinsic_len): Likewise.
+ (gfc_conv_intrinsic_loc): Likewise.
+ (conv_intrinsic_event_query): Likewise.
+ * trans-io.cc (gfc_build_st_parameter): Likewise.
+ * trans-openmp.cc (gfc_omp_check_optional_argument): Likewise.
+ (gfc_omp_unshare_expr_r): Likewise.
+ (gfc_trans_omp_array_section): Likewise.
+ (gfc_trans_omp_clauses): Likewise.
+ * trans-stmt.cc (trans_associate_var): Likewise.
+ (gfc_trans_deallocate): Likewise.
+ * trans-stmt.h (gfc_trans_class_init_assign): Likewise.
+ (gfc_trans_deallocate): Likewise.
+ (gfc_trans_oacc_declare): Likewise.
+ * trans-types.cc: Likewise.
+ * trans-types.h (enum gfc_packed): Likewise.
+ * trans.cc (N_): Likewise.
+ (trans_code): Likewise.
+ * trans.h (gfc_build_compare_string): Likewise.
+ (gfc_conv_expr_type): Likewise.
+ (gfc_trans_deferred_vars): Likewise.
+ (getdecls): Likewise.
+ (gfc_get_array_descr_info): Likewise.
+ (gfc_omp_firstprivatize_type_sizes): Likewise.
+ (GTY): Likewise.
+
+2022-01-17 Martin Liska <mliska@suse.cz>
+
+ * arith.c: Moved to...
+ * arith.cc: ...here.
+ * array.c: Moved to...
+ * array.cc: ...here.
+ * bbt.c: Moved to...
+ * bbt.cc: ...here.
+ * check.c: Moved to...
+ * check.cc: ...here.
+ * class.c: Moved to...
+ * class.cc: ...here.
+ * constructor.c: Moved to...
+ * constructor.cc: ...here.
+ * convert.c: Moved to...
+ * convert.cc: ...here.
+ * cpp.c: Moved to...
+ * cpp.cc: ...here.
+ * data.c: Moved to...
+ * data.cc: ...here.
+ * decl.c: Moved to...
+ * decl.cc: ...here.
+ * dependency.c: Moved to...
+ * dependency.cc: ...here.
+ * dump-parse-tree.c: Moved to...
+ * dump-parse-tree.cc: ...here.
+ * error.c: Moved to...
+ * error.cc: ...here.
+ * expr.c: Moved to...
+ * expr.cc: ...here.
+ * f95-lang.c: Moved to...
+ * f95-lang.cc: ...here.
+ * frontend-passes.c: Moved to...
+ * frontend-passes.cc: ...here.
+ * gfortranspec.c: Moved to...
+ * gfortranspec.cc: ...here.
+ * interface.c: Moved to...
+ * interface.cc: ...here.
+ * intrinsic.c: Moved to...
+ * intrinsic.cc: ...here.
+ * io.c: Moved to...
+ * io.cc: ...here.
+ * iresolve.c: Moved to...
+ * iresolve.cc: ...here.
+ * match.c: Moved to...
+ * match.cc: ...here.
+ * matchexp.c: Moved to...
+ * matchexp.cc: ...here.
+ * misc.c: Moved to...
+ * misc.cc: ...here.
+ * module.c: Moved to...
+ * module.cc: ...here.
+ * openmp.c: Moved to...
+ * openmp.cc: ...here.
+ * options.c: Moved to...
+ * options.cc: ...here.
+ * parse.c: Moved to...
+ * parse.cc: ...here.
+ * primary.c: Moved to...
+ * primary.cc: ...here.
+ * resolve.c: Moved to...
+ * resolve.cc: ...here.
+ * scanner.c: Moved to...
+ * scanner.cc: ...here.
+ * simplify.c: Moved to...
+ * simplify.cc: ...here.
+ * st.c: Moved to...
+ * st.cc: ...here.
+ * symbol.c: Moved to...
+ * symbol.cc: ...here.
+ * target-memory.c: Moved to...
+ * target-memory.cc: ...here.
+ * trans-array.c: Moved to...
+ * trans-array.cc: ...here.
+ * trans-common.c: Moved to...
+ * trans-common.cc: ...here.
+ * trans-const.c: Moved to...
+ * trans-const.cc: ...here.
+ * trans-decl.c: Moved to...
+ * trans-decl.cc: ...here.
+ * trans-expr.c: Moved to...
+ * trans-expr.cc: ...here.
+ * trans-intrinsic.c: Moved to...
+ * trans-intrinsic.cc: ...here.
+ * trans-io.c: Moved to...
+ * trans-io.cc: ...here.
+ * trans-openmp.c: Moved to...
+ * trans-openmp.cc: ...here.
+ * trans-stmt.c: Moved to...
+ * trans-stmt.cc: ...here.
+ * trans-types.c: Moved to...
+ * trans-types.cc: ...here.
+ * trans.c: Moved to...
+ * trans.cc: ...here.
+
+2022-01-17 Andrew Stubbs <ams@codesourcery.com>
+
+ * openmp.c (gfc_match_omp_requires): Don't "sorry" dynamic_allocators.
+
+2022-01-15 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/83079
+ * target-memory.c (gfc_interpret_character): Result length is
+ in bytes and thus depends on the character kind.
+ * trans-intrinsic.c (gfc_conv_intrinsic_transfer): Compute correct
+ string length for the result of the TRANSFER intrinsic and for
+ temporaries for the different character kinds.
+
+2022-01-14 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/99256
+ * intrinsic.c: Do not check formal argument type when checking
+ arguments of intrinsics for alternate return specifiers.
+
+2022-01-14 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103782
+ * expr.c (gfc_simplify_expr): Adjust logic for when to scalarize a
+ call of an intrinsic which may have been overloaded.
+
+2022-01-13 Hafiz Abid Qadeer <abidh@codesourcery.com>
+
+ * dump-parse-tree.c (show_omp_clauses): Handle OMP_LIST_ALLOCATE.
+ * gfortran.h (OMP_LIST_ALLOCATE): New enum value.
+ * openmp.c (enum omp_mask1): Add OMP_CLAUSE_ALLOCATE.
+ (gfc_match_omp_clauses): Handle OMP_CLAUSE_ALLOCATE
+ (OMP_PARALLEL_CLAUSES, OMP_DO_CLAUSES, OMP_SECTIONS_CLAUSES)
+ (OMP_TASK_CLAUSES, OMP_TASKLOOP_CLAUSES, OMP_TARGET_CLAUSES)
+ (OMP_TEAMS_CLAUSES, OMP_DISTRIBUTE_CLAUSES)
+ (OMP_SINGLE_CLAUSES): Add OMP_CLAUSE_ALLOCATE.
+ (OMP_TASKGROUP_CLAUSES): New.
+ (gfc_match_omp_taskgroup): Use OMP_TASKGROUP_CLAUSES instead of
+ OMP_CLAUSE_TASK_REDUCTION.
+ (resolve_omp_clauses): Handle OMP_LIST_ALLOCATE.
+ (resolve_omp_do): Avoid warning when loop iteration variable is
+ in allocate clause.
+ * trans-openmp.c (gfc_trans_omp_clauses): Handle translation of
+ allocate clause.
+ (gfc_split_omp_clauses): Update for OMP_LIST_ALLOCATE.
+
+2022-01-13 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/67804
+ * primary.c (gfc_match_structure_constructor): Recover from errors
+ that occurred while checking for a valid structure constructor in
+ a DATA statement.
+
+2022-01-11 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * libgfortran.h (unit_convert): Add flags.
+
+2022-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-types.c (gfc_init_kinds): When setting abi_kind to 17, if not
+ targetting glibc 2.32 or later and -fbuilding-libgfortran, set
+ gfc_real16_is_float128 and c_float128 in gfc_real_kinds.
+ (gfc_build_real_type): Don't set c_long_double if c_float128 is
+ already set.
+ * trans-intrinsic.c (builtin_decl_for_precision): Don't use
+ long_double_built_in if gfc_real16_is_float128 and
+ long_double_type_node == gfc_float128_type_node.
+ * lang.opt (fbuilding-libgfortran): New undocumented option.
+
+2022-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-intrinsic.c (gfc_get_intrinsic_lib_fndecl): Use
+ gfc_type_abi_kind.
+
+2022-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-io.c (transfer_array_desc): Pass abi kind instead of kind
+ to libgfortran.
+
+2022-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ * trans-io.c (transfer_namelist_element): Use gfc_type_abi_kind,
+ formatting fixes.
+ (transfer_expr): Use gfc_type_abi_kind, use *REAL128* APIs even
+ for abi_kind == 17.
+
+2022-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ * gfortran.h (gfc_real_info): Add abi_kind member.
+ (gfc_type_abi_kind): Declare.
+ * trans-types.c (gfc_init_kinds): Initialize abi_kind.
+ * intrinsic.c (gfc_type_abi_kind): New function.
+ (conv_name): Use it.
+ * iresolve.c (resolve_transformational, gfc_resolve_abs,
+ gfc_resolve_char_achar, gfc_resolve_acos, gfc_resolve_acosh,
+ gfc_resolve_aimag, gfc_resolve_and, gfc_resolve_aint, gfc_resolve_all,
+ gfc_resolve_anint, gfc_resolve_any, gfc_resolve_asin,
+ gfc_resolve_asinh, gfc_resolve_atan, gfc_resolve_atanh,
+ gfc_resolve_atan2, gfc_resolve_bessel_n2, gfc_resolve_ceiling,
+ gfc_resolve_cmplx, gfc_resolve_complex, gfc_resolve_cos,
+ gfc_resolve_cosh, gfc_resolve_count, gfc_resolve_dble,
+ gfc_resolve_dim, gfc_resolve_dot_product, gfc_resolve_dprod,
+ gfc_resolve_exp, gfc_resolve_floor, gfc_resolve_hypot,
+ gfc_resolve_int, gfc_resolve_int2, gfc_resolve_int8, gfc_resolve_long,
+ gfc_resolve_log, gfc_resolve_log10, gfc_resolve_logical,
+ gfc_resolve_matmul, gfc_resolve_minmax, gfc_resolve_maxloc,
+ gfc_resolve_findloc, gfc_resolve_maxval, gfc_resolve_merge,
+ gfc_resolve_minloc, gfc_resolve_minval, gfc_resolve_mod,
+ gfc_resolve_modulo, gfc_resolve_nearest, gfc_resolve_or,
+ gfc_resolve_real, gfc_resolve_realpart, gfc_resolve_reshape,
+ gfc_resolve_sign, gfc_resolve_sin, gfc_resolve_sinh, gfc_resolve_sqrt,
+ gfc_resolve_tan, gfc_resolve_tanh, gfc_resolve_transpose,
+ gfc_resolve_trigd, gfc_resolve_xor, gfc_resolve_random_number):
+ Likewise.
+ * trans-decl.c (gfc_build_intrinsic_function_decls): Likewise.
+
+2022-01-10 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/103366
+ * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Allow unlimited
+ polymorphic actual argument passed to assumed type formal.
+
+2022-01-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/103777
+ * simplify.c (gfc_simplify_maskr): Check validity of argument 'I'
+ before simplifying.
+ (gfc_simplify_maskl): Likewise.
+
+2022-01-09 Harald Anlauf <anlauf@gmx.de>
+
+ PR fortran/101762
+ * expr.c (gfc_check_pointer_assign): For pointer initialization
+ targets, check that subscripts and substring indices in
+ specifications are constant expressions.
+
+2022-01-09 Mikael Morin <mikael@gcc.gnu.org>
+
+ PR fortran/103789
+ * trans-array.c (arg_evaluated_for_scalarization): Add MASKL, MASKR,
+ SCAN and VERIFY to the list of intrinsics whose KIND argument is to be
+ ignored.
+
+2022-01-07 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR fortran/103898
+ * trans-intrinsic.c (gfc_conv_intrinsic_size): Make size_var
+ actually be a variable and fix surrounding code.
+
+2022-01-06 Steve Kargl <kargl@gcc.gnu.org>
+ Sandra Loosemore <sandra@codesourcery.com>
+
+ PR fortran/103287
+ * interface.c (argument_rank_mismatch): Replace incorrect assertion
+ with return.
+
+2022-01-05 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR fortran/103258
+ * decl.c (gfc_match_char_spec): Suppress errors around call
+ to gfc_reduce_init_expr.
+ * error.c (gfc_query_suppress_errors): New.
+ * gfortran.h (gfc_query_suppress_errors): Declare.
+ * symbol.c (gfc_set_default_type): Check gfc_query_suppress_errors.
+
+2022-01-03 Sandra Loosemore <sandra@codesourcery.com>
+
+ PR fortran/103390
+ * expr.c (gfc_is_simply_contiguous): Make it smarter about
+ function calls.
+ * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Do not generate
+ copy loops for array expressions that are not "variables" (lvalues).
+
+2022-01-03 Jakub Jelinek <jakub@redhat.com>
+
+ * gfortranspec.c (lang_specific_driver): Update copyright notice
+ dates.
+ * gfc-internals.texi: Bump @copying's copyright year.
+ * gfortran.texi: Ditto.
+ * intrinsic.texi: Ditto.
+ * invoke.texi: Ditto.
+
+
+Copyright (C) 2022 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index 1cb47cb..1666fd8 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -1,6 +1,6 @@
# -*- makefile -*-
# Top level makefile fragment for GNU gfortran, the GNU Fortran 95 compiler.
-# Copyright (C) 2002-2022 Free Software Foundation, Inc.
+# Copyright (C) 2002-2023 Free Software Foundation, Inc.
# Contributed by Paul Brook <paul@nowt.org
# and Steven Bosscher <s.bosscher@student.tudelft.nl>
diff --git a/gcc/fortran/arith.cc b/gcc/fortran/arith.cc
index d57059a..ddf9874 100644
--- a/gcc/fortran/arith.cc
+++ b/gcc/fortran/arith.cc
@@ -1,5 +1,5 @@
/* Compiler arithmetic
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -118,6 +118,9 @@ gfc_arith_error (arith code)
case ARITH_WRONGCONCAT:
p = G_("Illegal type in character concatenation at %L");
break;
+ case ARITH_INVALID_TYPE:
+ p = G_("Invalid type in arithmetic operation at %L");
+ break;
default:
gfc_internal_error ("gfc_arith_error(): Bad error code");
@@ -419,6 +422,9 @@ gfc_arith_not (gfc_expr *op1, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != BT_LOGICAL)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, op1->ts.kind, &op1->where);
result->value.logical = !op1->value.logical;
*resultp = result;
@@ -432,6 +438,9 @@ gfc_arith_and (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != BT_LOGICAL || op2->ts.type != BT_LOGICAL)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_kind_max (op1, op2),
&op1->where);
result->value.logical = op1->value.logical && op2->value.logical;
@@ -446,6 +455,9 @@ gfc_arith_or (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != BT_LOGICAL || op2->ts.type != BT_LOGICAL)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_kind_max (op1, op2),
&op1->where);
result->value.logical = op1->value.logical || op2->value.logical;
@@ -460,6 +472,9 @@ gfc_arith_eqv (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != BT_LOGICAL || op2->ts.type != BT_LOGICAL)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_kind_max (op1, op2),
&op1->where);
result->value.logical = op1->value.logical == op2->value.logical;
@@ -474,6 +489,9 @@ gfc_arith_neqv (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != BT_LOGICAL || op2->ts.type != BT_LOGICAL)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_kind_max (op1, op2),
&op1->where);
result->value.logical = op1->value.logical != op2->value.logical;
@@ -621,6 +639,9 @@ gfc_arith_plus (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
gfc_expr *result;
arith rc;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
switch (op1->ts.type)
@@ -655,6 +676,9 @@ gfc_arith_minus (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
gfc_expr *result;
arith rc;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
switch (op1->ts.type)
@@ -689,6 +713,9 @@ gfc_arith_times (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
gfc_expr *result;
arith rc;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
switch (op1->ts.type)
@@ -724,6 +751,9 @@ gfc_arith_divide (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
gfc_expr *result;
arith rc;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
rc = ARITH_OK;
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
@@ -748,7 +778,7 @@ gfc_arith_divide (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
char *p;
p = mpz_get_str (NULL, 10, result->value.integer);
- gfc_warning_now (OPT_Winteger_division, "Integer division "
+ gfc_warning (OPT_Winteger_division, "Integer division "
"truncated to constant %qs at %L", p,
&op1->where);
free (p);
@@ -812,6 +842,16 @@ arith_power (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
gfc_expr *result;
arith rc;
+ if (!gfc_numeric_ts (&op1->ts) || !gfc_numeric_ts (&op2->ts))
+ return ARITH_INVALID_TYPE;
+
+ /* The result type is derived from op1 and must be compatible with the
+ result of the simplification. Otherwise postpone simplification until
+ after operand conversions usually done by gfc_type_convert_binary. */
+ if ((op1->ts.type == BT_INTEGER && op2->ts.type != BT_INTEGER)
+ || (op1->ts.type == BT_REAL && op2->ts.type == BT_COMPLEX))
+ return ARITH_NOT_REDUCED;
+
rc = ARITH_OK;
result = gfc_get_constant_expr (op1->ts.type, op1->ts.kind, &op1->where);
@@ -1169,6 +1209,9 @@ gfc_arith_eq (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind,
&op1->where);
result->value.logical = (op1->ts.type == BT_COMPLEX)
@@ -1185,6 +1228,9 @@ gfc_arith_ne (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind,
&op1->where);
result->value.logical = (op1->ts.type == BT_COMPLEX)
@@ -1201,6 +1247,9 @@ gfc_arith_gt (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind,
&op1->where);
result->value.logical = (gfc_compare_expr (op1, op2, INTRINSIC_GT) > 0);
@@ -1215,6 +1264,9 @@ gfc_arith_ge (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind,
&op1->where);
result->value.logical = (gfc_compare_expr (op1, op2, INTRINSIC_GE) >= 0);
@@ -1229,6 +1281,9 @@ gfc_arith_lt (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind,
&op1->where);
result->value.logical = (gfc_compare_expr (op1, op2, INTRINSIC_LT) < 0);
@@ -1243,6 +1298,9 @@ gfc_arith_le (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
{
gfc_expr *result;
+ if (op1->ts.type != op2->ts.type)
+ return ARITH_INVALID_TYPE;
+
result = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind,
&op1->where);
result->value.logical = (gfc_compare_expr (op1, op2, INTRINSIC_LE) <= 0);
@@ -1264,6 +1322,9 @@ reduce_unary (arith (*eval) (gfc_expr *, gfc_expr **), gfc_expr *op,
if (op->expr_type == EXPR_CONSTANT)
return eval (op, result);
+ if (op->expr_type != EXPR_ARRAY)
+ return ARITH_NOT_REDUCED;
+
rc = ARITH_OK;
head = gfc_constructor_copy (op->value.constructor);
for (c = gfc_constructor_first (head); c; c = gfc_constructor_next (c))
@@ -1281,8 +1342,16 @@ reduce_unary (arith (*eval) (gfc_expr *, gfc_expr **), gfc_expr *op,
else
{
gfc_constructor *c = gfc_constructor_first (head);
- r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind,
- &op->where);
+ if (c == NULL)
+ {
+ /* Handle zero-sized arrays. */
+ r = gfc_get_array_expr (op->ts.type, op->ts.kind, &op->where);
+ }
+ else
+ {
+ r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind,
+ &op->where);
+ }
r->shape = gfc_copy_shape (op->shape, op->rank);
r->rank = op->rank;
r->value.constructor = head;
@@ -1309,6 +1378,8 @@ reduce_binary_ac (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **),
if (c->expr->expr_type == EXPR_CONSTANT)
rc = eval (c->expr, op2, &r);
+ else if (c->expr->expr_type != EXPR_ARRAY)
+ rc = ARITH_NOT_REDUCED;
else
rc = reduce_binary_ac (eval, c->expr, op2, &r);
@@ -1361,6 +1432,8 @@ reduce_binary_ca (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **),
if (c->expr->expr_type == EXPR_CONSTANT)
rc = eval (op1, c->expr, &r);
+ else if (c->expr->expr_type != EXPR_ARRAY)
+ rc = ARITH_NOT_REDUCED;
else
rc = reduce_binary_ca (eval, op1, c->expr, &r);
@@ -1420,14 +1493,15 @@ reduce_binary_aa (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **),
c && d;
c = gfc_constructor_next (c), d = gfc_constructor_next (d))
{
- rc = reduce_binary (eval, c->expr, d->expr, &r);
- if (rc != ARITH_OK)
- break;
+ rc = reduce_binary (eval, c->expr, d->expr, &r);
- gfc_replace_expr (c->expr, r);
+ if (rc != ARITH_OK)
+ break;
+
+ gfc_replace_expr (c->expr, r);
}
- if (c || d)
+ if (rc == ARITH_OK && (c || d))
rc = ARITH_INCOMMENSURATE;
if (rc != ARITH_OK)
@@ -1435,8 +1509,16 @@ reduce_binary_aa (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **),
else
{
gfc_constructor *c = gfc_constructor_first (head);
- r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind,
- &op1->where);
+ if (c == NULL)
+ {
+ /* Handle zero-sized arrays. */
+ r = gfc_get_array_expr (op1->ts.type, op1->ts.kind, &op1->where);
+ }
+ else
+ {
+ r = gfc_get_array_expr (c->expr->ts.type, c->expr->ts.kind,
+ &op1->where);
+ }
r->shape = gfc_copy_shape (op1->shape, op1->rank);
r->rank = op1->rank;
r->value.constructor = head;
@@ -1460,6 +1542,9 @@ reduce_binary (arith (*eval) (gfc_expr *, gfc_expr *, gfc_expr **),
if (op1->expr_type == EXPR_ARRAY && op2->expr_type == EXPR_CONSTANT)
return reduce_binary_ac (eval, op1, op2, result);
+ if (op1->expr_type != EXPR_ARRAY || op2->expr_type != EXPR_ARRAY)
+ return ARITH_NOT_REDUCED;
+
return reduce_binary_aa (eval, op1, op2, result);
}
@@ -1638,6 +1723,8 @@ eval_intrinsic (gfc_intrinsic_op op,
else
rc = reduce_binary (eval.f3, op1, op2, &result);
+ if (rc == ARITH_INVALID_TYPE || rc == ARITH_NOT_REDUCED)
+ goto runtime;
/* Something went wrong. */
if (op == INTRINSIC_POWER && rc == ARITH_PROHIBIT)
@@ -2023,6 +2110,9 @@ gfc_int2int (gfc_expr *src, int kind)
gfc_expr *result;
arith rc;
+ if (src->ts.type != BT_INTEGER)
+ return NULL;
+
result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where);
mpz_set (result->value.integer, src->value.integer);
@@ -2068,6 +2158,9 @@ gfc_int2real (gfc_expr *src, int kind)
gfc_expr *result;
arith rc;
+ if (src->ts.type != BT_INTEGER)
+ return NULL;
+
result = gfc_get_constant_expr (BT_REAL, kind, &src->where);
mpfr_set_z (result->value.real, src->value.integer, GFC_RND_MODE);
@@ -2099,6 +2192,9 @@ gfc_int2complex (gfc_expr *src, int kind)
gfc_expr *result;
arith rc;
+ if (src->ts.type != BT_INTEGER)
+ return NULL;
+
result = gfc_get_constant_expr (BT_COMPLEX, kind, &src->where);
mpc_set_z (result->value.complex, src->value.integer, GFC_MPC_RND_MODE);
@@ -2133,6 +2229,9 @@ gfc_real2int (gfc_expr *src, int kind)
arith rc;
bool did_warn = false;
+ if (src->ts.type != BT_REAL)
+ return NULL;
+
result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where);
gfc_mpfr_to_mpz (result->value.integer, src->value.real, &src->where);
@@ -2158,6 +2257,7 @@ gfc_real2int (gfc_expr *src, int kind)
gfc_typename (&result->ts), &src->where);
did_warn = true;
}
+ mpfr_clear (f);
}
if (!did_warn && warn_conversion_extra)
{
@@ -2179,6 +2279,9 @@ gfc_real2real (gfc_expr *src, int kind)
arith rc;
bool did_warn = false;
+ if (src->ts.type != BT_REAL)
+ return NULL;
+
result = gfc_get_constant_expr (BT_REAL, kind, &src->where);
mpfr_set (result->value.real, src->value.real, GFC_RND_MODE);
@@ -2238,6 +2341,9 @@ gfc_real2complex (gfc_expr *src, int kind)
arith rc;
bool did_warn = false;
+ if (src->ts.type != BT_REAL)
+ return NULL;
+
result = gfc_get_constant_expr (BT_COMPLEX, kind, &src->where);
mpc_set_fr (result->value.complex, src->value.real, GFC_MPC_RND_MODE);
@@ -2290,6 +2396,9 @@ gfc_complex2int (gfc_expr *src, int kind)
arith rc;
bool did_warn = false;
+ if (src->ts.type != BT_COMPLEX)
+ return NULL;
+
result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where);
gfc_mpfr_to_mpz (result->value.integer, mpc_realref (src->value.complex),
@@ -2352,6 +2461,9 @@ gfc_complex2real (gfc_expr *src, int kind)
arith rc;
bool did_warn = false;
+ if (src->ts.type != BT_COMPLEX)
+ return NULL;
+
result = gfc_get_constant_expr (BT_REAL, kind, &src->where);
mpc_real (result->value.real, src->value.complex, GFC_RND_MODE);
@@ -2419,6 +2531,9 @@ gfc_complex2complex (gfc_expr *src, int kind)
arith rc;
bool did_warn = false;
+ if (src->ts.type != BT_COMPLEX)
+ return NULL;
+
result = gfc_get_constant_expr (BT_COMPLEX, kind, &src->where);
mpc_set (result->value.complex, src->value.complex, GFC_MPC_RND_MODE);
@@ -2484,6 +2599,9 @@ gfc_log2log (gfc_expr *src, int kind)
{
gfc_expr *result;
+ if (src->ts.type != BT_LOGICAL)
+ return NULL;
+
result = gfc_get_constant_expr (BT_LOGICAL, kind, &src->where);
result->value.logical = src->value.logical;
@@ -2498,6 +2616,9 @@ gfc_log2int (gfc_expr *src, int kind)
{
gfc_expr *result;
+ if (src->ts.type != BT_LOGICAL)
+ return NULL;
+
result = gfc_get_constant_expr (BT_INTEGER, kind, &src->where);
mpz_set_si (result->value.integer, src->value.logical);
@@ -2512,6 +2633,9 @@ gfc_int2log (gfc_expr *src, int kind)
{
gfc_expr *result;
+ if (src->ts.type != BT_INTEGER)
+ return NULL;
+
result = gfc_get_constant_expr (BT_LOGICAL, kind, &src->where);
result->value.logical = (mpz_cmp_si (src->value.integer, 0) != 0);
@@ -2629,10 +2753,12 @@ gfc_hollerith2real (gfc_expr *src, int kind)
result = gfc_get_constant_expr (BT_REAL, kind, &src->where);
hollerith2representation (result, src);
- gfc_interpret_float (kind, (unsigned char *) result->representation.string,
- result->representation.length, result->value.real);
-
- return result;
+ if (gfc_interpret_float (kind,
+ (unsigned char *) result->representation.string,
+ result->representation.length, result->value.real))
+ return result;
+ else
+ return NULL;
}
/* Convert character to real. The constant will be padded or truncated. */
diff --git a/gcc/fortran/arith.h b/gcc/fortran/arith.h
index 4a79c98..8ec74f5 100644
--- a/gcc/fortran/arith.h
+++ b/gcc/fortran/arith.h
@@ -1,5 +1,5 @@
/* Compiler arithmetic header.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Steven Bosscher
This file is part of GCC.
diff --git a/gcc/fortran/array.cc b/gcc/fortran/array.cc
index bbdb5b3..be5eb8b 100644
--- a/gcc/fortran/array.cc
+++ b/gcc/fortran/array.cc
@@ -1,5 +1,5 @@
/* Array things
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -489,7 +489,20 @@ match_array_element_spec (gfc_array_spec *as)
}
if (gfc_match_char (':') == MATCH_YES)
- return AS_DEFERRED;
+ {
+ locus old_loc = gfc_current_locus;
+ if (gfc_match_char ('*') == MATCH_YES)
+ {
+ /* F2018:R821: "assumed-implied-spec is [ lower-bound : ] *". */
+ gfc_error ("A lower bound must precede colon in "
+ "assumed-size array specification at %L", &old_loc);
+ return AS_UNKNOWN;
+ }
+ else
+ {
+ return AS_DEFERRED;
+ }
+ }
m = gfc_match_expr (upper);
if (m == MATCH_NO)
@@ -499,8 +512,6 @@ match_array_element_spec (gfc_array_spec *as)
if (!gfc_expr_check_typed (*upper, gfc_current_ns, false))
return AS_UNKNOWN;
- gfc_try_simplify_expr (*upper, 0);
-
if (((*upper)->expr_type == EXPR_CONSTANT
&& (*upper)->ts.type != BT_INTEGER) ||
((*upper)->expr_type == EXPR_FUNCTION
@@ -533,8 +544,6 @@ match_array_element_spec (gfc_array_spec *as)
if (!gfc_expr_check_typed (*upper, gfc_current_ns, false))
return AS_UNKNOWN;
- gfc_try_simplify_expr (*upper, 0);
-
if (((*upper)->expr_type == EXPR_CONSTANT
&& (*upper)->ts.type != BT_INTEGER) ||
((*upper)->expr_type == EXPR_FUNCTION
@@ -591,6 +600,8 @@ gfc_match_array_spec (gfc_array_spec **asp, bool match_dim, bool match_codim)
{
as->rank++;
current_type = match_array_element_spec (as);
+ if (current_type == AS_UNKNOWN)
+ goto cleanup;
/* Note that current_type == AS_ASSUMED_SIZE for both assumed-size
and implied-shape specifications. If the rank is at least 2, we can
@@ -600,8 +611,6 @@ gfc_match_array_spec (gfc_array_spec **asp, bool match_dim, bool match_codim)
if (as->rank == 1)
{
- if (current_type == AS_UNKNOWN)
- goto cleanup;
as->type = current_type;
}
else
@@ -958,7 +967,7 @@ gfc_copy_array_spec (gfc_array_spec *src)
/* Returns nonzero if the two expressions are equal.
- We should not need to support more than constant values, as that’s what is
+ We should not need to support more than constant values, as that's what is
allowed in derived type component array spec. However, we may create types
with non-constant array spec for dummy variable class container types, for
which the _data component holds the array spec of the variable declaration.
@@ -970,7 +979,7 @@ compare_bounds (gfc_expr *bound1, gfc_expr *bound2)
if (bound1 == NULL || bound2 == NULL
|| bound1->ts.type != BT_INTEGER
|| bound2->ts.type != BT_INTEGER)
- gfc_internal_error ("gfc_compare_array_spec(): Array spec clobbered");
+ return false;
/* What qualifies as identical bounds? We could probably just check that the
expressions are exact clones. We avoid rewriting a specific comparison
diff --git a/gcc/fortran/bbt.cc b/gcc/fortran/bbt.cc
index 8b65471..851e5e9 100644
--- a/gcc/fortran/bbt.cc
+++ b/gcc/fortran/bbt.cc
@@ -1,5 +1,5 @@
/* Balanced binary trees using treaps.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
diff --git a/gcc/fortran/check.cc b/gcc/fortran/check.cc
index 91d87a1..8c1ae8c 100644
--- a/gcc/fortran/check.cc
+++ b/gcc/fortran/check.cc
@@ -1,5 +1,5 @@
/* Check functions
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught & Katherine Holcomb
This file is part of GCC.
@@ -3888,6 +3888,7 @@ gfc_check_minloc_maxloc (gfc_actual_arglist *ap)
{
b = gfc_get_logical_expr (gfc_logical_4_kind, NULL, 0);
ap->next->next->next->next->expr = b;
+ ap->next->next->next->next->name = gfc_get_string ("back");
}
if (m == NULL && d != NULL && d->ts.type == BT_LOGICAL
@@ -3969,6 +3970,7 @@ gfc_check_findloc (gfc_actual_arglist *ap)
{
b = gfc_get_logical_expr (gfc_logical_4_kind, NULL, 0);
ap->next->next->next->next->next->expr = b;
+ ap->next->next->next->next->next->name = gfc_get_string ("back");
}
if (m == NULL && d != NULL && d->ts.type == BT_LOGICAL
diff --git a/gcc/fortran/class.cc b/gcc/fortran/class.cc
index 731e9b0..bffc0ff 100644
--- a/gcc/fortran/class.cc
+++ b/gcc/fortran/class.cc
@@ -1,5 +1,5 @@
/* Implementation of Fortran 2003 Polymorphism.
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
Contributed by Paul Richard Thomas <pault@gcc.gnu.org>
and Janus Weil <janus@gcc.gnu.org>
@@ -638,6 +638,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
{
char tname[GFC_MAX_SYMBOL_LEN+1];
char *name;
+ gfc_typespec *orig_ts = ts;
gfc_symbol *fclass;
gfc_symbol *vtab;
gfc_component *c;
@@ -646,9 +647,21 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
gcc_assert (as);
- if (attr->class_ok)
- /* Class container has already been built. */
+ /* Class container has already been built with same name. */
+ if (attr->class_ok
+ && ts->u.derived->components->attr.dimension >= attr->dimension
+ && ts->u.derived->components->attr.codimension >= attr->codimension
+ && ts->u.derived->components->attr.class_pointer >= attr->pointer
+ && ts->u.derived->components->attr.allocatable >= attr->allocatable)
return true;
+ if (attr->class_ok)
+ {
+ attr->dimension |= ts->u.derived->components->attr.dimension;
+ attr->codimension |= ts->u.derived->components->attr.codimension;
+ attr->pointer |= ts->u.derived->components->attr.class_pointer;
+ attr->allocatable |= ts->u.derived->components->attr.allocatable;
+ ts = &ts->u.derived->components->ts;
+ }
attr->class_ok = attr->dummy || attr->pointer || attr->allocatable
|| attr->select_type_temporary || attr->associate_var;
@@ -790,7 +803,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
}
fclass->attr.is_class = 1;
- ts->u.derived = fclass;
+ orig_ts->u.derived = fclass;
attr->allocatable = attr->pointer = attr->dimension = attr->codimension = 0;
(*as) = NULL;
free (name);
@@ -896,7 +909,8 @@ has_finalizer_component (gfc_symbol *derived)
gfc_component *c;
for (c = derived->components; c; c = c->next)
- if (c->ts.type == BT_DERIVED && !c->attr.pointer && !c->attr.allocatable)
+ if (c->ts.type == BT_DERIVED && !c->attr.pointer && !c->attr.allocatable
+ && c->attr.flavor != FL_PROCEDURE)
{
if (c->ts.u.derived->f2k_derived
&& c->ts.u.derived->f2k_derived->finalizers)
@@ -1059,7 +1073,8 @@ finalize_component (gfc_expr *expr, gfc_symbol *derived, gfc_component *comp,
{
/* Call FINAL_WRAPPER (comp); */
gfc_code *final_wrap;
- gfc_symbol *vtab;
+ gfc_symbol *vtab, *byte_stride;
+ gfc_expr *scalar, *size_expr, *fini_coarray_expr;
gfc_component *c;
vtab = gfc_find_derived_vtab (comp->ts.u.derived);
@@ -1068,12 +1083,54 @@ finalize_component (gfc_expr *expr, gfc_symbol *derived, gfc_component *comp,
break;
gcc_assert (c);
+
+ /* Set scalar argument for storage_size. */
+ gfc_get_symbol ("comp_byte_stride", sub_ns, &byte_stride);
+ byte_stride->ts = e->ts;
+ byte_stride->attr.flavor = FL_VARIABLE;
+ byte_stride->attr.value = 1;
+ byte_stride->attr.artificial = 1;
+ gfc_set_sym_referenced (byte_stride);
+ gfc_commit_symbol (byte_stride);
+ scalar = gfc_lval_expr_from_sym (byte_stride);
+
final_wrap = gfc_get_code (EXEC_CALL);
final_wrap->symtree = c->initializer->symtree;
final_wrap->resolved_sym = c->initializer->symtree->n.sym;
final_wrap->ext.actual = gfc_get_actual_arglist ();
final_wrap->ext.actual->expr = e;
+ /* size_expr = STORAGE_SIZE (...) / NUMERIC_STORAGE_SIZE. */
+ size_expr = gfc_get_expr ();
+ size_expr->where = gfc_current_locus;
+ size_expr->expr_type = EXPR_OP;
+ size_expr->value.op.op = INTRINSIC_DIVIDE;
+
+ /* STORAGE_SIZE (array,kind=c_intptr_t). */
+ size_expr->value.op.op1
+ = gfc_build_intrinsic_call (sub_ns, GFC_ISYM_STORAGE_SIZE,
+ "storage_size", gfc_current_locus, 2,
+ scalar,
+ gfc_get_int_expr (gfc_index_integer_kind,
+ NULL, 0));
+
+ /* NUMERIC_STORAGE_SIZE. */
+ size_expr->value.op.op2 = gfc_get_int_expr (gfc_index_integer_kind, NULL,
+ gfc_character_storage_size);
+ size_expr->value.op.op1->ts = size_expr->value.op.op2->ts;
+ size_expr->ts = size_expr->value.op.op1->ts;
+
+ /* Which provides the argument 'byte_stride'..... */
+ final_wrap->ext.actual->next = gfc_get_actual_arglist ();
+ final_wrap->ext.actual->next->expr = size_expr;
+
+ /* ...and last of all the 'fini_coarray' argument. */
+ fini_coarray_expr = gfc_lval_expr_from_sym (fini_coarray);
+ final_wrap->ext.actual->next->next = gfc_get_actual_arglist ();
+ final_wrap->ext.actual->next->next->expr = fini_coarray_expr;
+
+
+
if (*code)
{
(*code)->next = final_wrap;
@@ -1430,8 +1487,6 @@ finalizer_insert_packed_call (gfc_code *block, gfc_finalizer *fini,
block->next->resolved_sym = fini->proc_tree->n.sym;
block->next->ext.actual = gfc_get_actual_arglist ();
block->next->ext.actual->expr = gfc_lval_expr_from_sym (array);
- block->next->ext.actual->next = gfc_get_actual_arglist ();
- block->next->ext.actual->next->expr = gfc_copy_expr (size_expr);
/* ELSE. */
@@ -2047,13 +2102,32 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
gfc_set_sym_referenced (ptr);
gfc_commit_symbol (ptr);
+ fini = derived->f2k_derived->finalizers;
+
+ /* Assumed rank finalizers can be called directly. The call takes care
+ of setting up the descriptor. resolve_finalizers has already checked
+ that this is the only finalizer for this kind/type (F2018: C790). */
+ if (fini->proc_tree && fini->proc_tree->n.sym->formal->sym->as
+ && fini->proc_tree->n.sym->formal->sym->as->type == AS_ASSUMED_RANK)
+ {
+ last_code->next = gfc_get_code (EXEC_CALL);
+ last_code->next->symtree = fini->proc_tree;
+ last_code->next->resolved_sym = fini->proc_tree->n.sym;
+ last_code->next->ext.actual = gfc_get_actual_arglist ();
+ last_code->next->ext.actual->expr = gfc_lval_expr_from_sym (array);
+
+ last_code = last_code->next;
+ goto finish_assumed_rank;
+ }
+
/* SELECT CASE (RANK (array)). */
last_code->next = gfc_get_code (EXEC_SELECT);
last_code = last_code->next;
last_code->expr1 = gfc_copy_expr (rank);
block = NULL;
- for (fini = derived->f2k_derived->finalizers; fini; fini = fini->next)
+
+ for (; fini; fini = fini->next)
{
gcc_assert (fini->proc_tree); /* Should have been set in gfc_resolve_finalizers. */
if (fini->proc_tree->n.sym->attr.elemental)
@@ -2152,6 +2226,8 @@ generate_finalization_wrapper (gfc_symbol *derived, gfc_namespace *ns,
}
}
+finish_assumed_rank:
+
/* Finalize and deallocate allocatable components. The same manual
scalarization is used as above. */
@@ -2344,6 +2420,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
vtab->attr.vtab = 1;
vtab->attr.access = ACCESS_PUBLIC;
gfc_set_sym_referenced (vtab);
+ free (name);
name = xasprintf ("__vtype_%s", tname);
gfc_find_symbol (name, ns, 0, &vtype);
@@ -2447,6 +2524,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
else
{
/* Construct default initialization variable. */
+ free (name);
name = xasprintf ("__def_init_%s", tname);
gfc_get_symbol (name, ns, &def_init);
def_init->attr.target = 1;
@@ -2480,6 +2558,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
ns->contained = sub_ns;
sub_ns->resolved = 1;
/* Set up procedure symbol. */
+ free (name);
name = xasprintf ("__copy_%s", tname);
gfc_get_symbol (name, sub_ns, &copy);
sub_ns->proc_name = copy;
@@ -2558,6 +2637,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
ns->contained = sub_ns;
sub_ns->resolved = 1;
/* Set up procedure symbol. */
+ free (name);
name = xasprintf ("__deallocate_%s", tname);
gfc_get_symbol (name, sub_ns, &dealloc);
sub_ns->proc_name = dealloc;
@@ -2682,6 +2762,14 @@ yes:
}
+bool
+gfc_may_be_finalized (gfc_typespec ts)
+{
+ return (ts.type == BT_CLASS || (ts.type == BT_DERIVED
+ && ts.u.derived && gfc_is_finalizable (ts.u.derived, NULL)));
+}
+
+
/* Find (or generate) the symbol for an intrinsic type's vtab. This is
needed to support unlimited polymorphism. */
@@ -2723,6 +2811,7 @@ find_intrinsic_vtab (gfc_typespec *ts)
vtab->attr.vtab = 1;
vtab->attr.access = ACCESS_PUBLIC;
gfc_set_sym_referenced (vtab);
+ free (name);
name = xasprintf ("__vtype_%s", tname);
gfc_find_symbol (name, ns, 0, &vtype);
@@ -2801,6 +2890,7 @@ find_intrinsic_vtab (gfc_typespec *ts)
c->tb = XCNEW (gfc_typebound_proc);
c->tb->ppc = 1;
+ free (name);
if (ts->type != BT_CHARACTER)
name = xasprintf ("__copy_%s", tname);
else
diff --git a/gcc/fortran/config-lang.in b/gcc/fortran/config-lang.in
index 7492bfd..0c45fdd 100644
--- a/gcc/fortran/config-lang.in
+++ b/gcc/fortran/config-lang.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2004-2022 Free Software Foundation, Inc.
+# Copyright (C) 2004-2023 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
diff --git a/gcc/fortran/constructor.cc b/gcc/fortran/constructor.cc
index d07dc84..674d8b1 100644
--- a/gcc/fortran/constructor.cc
+++ b/gcc/fortran/constructor.cc
@@ -1,5 +1,5 @@
/* Array and structure constructors
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/constructor.h b/gcc/fortran/constructor.h
index 0c64098..3d55333 100644
--- a/gcc/fortran/constructor.h
+++ b/gcc/fortran/constructor.h
@@ -1,5 +1,5 @@
/* Array and structure constructors
- Copyright (C) 2009-2022 Free Software Foundation, Inc.
+ Copyright (C) 2009-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/convert.cc b/gcc/fortran/convert.cc
index 926a873..e8400ba 100644
--- a/gcc/fortran/convert.cc
+++ b/gcc/fortran/convert.cc
@@ -1,5 +1,5 @@
/* Data type conversion
- Copyright (C) 1987-2022 Free Software Foundation, Inc.
+ Copyright (C) 1987-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/cpp.cc b/gcc/fortran/cpp.cc
index 364bd0d..c3b7c7f 100644
--- a/gcc/fortran/cpp.cc
+++ b/gcc/fortran/cpp.cc
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is part of GCC.
@@ -605,7 +605,7 @@ gfc_cpp_init (void)
if (gfc_option.flag_preprocessed)
return;
- cpp_change_file (cpp_in, LC_RENAME, _("<built-in>"));
+ cpp_change_file (cpp_in, LC_RENAME, special_fname_builtin ());
if (!gfc_cpp_option.no_predefined)
{
/* Make sure all of the builtins about to be declared have
diff --git a/gcc/fortran/cpp.h b/gcc/fortran/cpp.h
index 28673e3..886996f 100644
--- a/gcc/fortran/cpp.h
+++ b/gcc/fortran/cpp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2008-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/data.cc b/gcc/fortran/data.cc
index 7a5866f..d29eb12 100644
--- a/gcc/fortran/data.cc
+++ b/gcc/fortran/data.cc
@@ -1,5 +1,5 @@
/* Supporting functions for resolving DATA statement.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Lifang Zeng <zlf605@hotmail.com>
This file is part of GCC.
@@ -244,13 +244,6 @@ gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
"array-element nor a scalar-structure-component";
symbol = lvalue->symtree->n.sym;
- if (symbol->attr.flavor == FL_PARAMETER)
- {
- gfc_error ("PARAMETER %qs shall not appear in a DATA statement at %L",
- symbol->name, &lvalue->where);
- return false;
- }
-
init = symbol->value;
last_ts = &symbol->ts;
last_con = NULL;
diff --git a/gcc/fortran/data.h b/gcc/fortran/data.h
index 8ed0dcc..40dbee1 100644
--- a/gcc/fortran/data.h
+++ b/gcc/fortran/data.h
@@ -1,5 +1,5 @@
/* Header for functions resolving DATA statements.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc
index 0f9b2ce..233bf24 100644
--- a/gcc/fortran/decl.cc
+++ b/gcc/fortran/decl.cc
@@ -1,5 +1,5 @@
/* Declaration statement matcher
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -2221,6 +2221,14 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
sym->ts.f90_type = init->ts.f90_type;
}
+ /* Catch the case: type(t), parameter :: x = z'1'. */
+ if (sym->ts.type == BT_DERIVED && init->ts.type == BT_BOZ)
+ {
+ gfc_error ("Entity %qs at %L is incompatible with a BOZ "
+ "literal constant", name, &sym->declared_at);
+ return false;
+ }
+
/* Add initializer. Make sure we keep the ranks sane. */
if (sym->attr.dimension && init->rank == 0)
{
@@ -5990,10 +5998,14 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
}
else
{
- if (tmp_sym->ts.type == BT_DERIVED || ts->type == BT_DERIVED)
- gfc_error ("Type declaration %qs at %L is not C "
- "interoperable but it is BIND(C)",
- tmp_sym->name, &(tmp_sym->declared_at));
+ if (tmp_sym->ts.type == BT_DERIVED || ts->type == BT_DERIVED
+ || tmp_sym->ts.type == BT_CLASS || ts->type == BT_CLASS)
+ {
+ gfc_error ("Type declaration %qs at %L is not C "
+ "interoperable but it is BIND(C)",
+ tmp_sym->name, &(tmp_sym->declared_at));
+ retval = false;
+ }
else if (warn_c_binding_type)
gfc_warning (OPT_Wc_binding_type, "Variable %qs at %L "
"may not be a C interoperable "
@@ -8728,43 +8740,23 @@ attr_decl1 (void)
}
}
- /* Update symbol table. DIMENSION attribute is set in
- gfc_set_array_spec(). For CLASS variables, this must be applied
- to the first component, or '_data' field. */
- if (sym->ts.type == BT_CLASS && sym->ts.u.derived->attr.is_class)
- {
- /* gfc_set_array_spec sets sym->attr not CLASS_DATA(sym)->attr. Check
- for duplicate attribute here. */
- if (CLASS_DATA(sym)->attr.dimension == 1 && as)
- {
- gfc_error ("Duplicate DIMENSION attribute at %C");
- m = MATCH_ERROR;
- goto cleanup;
- }
-
- if (!gfc_copy_attr (&CLASS_DATA(sym)->attr, &current_attr, &var_locus))
- {
- m = MATCH_ERROR;
- goto cleanup;
- }
- }
- else
+ if (sym->ts.type == BT_CLASS
+ && sym->ts.u.derived
+ && sym->ts.u.derived->attr.is_class)
{
- if (current_attr.dimension == 0 && current_attr.codimension == 0
- && !gfc_copy_attr (&sym->attr, &current_attr, &var_locus))
- {
- m = MATCH_ERROR;
- goto cleanup;
- }
+ sym->attr.pointer = CLASS_DATA(sym)->attr.class_pointer;
+ sym->attr.allocatable = CLASS_DATA(sym)->attr.allocatable;
+ sym->attr.dimension = CLASS_DATA(sym)->attr.dimension;
+ sym->attr.codimension = CLASS_DATA(sym)->attr.codimension;
+ if (CLASS_DATA (sym)->as)
+ sym->as = gfc_copy_array_spec (CLASS_DATA (sym)->as);
}
-
- if (sym->ts.type == BT_CLASS
- && !gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as))
+ if (current_attr.dimension == 0 && current_attr.codimension == 0
+ && !gfc_copy_attr (&sym->attr, &current_attr, &var_locus))
{
m = MATCH_ERROR;
goto cleanup;
}
-
if (!gfc_set_array_spec (sym, as, &var_locus))
{
m = MATCH_ERROR;
@@ -8793,6 +8785,24 @@ attr_decl1 (void)
goto cleanup;
}
+ if (sym->ts.type == BT_CLASS && sym->ts.u.derived->attr.is_class
+ && !as && !current_attr.pointer && !current_attr.allocatable
+ && !current_attr.external)
+ {
+ sym->attr.pointer = 0;
+ sym->attr.allocatable = 0;
+ sym->attr.dimension = 0;
+ sym->attr.codimension = 0;
+ gfc_free_array_spec (sym->as);
+ sym->as = NULL;
+ }
+ else if (sym->ts.type == BT_CLASS
+ && !gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as))
+ {
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
+
add_hidden_procptr_result (sym);
return MATCH_YES;
@@ -9985,9 +9995,10 @@ gfc_match_modproc (void)
gfc_namespace *module_ns;
gfc_interface *old_interface_head, *interface;
- if ((gfc_state_stack->state != COMP_INTERFACE
- && gfc_state_stack->state != COMP_CONTAINS)
- || gfc_state_stack->previous == NULL
+ if (gfc_state_stack->previous == NULL
+ || (gfc_state_stack->state != COMP_INTERFACE
+ && (gfc_state_stack->state != COMP_CONTAINS
+ || gfc_state_stack->previous->state != COMP_INTERFACE))
|| current_interface.type == INTERFACE_NAMELESS
|| current_interface.type == INTERFACE_ABSTRACT)
{
@@ -11718,6 +11729,9 @@ const ext_attr_t ext_attr_list[] = {
{ "fastcall", EXT_ATTR_FASTCALL, "fastcall" },
{ "no_arg_check", EXT_ATTR_NO_ARG_CHECK, NULL },
{ "deprecated", EXT_ATTR_DEPRECATED, NULL },
+ { "noinline", EXT_ATTR_NOINLINE, NULL },
+ { "noreturn", EXT_ATTR_NORETURN, NULL },
+ { "weak", EXT_ATTR_WEAK, NULL },
{ NULL, EXT_ATTR_LAST, NULL }
};
diff --git a/gcc/fortran/dependency.cc b/gcc/fortran/dependency.cc
index ab3bd36..9117825 100644
--- a/gcc/fortran/dependency.cc
+++ b/gcc/fortran/dependency.cc
@@ -1,5 +1,5 @@
/* Dependency analysis
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
This file is part of GCC.
@@ -1292,6 +1292,11 @@ gfc_check_dependency (gfc_expr *expr1, gfc_expr *expr2, bool identical)
if (expr1->expr_type != EXPR_VARIABLE)
gfc_internal_error ("gfc_check_dependency: expecting an EXPR_VARIABLE");
+ /* Prevent NULL pointer dereference while recursively analyzing invalid
+ expressions. */
+ if (expr2 == NULL)
+ return 0;
+
switch (expr2->expr_type)
{
case EXPR_OP:
diff --git a/gcc/fortran/dependency.h b/gcc/fortran/dependency.h
index 339be76..b115031 100644
--- a/gcc/fortran/dependency.h
+++ b/gcc/fortran/dependency.h
@@ -1,5 +1,5 @@
/* Header for dependency analysis
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index 40c690c..3b24bdc 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -1,5 +1,5 @@
/* Parse tree dumper
- Copyright (C) 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2023 Free Software Foundation, Inc.
Contributed by Steven Bosscher
This file is part of GCC.
@@ -36,6 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "gfortran.h"
#include "constructor.h"
#include "version.h"
+#include "parse.h" /* For gfc_ascii_statement. */
/* Keep track of indentation for symbol tree dumps. */
static int show_level = 0;
@@ -893,7 +894,7 @@ show_attr (symbol_attribute *attr, const char * module)
if (attr->pdt_string)
fputs (" PDT-STRING", dumpfile);
if (attr->omp_udr_artificial_var)
- fputs (" OMP-UDT-ARTIFICIAL-VAR", dumpfile);
+ fputs (" OMP-UDR-ARTIFICIAL-VAR", dumpfile);
if (attr->omp_declare_target)
fputs (" OMP-DECLARE-TARGET", dumpfile);
if (attr->omp_declare_target_link)
@@ -1356,6 +1357,29 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
}
ns_iter = n->u2.ns;
}
+ if (list_type == OMP_LIST_ALLOCATE)
+ {
+ if (n->expr)
+ {
+ fputs ("allocator(", dumpfile);
+ show_expr (n->expr);
+ fputc (')', dumpfile);
+ }
+ if (n->expr && n->u.align)
+ fputc (',', dumpfile);
+ if (n->u.align)
+ {
+ fputs ("allocator(", dumpfile);
+ show_expr (n->u.align);
+ fputc (')', dumpfile);
+ }
+ if (n->expr || n->u.align)
+ fputc (':', dumpfile);
+ fputs (n->sym->name, dumpfile);
+ if (n->next)
+ fputs (") ALLOCATE(", dumpfile);
+ continue;
+ }
if (list_type == OMP_LIST_REDUCTION)
switch (n->u.reduction_op)
{
@@ -1458,6 +1482,34 @@ show_omp_namelist (int list_type, gfc_omp_namelist *n)
gfc_current_ns = ns_curr;
}
+static void
+show_omp_assumes (gfc_omp_assumptions *assume)
+{
+ for (int i = 0; i < assume->n_absent; i++)
+ {
+ fputs (" ABSENT (", dumpfile);
+ fputs (gfc_ascii_statement (assume->absent[i], true), dumpfile);
+ fputc (')', dumpfile);
+ }
+ for (int i = 0; i < assume->n_contains; i++)
+ {
+ fputs (" CONTAINS (", dumpfile);
+ fputs (gfc_ascii_statement (assume->contains[i], true), dumpfile);
+ fputc (')', dumpfile);
+ }
+ for (gfc_expr_list *el = assume->holds; el; el = el->next)
+ {
+ fputs (" HOLDS (", dumpfile);
+ show_expr (el->expr);
+ fputc (')', dumpfile);
+ }
+ if (assume->no_openmp)
+ fputs (" NO_OPENMP", dumpfile);
+ if (assume->no_openmp_routines)
+ fputs (" NO_OPENMP_ROUTINES", dumpfile);
+ if (assume->no_parallelism)
+ fputs (" NO_PARALLELISM", dumpfile);
+}
/* Show OpenMP or OpenACC clauses. */
@@ -1998,6 +2050,8 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses)
show_expr (omp_clauses->message);
fputc (')', dumpfile);
}
+ if (omp_clauses->assume)
+ show_omp_assumes (omp_clauses->assume);
}
/* Show a single OpenMP or OpenACC directive node and everything underneath it
@@ -2027,6 +2081,7 @@ show_omp_node (int level, gfc_code *c)
case EXEC_OACC_CACHE: name = "CACHE"; is_oacc = true; break;
case EXEC_OACC_ENTER_DATA: name = "ENTER DATA"; is_oacc = true; break;
case EXEC_OACC_EXIT_DATA: name = "EXIT DATA"; is_oacc = true; break;
+ case EXEC_OMP_ASSUME: name = "ASSUME"; break;
case EXEC_OMP_ATOMIC: name = "ATOMIC"; break;
case EXEC_OMP_BARRIER: name = "BARRIER"; break;
case EXEC_OMP_CANCEL: name = "CANCEL"; break;
@@ -2128,6 +2183,7 @@ show_omp_node (int level, gfc_code *c)
case EXEC_OACC_CACHE:
case EXEC_OACC_ENTER_DATA:
case EXEC_OACC_EXIT_DATA:
+ case EXEC_OMP_ASSUME:
case EXEC_OMP_CANCEL:
case EXEC_OMP_CANCELLATION_POINT:
case EXEC_OMP_DISTRIBUTE:
@@ -3353,6 +3409,7 @@ show_code_node (int level, gfc_code *c)
case EXEC_OACC_CACHE:
case EXEC_OACC_ENTER_DATA:
case EXEC_OACC_EXIT_DATA:
+ case EXEC_OMP_ASSUME:
case EXEC_OMP_ATOMIC:
case EXEC_OMP_CANCEL:
case EXEC_OMP_CANCELLATION_POINT:
@@ -3531,6 +3588,13 @@ show_namespace (gfc_namespace *ns)
}
}
+ if (ns->omp_assumes)
+ {
+ show_indent ();
+ fprintf (dumpfile, "!$OMP ASSUMES");
+ show_omp_assumes (ns->omp_assumes);
+ }
+
fputc ('\n', dumpfile);
show_indent ();
fputs ("code:", dumpfile);
@@ -3845,7 +3909,7 @@ write_proc (gfc_symbol *sym, bool bind_c)
if (sym->formal)
fputs (", ", dumpfile);
}
-
+
for (f = sym->formal; f; f = f->next)
{
gfc_symbol *s;
diff --git a/gcc/fortran/error.cc b/gcc/fortran/error.cc
index c9d6edb..6cae672 100644
--- a/gcc/fortran/error.cc
+++ b/gcc/fortran/error.cc
@@ -1,5 +1,5 @@
/* Handle errors.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught & Niels Kristian Bech Jensen
This file is part of GCC.
@@ -49,6 +49,13 @@ static gfc_error_buffer error_buffer;
static output_buffer *pp_error_buffer, *pp_warning_buffer;
static int warningcount_buffered, werrorcount_buffered;
+/* Return buffered_p. */
+bool
+gfc_buffered_p (void)
+{
+ return buffered_p;
+}
+
/* Return true if there output_buffer is empty. */
static bool
@@ -1147,7 +1154,7 @@ gfc_diagnostic_build_locus_prefix (diagnostic_context *context,
const char *locus_ce = colorize_stop (pp_show_color (pp));
return (s.file == NULL
? build_message_string ("%s%s:%s", locus_cs, progname, locus_ce )
- : !strcmp (s.file, N_("<built-in>"))
+ : !strcmp (s.file, special_fname_builtin ())
? build_message_string ("%s%s:%s", locus_cs, s.file, locus_ce)
: context->show_column
? build_message_string ("%s%s:%d:%d:%s", locus_cs, s.file, s.line,
@@ -1167,7 +1174,7 @@ gfc_diagnostic_build_locus_prefix (diagnostic_context *context,
return (s.file == NULL
? build_message_string ("%s%s:%s", locus_cs, progname, locus_ce )
- : !strcmp (s.file, N_("<built-in>"))
+ : !strcmp (s.file, special_fname_builtin ())
? build_message_string ("%s%s:%s", locus_cs, s.file, locus_ce)
: context->show_column
? build_message_string ("%s%s:%d:%d-%d:%s", locus_cs, s.file, s.line,
diff --git a/gcc/fortran/expr.cc b/gcc/fortran/expr.cc
index 290ddf3..7fb33f8 100644
--- a/gcc/fortran/expr.cc
+++ b/gcc/fortran/expr.cc
@@ -1,5 +1,5 @@
/* Routines for manipulation of expression nodes.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -466,6 +466,10 @@ free_expr0 (gfc_expr *e)
mpc_clear (e->value.complex);
break;
+ case BT_BOZ:
+ free (e->boz.str);
+ break;
+
default:
break;
}
@@ -545,6 +549,7 @@ gfc_free_actual_arglist (gfc_actual_arglist *a1)
a2 = a1->next;
if (a1->expr)
gfc_free_expr (a1->expr);
+ free (a1->associated_dummy);
free (a1);
a1 = a2;
}
@@ -565,6 +570,12 @@ gfc_copy_actual_arglist (gfc_actual_arglist *p)
new_arg = gfc_get_actual_arglist ();
*new_arg = *p;
+ if (p->associated_dummy != NULL)
+ {
+ new_arg->associated_dummy = gfc_get_dummy_arg ();
+ *new_arg->associated_dummy = *p->associated_dummy;
+ }
+
new_arg->expr = gfc_copy_expr (p->expr);
new_arg->next = NULL;
@@ -1552,6 +1563,16 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
lower = ref->u.ar.as->lower[d];
upper = ref->u.ar.as->upper[d];
+ if (!lower || !upper
+ || lower->expr_type != EXPR_CONSTANT
+ || upper->expr_type != EXPR_CONSTANT
+ || lower->ts.type != BT_INTEGER
+ || upper->ts.type != BT_INTEGER)
+ {
+ t = false;
+ goto cleanup;
+ }
+
if (ref->u.ar.dimen_type[d] == DIMEN_VECTOR) /* Vector subscript. */
{
gfc_constructor *ci;
@@ -1594,9 +1615,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
{
if ((begin && begin->expr_type != EXPR_CONSTANT)
|| (finish && finish->expr_type != EXPR_CONSTANT)
- || (step && step->expr_type != EXPR_CONSTANT)
- || !lower
- || !upper)
+ || (step && step->expr_type != EXPR_CONSTANT))
{
t = false;
goto cleanup;
@@ -4992,14 +5011,14 @@ get_union_initializer (gfc_symbol *union_type, gfc_component **map_p)
static bool
class_allocatable (gfc_component *comp)
{
- return comp->ts.type == BT_CLASS && CLASS_DATA (comp)
+ return comp->ts.type == BT_CLASS && comp->attr.class_ok && CLASS_DATA (comp)
&& CLASS_DATA (comp)->attr.allocatable;
}
static bool
class_pointer (gfc_component *comp)
{
- return comp->ts.type == BT_CLASS && CLASS_DATA (comp)
+ return comp->ts.type == BT_CLASS && comp->attr.class_ok && CLASS_DATA (comp)
&& CLASS_DATA (comp)->attr.pointer;
}
diff --git a/gcc/fortran/f95-lang.cc b/gcc/fortran/f95-lang.cc
index a6750be..9684f1d 100644
--- a/gcc/fortran/f95-lang.cc
+++ b/gcc/fortran/f95-lang.cc
@@ -1,5 +1,5 @@
/* gfortran backend interface
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Paul Brook.
This file is part of GCC.
@@ -259,7 +259,7 @@ gfc_init (void)
if (!gfc_cpp_enabled ())
{
linemap_add (line_table, LC_ENTER, false, gfc_source_file, 1);
- linemap_add (line_table, LC_RENAME, false, "<built-in>", 0);
+ linemap_add (line_table, LC_RENAME, false, special_fname_builtin (), 0);
}
else
gfc_cpp_init_0 ();
@@ -714,31 +714,34 @@ gfc_init_builtin_functions (void)
float_type_node, NULL_TREE);
func_cdouble_double = build_function_type_list (double_type_node,
- complex_double_type_node,
- NULL_TREE);
+ complex_double_type_node,
+ NULL_TREE);
func_double_cdouble = build_function_type_list (complex_double_type_node,
- double_type_node, NULL_TREE);
+ double_type_node, NULL_TREE);
- func_clongdouble_longdouble =
- build_function_type_list (long_double_type_node,
- complex_long_double_type_node, NULL_TREE);
+ func_clongdouble_longdouble
+ = build_function_type_list (long_double_type_node,
+ complex_long_double_type_node, NULL_TREE);
- func_longdouble_clongdouble =
- build_function_type_list (complex_long_double_type_node,
- long_double_type_node, NULL_TREE);
+ func_longdouble_clongdouble
+ = build_function_type_list (complex_long_double_type_node,
+ long_double_type_node, NULL_TREE);
ptype = build_pointer_type (float_type_node);
- func_float_floatp_floatp =
- build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
+ func_float_floatp_floatp
+ = build_function_type_list (void_type_node, float_type_node, ptype, ptype,
+ NULL_TREE);
ptype = build_pointer_type (double_type_node);
- func_double_doublep_doublep =
- build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
+ func_double_doublep_doublep
+ = build_function_type_list (void_type_node, double_type_node, ptype,
+ ptype, NULL_TREE);
ptype = build_pointer_type (long_double_type_node);
- func_longdouble_longdoublep_longdoublep =
- build_function_type_list (void_type_node, ptype, ptype, NULL_TREE);
+ func_longdouble_longdoublep_longdoublep
+ = build_function_type_list (void_type_node, long_double_type_node, ptype,
+ ptype, NULL_TREE);
/* Non-math builtins are defined manually, so they're not included here. */
#define OTHER_BUILTIN(ID,NAME,TYPE,CONST)
@@ -992,9 +995,8 @@ gfc_init_builtin_functions (void)
"calloc", ATTR_NOTHROW_LEAF_MALLOC_LIST);
DECL_IS_MALLOC (builtin_decl_explicit (BUILT_IN_CALLOC)) = 1;
- ftype = build_function_type_list (pvoid_type_node,
- size_type_node, pvoid_type_node,
- NULL_TREE);
+ ftype = build_function_type_list (pvoid_type_node, pvoid_type_node,
+ size_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_realloc", ftype, BUILT_IN_REALLOC,
"realloc", ATTR_NOTHROW_LEAF_LIST);
diff --git a/gcc/fortran/frontend-passes.cc b/gcc/fortran/frontend-passes.cc
index 612c12d..9042898 100644
--- a/gcc/fortran/frontend-passes.cc
+++ b/gcc/fortran/frontend-passes.cc
@@ -1,5 +1,5 @@
/* Pass manager for Fortran front end.
- Copyright (C) 2010-2022 Free Software Foundation, Inc.
+ Copyright (C) 2010-2023 Free Software Foundation, Inc.
Contributed by Thomas König.
This file is part of GCC.
@@ -2883,7 +2883,10 @@ do_subscript (gfc_expr **e)
have_do_end = false;
if (!have_do_start && !have_do_end)
- return 0;
+ {
+ mpz_clear (do_step);
+ return 0;
+ }
/* No warning inside a zero-trip loop. */
if (have_do_start && have_do_end)
@@ -2892,7 +2895,12 @@ do_subscript (gfc_expr **e)
cmp = mpz_cmp (do_end, do_start);
if ((sgn > 0 && cmp < 0) || (sgn < 0 && cmp > 0))
- break;
+ {
+ mpz_clear (do_start);
+ mpz_clear (do_end);
+ mpz_clear (do_step);
+ break;
+ }
}
/* May have to correct the end value if the step does not equal
@@ -2965,6 +2973,12 @@ do_subscript (gfc_expr **e)
mpz_clear (val);
}
}
+
+ if (have_do_start)
+ mpz_clear (do_start);
+ if (have_do_end)
+ mpz_clear (do_end);
+ mpz_clear (do_step);
}
}
}
@@ -3038,7 +3052,8 @@ do_intent (gfc_expr **e)
do_sym = dl->ext.iterator->var->symtree->n.sym;
if (a->expr && a->expr->symtree
- && a->expr->symtree->n.sym == do_sym)
+ && a->expr->symtree->n.sym == do_sym
+ && f->sym)
{
if (f->sym->attr.intent == INTENT_OUT)
gfc_error_now ("Variable %qs at %L set to undefined value "
diff --git a/gcc/fortran/gfc-diagnostic.def b/gcc/fortran/gfc-diagnostic.def
index 9c0e1be..b23dc7f 100644
--- a/gcc/fortran/gfc-diagnostic.def
+++ b/gcc/fortran/gfc-diagnostic.def
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/gfc-internals.texi b/gcc/fortran/gfc-internals.texi
index 1409e28..73fd74e 100644
--- a/gcc/fortran/gfc-internals.texi
+++ b/gcc/fortran/gfc-internals.texi
@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename gfc-internals.info
-@set copyrights-gfortran 2007-2022
+@set copyrights-gfortran 2007-2023
@include gcc-common.texi
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 4babd77..130d5d7 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -1,5 +1,5 @@
/* gfortran header file
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -222,11 +222,12 @@ enum gfc_intrinsic_op
Assumptions are made about the numbering of the interface_op enums. */
#define GFC_INTRINSIC_OPS GFC_INTRINSIC_END
-/* Arithmetic results. */
+/* Arithmetic results. ARITH_NOT_REDUCED is used to keep track of expressions
+ that were not reduced by the arithmetic evaluation code. */
enum arith
{ ARITH_OK = 1, ARITH_OVERFLOW, ARITH_UNDERFLOW, ARITH_NAN,
ARITH_DIV0, ARITH_INCOMMENSURATE, ARITH_ASYMMETRIC, ARITH_PROHIBIT,
- ARITH_WRONGCONCAT
+ ARITH_WRONGCONCAT, ARITH_INVALID_TYPE, ARITH_NOT_REDUCED
};
/* Statements. */
@@ -316,7 +317,9 @@ enum gfc_statement
ST_OMP_END_PARALLEL_MASKED_TASKLOOP_SIMD, ST_OMP_MASKED_TASKLOOP,
ST_OMP_END_MASKED_TASKLOOP, ST_OMP_MASKED_TASKLOOP_SIMD,
ST_OMP_END_MASKED_TASKLOOP_SIMD, ST_OMP_SCOPE, ST_OMP_END_SCOPE,
- ST_OMP_ERROR, ST_NONE
+ ST_OMP_ERROR, ST_OMP_ASSUME, ST_OMP_END_ASSUME, ST_OMP_ASSUMES,
+ /* Note: gfc_match_omp_nothing returns ST_NONE. */
+ ST_OMP_NOTHING, ST_NONE
};
/* Types of interfaces that we can have. Assignment interfaces are
@@ -835,6 +838,9 @@ typedef enum
EXT_ATTR_FASTCALL,
EXT_ATTR_NO_ARG_CHECK,
EXT_ATTR_DEPRECATED,
+ EXT_ATTR_NOINLINE,
+ EXT_ATTR_NORETURN,
+ EXT_ATTR_WEAK,
EXT_ATTR_LAST, EXT_ATTR_NUM = EXT_ATTR_LAST
}
ext_attr_id_t;
@@ -1346,6 +1352,7 @@ typedef struct gfc_omp_namelist
gfc_omp_reduction_op reduction_op;
gfc_omp_depend_doacross_op depend_doacross_op;
gfc_omp_map_op map_op;
+ gfc_expr *align;
struct
{
ENUM_BITFIELD (gfc_omp_linear_op) op:4;
@@ -1506,6 +1513,18 @@ enum gfc_omp_bind_type
OMP_BIND_THREAD
};
+typedef struct gfc_omp_assumptions
+{
+ int n_absent, n_contains;
+ enum gfc_statement *absent, *contains;
+ gfc_expr_list *holds;
+ bool no_openmp:1, no_openmp_routines:1, no_parallelism:1;
+}
+gfc_omp_assumptions;
+
+#define gfc_get_omp_assumptions() XCNEW (gfc_omp_assumptions)
+
+
typedef struct gfc_omp_clauses
{
gfc_omp_namelist *lists[OMP_LIST_NUM];
@@ -1529,6 +1548,7 @@ typedef struct gfc_omp_clauses
struct gfc_expr *if_exprs[OMP_IF_LAST];
struct gfc_expr *dist_chunk_size;
struct gfc_expr *message;
+ struct gfc_omp_assumptions *assume;
const char *critical_name;
enum gfc_omp_default_sharing default_sharing;
enum gfc_omp_atomic_op atomic_op;
@@ -1854,22 +1874,34 @@ typedef struct gfc_symbol
gfc_namelist *namelist, *namelist_tail;
+ /* The tlink field is used in the front end to carry the module
+ declaration of separate module procedures so that the characteristics
+ can be compared with the corresponding declaration in a submodule. In
+ translation this field carries a linked list of symbols that require
+ deferred initialization. */
+ struct gfc_symbol *tlink;
+
/* Change management fields. Symbols that might be modified by the
current statement have the mark member nonzero. Of these symbols,
symbols with old_symbol equal to NULL are symbols created within
the current statement. Otherwise, old_symbol points to a copy of
the old symbol. gfc_new is used in symbol.cc to flag new symbols.
comp_mark is used to indicate variables which have component accesses
- in OpenMP/OpenACC directive clauses. */
+ in OpenMP/OpenACC directive clauses (cf. c-typeck.cc:c_finish_omp_clauses,
+ map_field_head).
+ data_mark is used to check duplicate mappings for OpenMP data-sharing
+ clauses (see firstprivate_head/lastprivate_head in the above function).
+ dev_mark is used to check duplicate mappings for OpenMP
+ is_device_ptr/has_device_addr clauses (see is_on_device_head in above
+ function).
+ gen_mark is used to check duplicate mappings for OpenMP
+ use_device_ptr/use_device_addr/private/shared clauses (see generic_head in
+ above functon).
+ reduc_mark is used to check duplicate mappings for OpenMP reduction
+ clauses. */
struct gfc_symbol *old_symbol;
- unsigned mark:1, comp_mark:1, gfc_new:1;
-
- /* The tlink field is used in the front end to carry the module
- declaration of separate module procedures so that the characteristics
- can be compared with the corresponding declaration in a submodule. In
- translation this field carries a linked list of symbols that require
- deferred initialization. */
- struct gfc_symbol *tlink;
+ unsigned mark:1, comp_mark:1, data_mark:1, dev_mark:1, gen_mark:1;
+ unsigned reduc_mark:1, gfc_new:1;
/* Nonzero if all equivalences associated with this symbol have been
processed. */
@@ -2145,6 +2177,9 @@ typedef struct gfc_namespace
/* Linked list of !$omp declare variant constructs. */
struct gfc_omp_declare_variant *omp_declare_variant;
+ /* OpenMP assumptions. */
+ struct gfc_omp_assumptions *omp_assumes;
+
/* A hash set for the gfc expressions that have already
been finalized in this namespace. */
@@ -2913,7 +2948,7 @@ enum gfc_exec_op
EXEC_OMP_ORDERED, EXEC_OMP_PARALLEL, EXEC_OMP_PARALLEL_DO,
EXEC_OMP_PARALLEL_SECTIONS, EXEC_OMP_PARALLEL_WORKSHARE,
EXEC_OMP_SECTIONS, EXEC_OMP_SINGLE, EXEC_OMP_WORKSHARE,
- EXEC_OMP_ATOMIC, EXEC_OMP_BARRIER, EXEC_OMP_END_NOWAIT,
+ EXEC_OMP_ASSUME, EXEC_OMP_ATOMIC, EXEC_OMP_BARRIER, EXEC_OMP_END_NOWAIT,
EXEC_OMP_END_SINGLE, EXEC_OMP_TASK, EXEC_OMP_TASKWAIT,
EXEC_OMP_TASKYIELD, EXEC_OMP_CANCEL, EXEC_OMP_CANCELLATION_POINT,
EXEC_OMP_TASKGROUP, EXEC_OMP_SIMD, EXEC_OMP_DO_SIMD,
@@ -3188,7 +3223,6 @@ int gfc_at_eof (void);
int gfc_at_bol (void);
int gfc_at_eol (void);
void gfc_advance_line (void);
-int gfc_check_include (void);
int gfc_define_undef_line (void);
int gfc_wide_is_printable (gfc_char_t);
@@ -3242,7 +3276,7 @@ void gfc_done_2 (void);
int get_c_kind (const char *, CInteropKind_t *);
const char *gfc_closest_fuzzy_match (const char *, char **);
-static inline void
+inline void
vec_push (char **&optr, size_t &osz, const char *elt)
{
/* {auto,}vec.safe_push () replacement. Don't ask.. */
@@ -3297,6 +3331,7 @@ void gfc_internal_error (const char *, ...) ATTRIBUTE_NORETURN ATTRIBUTE_GCC_GFC
void gfc_clear_error (void);
bool gfc_error_check (void);
bool gfc_error_flag_test (void);
+bool gfc_buffered_p (void);
notification gfc_notification_std (int);
bool gfc_notify_std (int, const char *, ...) ATTRIBUTE_GCC_GFC(2,3);
@@ -3518,7 +3553,7 @@ void gfc_intrinsic_done_1 (void);
char gfc_type_letter (bt, bool logical_equals_int = false);
int gfc_type_abi_kind (bt, int);
-static inline int
+inline int
gfc_type_abi_kind (gfc_typespec *ts)
{
return gfc_type_abi_kind (ts->type, ts->kind);
@@ -3554,7 +3589,7 @@ void gfc_free_iterator (gfc_iterator *, int);
void gfc_free_forall_iterator (gfc_forall_iterator *);
void gfc_free_alloc_list (gfc_alloc *);
void gfc_free_namelist (gfc_namelist *);
-void gfc_free_omp_namelist (gfc_omp_namelist *, bool);
+void gfc_free_omp_namelist (gfc_omp_namelist *, bool, bool);
void gfc_free_equiv (gfc_equiv *);
void gfc_free_equiv_until (gfc_equiv *, gfc_equiv *);
void gfc_free_data (gfc_data *);
@@ -3576,6 +3611,7 @@ void gfc_free_omp_declare_simd (gfc_omp_declare_simd *);
void gfc_free_omp_declare_simd_list (gfc_omp_declare_simd *);
void gfc_free_omp_udr (gfc_omp_udr *);
gfc_omp_udr *gfc_omp_udr_find (gfc_symtree *, gfc_typespec *);
+void gfc_resolve_omp_assumptions (gfc_omp_assumptions *);
void gfc_resolve_omp_directive (gfc_code *, gfc_namespace *);
void gfc_resolve_do_iterator (gfc_code *, gfc_symbol *, bool);
void gfc_resolve_omp_local_vars (gfc_namespace *);
@@ -3896,6 +3932,7 @@ gfc_typebound_proc* gfc_find_typebound_intrinsic_op (gfc_symbol*, bool*,
locus*);
gfc_symtree* gfc_get_tbp_symtree (gfc_symtree**, const char*);
bool gfc_is_finalizable (gfc_symbol *, gfc_expr **);
+bool gfc_may_be_finalized (gfc_typespec);
#define CLASS_DATA(sym) sym->ts.u.derived->components
#define UNLIMITED_POLY(sym) \
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index 4b4ecd5..b967129 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename gfortran.info
-@set copyrights-gfortran 1999-2022
+@set copyrights-gfortran 1999-2023
@include gcc-common.texi
@@ -820,6 +820,7 @@ might in some way or another become visible to the programmer.
* File operations on symbolic links::
* File format of unformatted sequential files::
* Asynchronous I/O::
+* Behavior on integer overflow::
@end menu
@@ -1160,6 +1161,23 @@ sytems, such as Linux, it is necessary to specify @option{-pthread},
@c Maybe this chapter should be merged with the 'Standards' section,
@c whenever that is written :-)
+@node Behavior on integer overflow
+@section Behavior on integer overflow
+@cindex integer overflow
+@cindex overflow handling
+
+Integer overflow is prohibited by the Fortran standard. The behavior
+of gfortran on integer overflow is undefined by default. Traditional
+code, like linear congruential pseudo-random number generators in old
+programs that rely on specific, non-standard behavior may generate
+unexpected results. The @option{-fsanitize=undefined} option can be
+used to detect such code at runtime.
+
+It is recommended to use the intrinsic subroutine @code{RANDOM_NUMBER}
+for random number generators or, if the old behavior is desired, to
+use the @option{-fwrapv} option. Note that this option can impact
+performance.
+
@node Extensions
@chapter Extensions
@cindex extensions
@@ -3246,6 +3264,13 @@ requires an explicit interface.
@item @code{DEPRECATED} -- print a warning when using a such-tagged
deprecated procedure, variable or parameter; the warning can be suppressed
with @option{-Wno-deprecated-declarations}.
+@item @code{NOINLINE} -- prevent inlining given function.
+@item @code{NORETURN} -- add a hint that a given function cannot return.
+@item @code{WEAK} -- emit the declaration of an external symbol as a weak
+symbol rather than a global. This is primarily useful in defining library
+functions that can be overridden in user code, though it can also be used with
+non-function declarations. The overriding symbol must have the same type as
+the weak symbol.
@end itemize
@@ -3763,8 +3788,7 @@ is used for dummy arguments; with @code{VALUE}, those variables are
passed by value.
For @code{OPTIONAL} dummy arguments, an absent argument is denoted
-by a NULL pointer, except for scalar dummy arguments of type
-@code{INTEGER}, @code{LOGICAL}, @code{REAL} and @code{COMPLEX}
+by a NULL pointer, except for scalar dummy arguments of intrinsic type
which have the @code{VALUE} attribute. For those, a hidden Boolean
argument (@code{logical(kind=C_bool),value}) is used to indicate
whether the argument is present.
diff --git a/gcc/fortran/gfortranspec.cc b/gcc/fortran/gfortranspec.cc
index cf76bdc..9e5f9f37 100644
--- a/gcc/fortran/gfortranspec.cc
+++ b/gcc/fortran/gfortranspec.cc
@@ -1,5 +1,5 @@
/* Specific flags and argument handling of the Fortran front-end.
- Copyright (C) 1997-2022 Free Software Foundation, Inc.
+ Copyright (C) 1997-2023 Free Software Foundation, Inc.
This file is part of GCC.
@@ -278,7 +278,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
case OPT__version:
printf ("GNU Fortran %s%s\n", pkgversion_string, version_string);
- printf ("Copyright %s 2022 Free Software Foundation, Inc.\n",
+ printf ("Copyright %s 2023 Free Software Foundation, Inc.\n",
_("(C)"));
fputs (_("This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"),
diff --git a/gcc/fortran/interface.cc b/gcc/fortran/interface.cc
index d3e1995..db79b10 100644
--- a/gcc/fortran/interface.cc
+++ b/gcc/fortran/interface.cc
@@ -1,5 +1,5 @@
/* Deal with interfaces.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -1334,6 +1334,12 @@ gfc_check_dummy_characteristics (gfc_symbol *s1, gfc_symbol *s2,
if (s1 == NULL || s2 == NULL)
return s1 == s2 ? true : false;
+ if (s1->attr.proc == PROC_ST_FUNCTION || s2->attr.proc == PROC_ST_FUNCTION)
+ {
+ strncpy (errmsg, "Statement function", err_len);
+ return false;
+ }
+
/* Check type and rank. */
if (type_must_agree)
{
@@ -2343,6 +2349,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
char err[200];
gfc_component *ppc;
bool codimension = false;
+ gfc_array_spec *formal_as;
/* If the formal arg has type BT_VOID, it's to one of the iso_c_binding
procs c_f_pointer or c_f_procpointer, and we need to accept most
@@ -2534,6 +2541,9 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
return false;
}
+ formal_as = (formal->ts.type == BT_CLASS
+ ? CLASS_DATA (formal)->as : formal->as);
+
if (codimension && formal->attr.allocatable)
{
gfc_ref *last = NULL;
@@ -2644,10 +2654,10 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
if (symbol_rank (formal) == actual->rank || symbol_rank (formal) == -1)
return true;
- rank_check = where != NULL && !is_elemental && formal->as
- && (formal->as->type == AS_ASSUMED_SHAPE
- || formal->as->type == AS_DEFERRED)
- && actual->expr_type != EXPR_NULL;
+ rank_check = where != NULL && !is_elemental && formal_as
+ && (formal_as->type == AS_ASSUMED_SHAPE
+ || formal_as->type == AS_DEFERRED)
+ && actual->expr_type != EXPR_NULL;
/* Skip rank checks for NO_ARG_CHECK. */
if (formal->attr.ext_attr & (1 << EXT_ATTR_NO_ARG_CHECK))
@@ -2656,14 +2666,20 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
/* Scalar & coindexed, see: F2008, Section 12.5.2.4. */
if (rank_check || ranks_must_agree
|| (formal->attr.pointer && actual->expr_type != EXPR_NULL)
- || (actual->rank != 0 && !(is_elemental || formal->attr.dimension))
+ || (actual->rank != 0
+ && !(is_elemental || formal->attr.dimension
+ || (formal->ts.type == BT_CLASS
+ && CLASS_DATA (formal)->attr.dimension)))
|| (actual->rank == 0
&& ((formal->ts.type == BT_CLASS
&& CLASS_DATA (formal)->as->type == AS_ASSUMED_SHAPE)
|| (formal->ts.type != BT_CLASS
&& formal->as->type == AS_ASSUMED_SHAPE))
&& actual->expr_type != EXPR_NULL)
- || (actual->rank == 0 && formal->attr.dimension
+ || (actual->rank == 0
+ && (formal->attr.dimension
+ || (formal->ts.type == BT_CLASS
+ && CLASS_DATA (formal)->attr.dimension))
&& gfc_is_coindexed (actual))
/* Assumed-rank actual argument; F2018 C838. */
|| actual->rank == -1)
@@ -2684,7 +2700,10 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual,
}
return false;
}
- else if (actual->rank != 0 && (is_elemental || formal->attr.dimension))
+ else if (actual->rank != 0
+ && (is_elemental || formal->attr.dimension
+ || (formal->ts.type == BT_CLASS
+ && CLASS_DATA (formal)->attr.dimension)))
return true;
/* At this point, we are considering a scalar passed to an array. This
@@ -2852,7 +2871,8 @@ get_expr_storage_size (gfc_expr *e)
if (e->ts.type == BT_CHARACTER)
{
if (e->ts.u.cl && e->ts.u.cl->length
- && e->ts.u.cl->length->expr_type == EXPR_CONSTANT)
+ && e->ts.u.cl->length->expr_type == EXPR_CONSTANT
+ && e->ts.u.cl->length->ts.type == BT_INTEGER)
strlen = mpz_get_si (e->ts.u.cl->length->value.integer);
else if (e->expr_type == EXPR_CONSTANT
&& (e->ts.u.cl == NULL || e->ts.u.cl->length == NULL))
@@ -2903,7 +2923,8 @@ get_expr_storage_size (gfc_expr *e)
if (ref->u.ar.stride[i])
{
- if (ref->u.ar.stride[i]->expr_type == EXPR_CONSTANT)
+ if (ref->u.ar.stride[i]->expr_type == EXPR_CONSTANT
+ && ref->u.ar.stride[i]->ts.type == BT_INTEGER)
stride = mpz_get_si (ref->u.ar.stride[i]->value.integer);
else
return 0;
@@ -2911,26 +2932,30 @@ get_expr_storage_size (gfc_expr *e)
if (ref->u.ar.start[i])
{
- if (ref->u.ar.start[i]->expr_type == EXPR_CONSTANT)
+ if (ref->u.ar.start[i]->expr_type == EXPR_CONSTANT
+ && ref->u.ar.start[i]->ts.type == BT_INTEGER)
start = mpz_get_si (ref->u.ar.start[i]->value.integer);
else
return 0;
}
else if (ref->u.ar.as->lower[i]
- && ref->u.ar.as->lower[i]->expr_type == EXPR_CONSTANT)
+ && ref->u.ar.as->lower[i]->expr_type == EXPR_CONSTANT
+ && ref->u.ar.as->lower[i]->ts.type == BT_INTEGER)
start = mpz_get_si (ref->u.ar.as->lower[i]->value.integer);
else
return 0;
if (ref->u.ar.end[i])
{
- if (ref->u.ar.end[i]->expr_type == EXPR_CONSTANT)
+ if (ref->u.ar.end[i]->expr_type == EXPR_CONSTANT
+ && ref->u.ar.end[i]->ts.type == BT_INTEGER)
end = mpz_get_si (ref->u.ar.end[i]->value.integer);
else
return 0;
}
else if (ref->u.ar.as->upper[i]
- && ref->u.ar.as->upper[i]->expr_type == EXPR_CONSTANT)
+ && ref->u.ar.as->upper[i]->expr_type == EXPR_CONSTANT
+ && ref->u.ar.as->upper[i]->ts.type == BT_INTEGER)
end = mpz_get_si (ref->u.ar.as->upper[i]->value.integer);
else
return 0;
@@ -2971,7 +2996,9 @@ get_expr_storage_size (gfc_expr *e)
|| ref->u.ar.as->upper[i] == NULL
|| ref->u.ar.as->lower[i] == NULL
|| ref->u.ar.as->upper[i]->expr_type != EXPR_CONSTANT
- || ref->u.ar.as->lower[i]->expr_type != EXPR_CONSTANT)
+ || ref->u.ar.as->lower[i]->expr_type != EXPR_CONSTANT
+ || ref->u.ar.as->upper[i]->ts.type != BT_INTEGER
+ || ref->u.ar.as->lower[i]->ts.type != BT_INTEGER)
return 0;
elements
@@ -2993,7 +3020,9 @@ get_expr_storage_size (gfc_expr *e)
{
if (!as->upper[i] || !as->lower[i]
|| as->upper[i]->expr_type != EXPR_CONSTANT
- || as->lower[i]->expr_type != EXPR_CONSTANT)
+ || as->lower[i]->expr_type != EXPR_CONSTANT
+ || as->upper[i]->ts.type != BT_INTEGER
+ || as->lower[i]->ts.type != BT_INTEGER)
return 0;
elements = elements
@@ -3273,9 +3302,11 @@ gfc_compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
if (a->expr->ts.type == BT_CHARACTER
&& a->expr->ts.u.cl && a->expr->ts.u.cl->length
&& a->expr->ts.u.cl->length->expr_type == EXPR_CONSTANT
+ && a->expr->ts.u.cl->length->ts.type == BT_INTEGER
&& f->sym->ts.type == BT_CHARACTER && f->sym->ts.u.cl
&& f->sym->ts.u.cl->length
&& f->sym->ts.u.cl->length->expr_type == EXPR_CONSTANT
+ && f->sym->ts.u.cl->length->ts.type == BT_INTEGER
&& (f->sym->attr.pointer || f->sym->attr.allocatable
|| (f->sym->as && f->sym->as->type == AS_ASSUMED_SHAPE))
&& (mpz_cmp (a->expr->ts.u.cl->length->value.integer,
@@ -3477,25 +3508,39 @@ gfc_compare_actual_formal (gfc_actual_arglist **ap, gfc_formal_arglist *formal,
goto match;
}
- if (a->expr->expr_type != EXPR_NULL
- && compare_pointer (f->sym, a->expr) == 0)
+ if (a->expr->expr_type != EXPR_NULL)
{
- if (where)
- gfc_error ("Actual argument for %qs must be a pointer at %L",
- f->sym->name, &a->expr->where);
- ok = false;
- goto match;
- }
+ int cmp = compare_pointer (f->sym, a->expr);
+ bool pre2008 = ((gfc_option.allow_std & GFC_STD_F2008) == 0);
- if (a->expr->expr_type != EXPR_NULL
- && (gfc_option.allow_std & GFC_STD_F2008) == 0
- && compare_pointer (f->sym, a->expr) == 2)
- {
- if (where)
- gfc_error ("Fortran 2008: Non-pointer actual argument at %L to "
- "pointer dummy %qs", &a->expr->where,f->sym->name);
- ok = false;
- goto match;
+ if (pre2008 && cmp == 0)
+ {
+ if (where)
+ gfc_error ("Actual argument for %qs at %L must be a pointer",
+ f->sym->name, &a->expr->where);
+ ok = false;
+ goto match;
+ }
+
+ if (pre2008 && cmp == 2)
+ {
+ if (where)
+ gfc_error ("Fortran 2008: Non-pointer actual argument at %L to "
+ "pointer dummy %qs", &a->expr->where, f->sym->name);
+ ok = false;
+ goto match;
+ }
+
+ if (!pre2008 && cmp == 0)
+ {
+ if (where)
+ gfc_error ("Actual argument for %qs at %L must be a pointer "
+ "or a valid target for the dummy pointer in a "
+ "pointer assignment statement",
+ f->sym->name, &a->expr->where);
+ ok = false;
+ goto match;
+ }
}
@@ -4146,6 +4191,14 @@ gfc_procedure_use (gfc_symbol *sym, gfc_actual_arglist **ap, locus *where)
return false;
}
+ if (a->expr && a->expr->expr_type == EXPR_NULL)
+ {
+ gfc_error ("Passing intrinsic NULL as actual argument at %L "
+ "requires an explicit interface", &a->expr->where);
+ a->expr->error = 1;
+ return false;
+ }
+
/* TS 29113, C407b. */
if (a->expr && a->expr->expr_type == EXPR_VARIABLE
&& symbol_rank (a->expr->symtree->n.sym) == -1)
diff --git a/gcc/fortran/intrinsic.cc b/gcc/fortran/intrinsic.cc
index e89131f..1a26b7a 100644
--- a/gcc/fortran/intrinsic.cc
+++ b/gcc/fortran/intrinsic.cc
@@ -1,6 +1,6 @@
/* Build up a list of intrinsic subroutines and functions for the
name-resolution stage.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught & Katherine Holcomb
This file is part of GCC.
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "options.h"
#include "gfortran.h"
#include "intrinsic.h"
+#include "diagnostic.h" /* For errorcount. */
/* Namespace to hold the resolved symbols for intrinsic subroutines. */
static gfc_namespace *gfc_intrinsic_namespace;
@@ -4259,15 +4260,15 @@ remove_nullargs (gfc_actual_arglist **ap)
}
-static gfc_dummy_arg *
-get_intrinsic_dummy_arg (gfc_intrinsic_arg *intrinsic)
+static void
+set_intrinsic_dummy_arg (gfc_dummy_arg *&dummy_arg,
+ gfc_intrinsic_arg *intrinsic)
{
- gfc_dummy_arg * const dummy_arg = gfc_get_dummy_arg ();
+ if (dummy_arg == NULL)
+ dummy_arg = gfc_get_dummy_arg ();
dummy_arg->intrinsicness = GFC_INTRINSIC_DUMMY_ARG;
dummy_arg->u.intrinsic = intrinsic;
-
- return dummy_arg;
}
@@ -4430,7 +4431,7 @@ do_sort:
if (a == NULL)
a = gfc_get_actual_arglist ();
- a->associated_dummy = get_intrinsic_dummy_arg (f);
+ set_intrinsic_dummy_arg (a->associated_dummy, f);
if (actual == NULL)
*ap = a;
@@ -4620,6 +4621,7 @@ do_simplify (gfc_intrinsic_sym *specific, gfc_expr *e)
{
gfc_expr *result, *a1, *a2, *a3, *a4, *a5, *a6;
gfc_actual_arglist *arg;
+ int old_errorcount = errorcount;
/* Max and min require special handling due to the variable number
of args. */
@@ -4708,7 +4710,12 @@ do_simplify (gfc_intrinsic_sym *specific, gfc_expr *e)
finish:
if (result == &gfc_bad_expr)
- return false;
+ {
+ if (errorcount == old_errorcount
+ && (!gfc_buffered_p () || !gfc_error_flag_test ()))
+ gfc_error ("Cannot simplify expression at %L", &e->where);
+ return false;
+ }
if (result == NULL)
resolve_intrinsic (specific, e); /* Must call at run-time */
@@ -5419,7 +5426,8 @@ gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts)
gcc_assert (expr->ts.type == BT_CHARACTER && ts->type == BT_CHARACTER);
sym = find_char_conv (&expr->ts, ts);
- gcc_assert (sym);
+ if (sym == NULL)
+ return false;
/* Insert a pre-resolved function call to the right function. */
old_where = expr->where;
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index a5c7487..3573863 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -1,6 +1,6 @@
/* Header file for intrinsics check, resolve and simplify function
prototypes.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught & Katherine Holcomb
This file is part of GCC.
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index 55f53fc..5555db2 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -1,5 +1,5 @@
@ignore
-Copyright (C) 2005-2022 Free Software Foundation, Inc.
+Copyright (C) 2005-2023 Free Software Foundation, Inc.
This is part of the GNU Fortran manual.
For copying conditions, see the file gfortran.texi.
@@ -399,8 +399,8 @@ end program test_abort
@end smallexample
@item @emph{See also}:
-@ref{EXIT}, @gol
-@ref{KILL}, @gol
+@ref{EXIT}, @*
+@ref{KILL}, @*
@ref{BACKTRACE}
@end table
@@ -553,7 +553,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{I} @tab The type shall be @code{INTEGER}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -575,8 +575,8 @@ See @ref{ICHAR} for a discussion of converting between numerical values
and formatted string representations.
@item @emph{See also}:
-@ref{CHAR}, @gol
-@ref{IACHAR}, @gol
+@ref{CHAR}, @*
+@ref{IACHAR}, @*
@ref{ICHAR}
@end table
@@ -629,9 +629,9 @@ end program test_acos
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{COS} @gol
-Degrees function: @gol
+Inverse function: @*
+@ref{COS} @*
+Degrees function: @*
@ref{ACOSD}
@end table
@@ -688,10 +688,10 @@ end program test_acosd
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{COSD} @gol
-Radians function: @gol
-@ref{ACOS} @gol
+Inverse function: @*
+@ref{COSD} @*
+Radians function: @*
+@ref{ACOS} @*
@end table
@@ -743,7 +743,7 @@ END PROGRAM
@end multitable
@item @emph{See also}:
-Inverse function: @gol
+Inverse function: @*
@ref{COSH}
@end table
@@ -789,7 +789,7 @@ end program test_adjustl
@end smallexample
@item @emph{See also}:
-@ref{ADJUSTR}, @gol
+@ref{ADJUSTR}, @*
@ref{TRIM}
@end table
@@ -835,7 +835,7 @@ end program test_adjustr
@end smallexample
@item @emph{See also}:
-@ref{ADJUSTL}, @gol
+@ref{ADJUSTL}, @*
@ref{TRIM}
@end table
@@ -920,7 +920,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{A} @tab The type of the argument shall be @code{REAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -1173,7 +1173,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-Fortran 95 elemental function: @gol
+Fortran 95 elemental function: @*
@ref{IAND}
@end table
@@ -1202,7 +1202,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{A} @tab The type of the argument shall be @code{REAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -1349,9 +1349,9 @@ end program test_asin
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{SIN} @gol
-Degrees function: @gol
+Inverse function: @*
+@ref{SIN} @*
+Degrees function: @*
@ref{ASIND}
@end table
@@ -1408,9 +1408,9 @@ end program test_asind
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{SIND} @gol
-Radians function: @gol
+Inverse function: @*
+@ref{SIND} @*
+Radians function: @*
@ref{ASIN}
@end table
@@ -1463,7 +1463,7 @@ END PROGRAM
@end multitable
@item @emph{See also}:
-Inverse function: @gol
+Inverse function: @*
@ref{SINH}
@end table
@@ -1600,9 +1600,9 @@ end program test_atan
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{TAN} @gol
-Degrees function: @gol
+Inverse function: @*
+@ref{TAN} @*
+Degrees function: @*
@ref{ATAND}
@end table
@@ -1665,9 +1665,9 @@ end program test_atand
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{TAND} @gol
-Radians function: @gol
+Inverse function: @*
+@ref{TAND} @*
+Radians function: @*
@ref{ATAN}
@end table
@@ -1730,9 +1730,9 @@ end program test_atan2
@end multitable
@item @emph{See also}:
-Alias: @gol
-@ref{ATAN} @gol
-Degrees function: @gol
+Alias: @*
+@ref{ATAN} @*
+Degrees function: @*
@ref{ATAN2D}
@end table
@@ -1798,9 +1798,9 @@ end program test_atan2d
@end multitable
@item @emph{See also}:
-Alias: @gol
-@ref{ATAND} @gol
-Radians function: @gol
+Alias: @*
+@ref{ATAND} @*
+Radians function: @*
@ref{ATAN2}
@end table
@@ -1853,7 +1853,7 @@ END PROGRAM
@end multitable
@item @emph{See also}:
-Inverse function: @gol
+Inverse function: @*
@ref{TANH}
@end table
@@ -1902,11 +1902,11 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_FETCH_ADD}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_AND}, @gol
-@ref{ATOMIC_OR}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_FETCH_ADD}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_AND}, @*
+@ref{ATOMIC_OR}, @*
@ref{ATOMIC_XOR}
@end table
@@ -1956,11 +1956,11 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_FETCH_AND}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_ADD}, @gol
-@ref{ATOMIC_OR}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_FETCH_AND}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_ADD}, @*
+@ref{ATOMIC_OR}, @*
@ref{ATOMIC_XOR}
@end table
@@ -2015,8 +2015,8 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_REF}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_REF}, @*
@ref{ISO_FORTRAN_ENV}
@end table
@@ -2067,12 +2067,12 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_REF}, @gol
-@ref{ATOMIC_CAS}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_ADD}, @gol
-@ref{ATOMIC_AND}, @gol
-@ref{ATOMIC_OR}, @gol
+@ref{ATOMIC_REF}, @*
+@ref{ATOMIC_CAS}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_ADD}, @*
+@ref{ATOMIC_AND}, @*
+@ref{ATOMIC_OR}, @*
@ref{ATOMIC_XOR}
@end table
@@ -2125,11 +2125,11 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_ADD}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_FETCH_AND}, @gol
-@ref{ATOMIC_FETCH_OR}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_ADD}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_FETCH_AND}, @*
+@ref{ATOMIC_FETCH_OR}, @*
@ref{ATOMIC_FETCH_XOR}
@end table
@@ -2180,11 +2180,11 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_AND}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_FETCH_ADD}, @gol
-@ref{ATOMIC_FETCH_OR}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_AND}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_FETCH_ADD}, @*
+@ref{ATOMIC_FETCH_OR}, @*
@ref{ATOMIC_FETCH_XOR}
@end table
@@ -2235,11 +2235,11 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_OR}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_FETCH_ADD}, @gol
-@ref{ATOMIC_FETCH_AND}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_OR}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_FETCH_ADD}, @*
+@ref{ATOMIC_FETCH_AND}, @*
@ref{ATOMIC_FETCH_XOR}
@end table
@@ -2290,11 +2290,11 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_XOR}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_FETCH_ADD}, @gol
-@ref{ATOMIC_FETCH_AND}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_XOR}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_FETCH_ADD}, @*
+@ref{ATOMIC_FETCH_AND}, @*
@ref{ATOMIC_FETCH_OR}
@end table
@@ -2343,11 +2343,11 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_FETCH_OR}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_ADD}, @gol
-@ref{ATOMIC_OR}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_FETCH_OR}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_ADD}, @*
+@ref{ATOMIC_OR}, @*
@ref{ATOMIC_XOR}
@end table
@@ -2404,12 +2404,12 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_CAS}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_FETCH_ADD}, @gol
-@ref{ATOMIC_FETCH_AND}, @gol
-@ref{ATOMIC_FETCH_OR}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_CAS}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_FETCH_ADD}, @*
+@ref{ATOMIC_FETCH_AND}, @*
+@ref{ATOMIC_FETCH_OR}, @*
@ref{ATOMIC_FETCH_XOR}
@end table
@@ -2457,11 +2457,11 @@ end program atomic
@end smallexample
@item @emph{See also}:
-@ref{ATOMIC_DEFINE}, @gol
-@ref{ATOMIC_FETCH_XOR}, @gol
-@ref{ISO_FORTRAN_ENV}, @gol
-@ref{ATOMIC_ADD}, @gol
-@ref{ATOMIC_OR}, @gol
+@ref{ATOMIC_DEFINE}, @*
+@ref{ATOMIC_FETCH_XOR}, @*
+@ref{ISO_FORTRAN_ENV}, @*
+@ref{ATOMIC_ADD}, @*
+@ref{ATOMIC_OR}, @*
@ref{ATOMIC_XOR}
@end table
@@ -2849,8 +2849,8 @@ as @var{I}.
The return value is of type @code{LOGICAL} and of the default kind.
@item @emph{See also}:
-@ref{BGT}, @gol
-@ref{BLE}, @gol
+@ref{BGT}, @*
+@ref{BLE}, @*
@ref{BLT}
@end table
@@ -2885,8 +2885,8 @@ as @var{I}.
The return value is of type @code{LOGICAL} and of the default kind.
@item @emph{See also}:
-@ref{BGE}, @gol
-@ref{BLE}, @gol
+@ref{BGE}, @*
+@ref{BLE}, @*
@ref{BLT}
@end table
@@ -2964,8 +2964,8 @@ as @var{I}.
The return value is of type @code{LOGICAL} and of the default kind.
@item @emph{See also}:
-@ref{BGT}, @gol
-@ref{BGE}, @gol
+@ref{BGT}, @*
+@ref{BGE}, @*
@ref{BLT}
@end table
@@ -3000,8 +3000,8 @@ as @var{I}.
The return value is of type @code{LOGICAL} and of the default kind.
@item @emph{See also}:
-@ref{BGE}, @gol
-@ref{BGT}, @gol
+@ref{BGE}, @*
+@ref{BGT}, @*
@ref{BLE}
@end table
@@ -3107,7 +3107,7 @@ end subroutine association_test
@end smallexample
@item @emph{See also}:
-@ref{C_LOC}, @gol
+@ref{C_LOC}, @*
@ref{C_FUNLOC}
@end table
@@ -3162,7 +3162,7 @@ end program main
@end smallexample
@item @emph{See also}:
-@ref{C_LOC}, @gol
+@ref{C_LOC}, @*
@ref{C_F_PROCPOINTER}
@end table
@@ -3220,7 +3220,7 @@ end program main
@end smallexample
@item @emph{See also}:
-@ref{C_LOC}, @gol
+@ref{C_LOC}, @*
@ref{C_F_POINTER}
@end table
@@ -3278,9 +3278,9 @@ end program main
@end smallexample
@item @emph{See also}:
-@ref{C_ASSOCIATED}, @gol
-@ref{C_LOC}, @gol
-@ref{C_F_POINTER}, @gol
+@ref{C_ASSOCIATED}, @*
+@ref{C_LOC}, @*
+@ref{C_F_POINTER}, @*
@ref{C_F_PROCPOINTER}
@end table
@@ -3326,9 +3326,9 @@ end subroutine association_test
@end smallexample
@item @emph{See also}:
-@ref{C_ASSOCIATED}, @gol
-@ref{C_FUNLOC}, @gol
-@ref{C_F_POINTER}, @gol
+@ref{C_ASSOCIATED}, @*
+@ref{C_FUNLOC}, @*
+@ref{C_F_POINTER}, @*
@ref{C_F_PROCPOINTER}
@end table
@@ -3379,7 +3379,7 @@ The example will print @code{T} unless you are using a platform
where default @code{REAL} variables are unusually padded.
@item @emph{See also}:
-@ref{SIZEOF}, @gol
+@ref{SIZEOF}, @*
@ref{STORAGE_SIZE}
@end table
@@ -3406,7 +3406,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{A} @tab The type shall be @code{REAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -3425,7 +3425,7 @@ end program test_ceiling
@end smallexample
@item @emph{See also}:
-@ref{FLOOR}, @gol
+@ref{FLOOR}, @*
@ref{NINT}
@end table
@@ -3452,7 +3452,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{I} @tab The type shall be @code{INTEGER}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -3480,8 +3480,8 @@ See @ref{ICHAR} for a discussion of converting between numerical values
and formatted string representations.
@item @emph{See also}:
-@ref{ACHAR}, @gol
-@ref{IACHAR}, @gol
+@ref{ACHAR}, @*
+@ref{IACHAR}, @*
@ref{ICHAR}
@end table
@@ -3636,7 +3636,7 @@ Elemental function
or @code{COMPLEX}.
@item @var{Y} @tab (Optional; only allowed if @var{X} is not
@code{COMPLEX}.) May be @code{INTEGER} or @code{REAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -3711,9 +3711,9 @@ end program test
@end smallexample
@item @emph{See also}:
-@ref{CO_MAX}, @gol
-@ref{CO_MIN}, @gol
-@ref{CO_SUM}, @gol
+@ref{CO_MAX}, @*
+@ref{CO_MIN}, @*
+@ref{CO_SUM}, @*
@ref{CO_REDUCE}
@end table
@@ -3768,9 +3768,9 @@ end program test
@end smallexample
@item @emph{See also}:
-@ref{CO_MIN}, @gol
-@ref{CO_SUM}, @gol
-@ref{CO_REDUCE}, @gol
+@ref{CO_MIN}, @*
+@ref{CO_SUM}, @*
+@ref{CO_REDUCE}, @*
@ref{CO_BROADCAST}
@end table
@@ -3825,9 +3825,9 @@ end program test
@end smallexample
@item @emph{See also}:
-@ref{CO_MAX}, @gol
-@ref{CO_SUM}, @gol
-@ref{CO_REDUCE}, @gol
+@ref{CO_MAX}, @*
+@ref{CO_SUM}, @*
+@ref{CO_REDUCE}, @*
@ref{CO_BROADCAST}
@end table
@@ -3908,9 +3908,9 @@ function, which takes two arguments of the same type and returning that
type as result.
@item @emph{See also}:
-@ref{CO_MIN}, @gol
-@ref{CO_MAX}, @gol
-@ref{CO_SUM}, @gol
+@ref{CO_MIN}, @*
+@ref{CO_MAX}, @*
+@ref{CO_SUM}, @*
@ref{CO_BROADCAST}
@end table
@@ -3966,9 +3966,9 @@ end program test
@end smallexample
@item @emph{See also}:
-@ref{CO_MAX}, @gol
-@ref{CO_MIN}, @gol
-@ref{CO_REDUCE}, @gol
+@ref{CO_MAX}, @*
+@ref{CO_MIN}, @*
+@ref{CO_REDUCE}, @*
@ref{CO_BROADCAST}
@end table
@@ -4013,7 +4013,7 @@ end program test_command_argument_count
@end smallexample
@item @emph{See also}:
-@ref{GET_COMMAND}, @gol
+@ref{GET_COMMAND}, @*
@ref{GET_COMMAND_ARGUMENT}
@end table
@@ -4058,7 +4058,7 @@ the @code{COMPILER_OPTIONS} intrinsic.
@end smallexample
@item @emph{See also}:
-@ref{COMPILER_VERSION}, @gol
+@ref{COMPILER_VERSION}, @*
@ref{ISO_FORTRAN_ENV}
@end table
@@ -4101,7 +4101,7 @@ It contains the name of the compiler and its version number.
@end smallexample
@item @emph{See also}:
-@ref{COMPILER_OPTIONS}, @gol
+@ref{COMPILER_OPTIONS}, @*
@ref{ISO_FORTRAN_ENV}
@end table
@@ -4260,9 +4260,9 @@ end program test_cos
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{ACOS} @gol
-Degrees function: @gol
+Inverse function: @*
+@ref{ACOS} @*
+Degrees function: @*
@ref{COSD}
@end table
@@ -4324,9 +4324,9 @@ end program test_cosd
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{ACOSD} @gol
-Radians function: @gol
+Inverse function: @*
+@ref{ACOSD} @*
+Radians function: @*
@ref{COS}
@end table
@@ -4380,7 +4380,7 @@ end program test_cosh
@end multitable
@item @emph{See also}:
-Inverse function: @gol
+Inverse function: @*
@ref{ACOSH}
@end table
@@ -4434,9 +4434,9 @@ end program test_cotan
@end multitable
@item @emph{See also}:
-Converse function: @gol
-@ref{TAN} @gol
-Degrees function: @gol
+Converse function: @*
+@ref{TAN} @*
+Degrees function: @*
@ref{COTAND}
@end table
@@ -4490,9 +4490,9 @@ end program test_cotand
@end multitable
@item @emph{See also}:
-Converse function: @gol
-@ref{TAND} @gol
-Radians function: @gol
+Converse function: @*
+@ref{TAND} @*
+Radians function: @*
@ref{COTAN}
@end table
@@ -4527,7 +4527,7 @@ Transformational function
@multitable @columnfractions .15 .70
@item @var{MASK} @tab The type shall be @code{LOGICAL}.
@item @var{DIM} @tab (Optional) The type shall be @code{INTEGER}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -4616,7 +4616,7 @@ end program test_cpu_time
@end smallexample
@item @emph{See also}:
-@ref{SYSTEM_CLOCK}, @gol
+@ref{SYSTEM_CLOCK}, @*
@ref{DATE_AND_TIME}
@end table
@@ -4732,10 +4732,10 @@ end program test_ctime
@end smallexample
@item @emph{See Also}:
-@ref{DATE_AND_TIME}, @gol
-@ref{GMTIME}, @gol
-@ref{LTIME}, @gol
-@ref{TIME}, @gol
+@ref{DATE_AND_TIME}, @*
+@ref{GMTIME}, @*
+@ref{LTIME}, @*
+@ref{TIME}, @*
@ref{TIME8}
@end table
@@ -4812,7 +4812,7 @@ end program test_time_and_date
@end smallexample
@item @emph{See also}:
-@ref{CPU_TIME}, @gol
+@ref{CPU_TIME}, @*
@ref{SYSTEM_CLOCK}
@end table
@@ -5811,7 +5811,7 @@ end program test_exit
@end smallexample
@item @emph{See also}:
-@ref{ABORT}, @gol
+@ref{ABORT}, @*
@ref{KILL}
@end table
@@ -6004,7 +6004,7 @@ end program test_fdate
@end smallexample
@item @emph{See also}:
-@ref{DATE_AND_TIME}, @gol
+@ref{DATE_AND_TIME}, @*
@ref{CTIME}
@end table
@@ -6069,8 +6069,8 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{FGETC}, @gol
-@ref{FPUT}, @gol
+@ref{FGETC}, @*
+@ref{FPUT}, @*
@ref{FPUTC}
@end table
@@ -6136,8 +6136,8 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{FGET}, @gol
-@ref{FPUT}, @gol
+@ref{FGET}, @*
+@ref{FPUT}, @*
@ref{FPUTC}
@end table
@@ -6186,7 +6186,7 @@ conformance with @var{ARRAY}.
inclusive. It may not be an optional dummy argument.
@item @var{MASK} @tab (Optional) Shall be of type @code{LOGICAL},
and conformable with @var{ARRAY}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@item @var{BACK} @tab (Optional) A scalar of type @code{LOGICAL}.
@end multitable
@@ -6202,7 +6202,7 @@ is present, the result is an integer of kind @var{KIND}, otherwise it
is of default kind.
@item @emph{See also}:
-@ref{MAXLOC}, @gol
+@ref{MAXLOC}, @*
@ref{MINLOC}
@end table
@@ -6215,7 +6215,7 @@ is of default kind.
@table @asis
@item @emph{Description}:
-@code{FLOOR(A)} returns the greatest integer less than or equal to @var{X}.
+@code{FLOOR(A)} returns the greatest integer less than or equal to @var{A}.
@item @emph{Standard}:
Fortran 95 and later
@@ -6229,7 +6229,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{A} @tab The type shall be @code{REAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -6248,7 +6248,7 @@ end program test_floor
@end smallexample
@item @emph{See also}:
-@ref{CEILING}, @gol
+@ref{CEILING}, @*
@ref{NINT}
@end table
@@ -6419,8 +6419,8 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{FPUTC}, @gol
-@ref{FGET}, @gol
+@ref{FPUTC}, @*
+@ref{FGET}, @*
@ref{FGETC}
@end table
@@ -6484,8 +6484,8 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{FPUT}, @gol
-@ref{FGET}, @gol
+@ref{FPUT}, @*
+@ref{FGET}, @*
@ref{FGETC}
@end table
@@ -6694,9 +6694,9 @@ on success and a system specific error code otherwise.
See @ref{STAT} for an example.
@item @emph{See also}:
-To stat a link: @gol
-@ref{LSTAT} @gol
-To stat a file: @gol
+To stat a link: @*
+@ref{LSTAT} @*
+To stat a file: @*
@ref{STAT}
@end table
@@ -6804,7 +6804,7 @@ end program test_gamma
@end multitable
@item @emph{See also}:
-Logarithm of the Gamma function: @gol
+Logarithm of the Gamma function: @*
@ref{LOG_GAMMA}
@end table
@@ -6844,7 +6844,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{IERRNO}, @gol
+@ref{IERRNO}, @*
@ref{PERROR}
@end table
@@ -6905,11 +6905,11 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-GNU Fortran 77 compatibility function: @gol
-@ref{IARGC} @gol
-Fortran 2003 functions and subroutines: @gol
-@ref{GET_COMMAND}, @gol
-@ref{GET_COMMAND_ARGUMENT}, @gol
+GNU Fortran 77 compatibility function: @*
+@ref{IARGC} @*
+Fortran 2003 functions and subroutines: @*
+@ref{GET_COMMAND}, @*
+@ref{GET_COMMAND_ARGUMENT}, @*
@ref{COMMAND_ARGUMENT_COUNT}
@end table
@@ -6961,7 +6961,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{GET_COMMAND_ARGUMENT}, @gol
+@ref{GET_COMMAND_ARGUMENT}, @*
@ref{COMMAND_ARGUMENT_COUNT}
@end table
@@ -7029,7 +7029,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{GET_COMMAND}, @gol
+@ref{GET_COMMAND}, @*
@ref{COMMAND_ARGUMENT_COUNT}
@end table
@@ -7223,7 +7223,7 @@ kind.
See @code{GETPID} for an example.
@item @emph{See also}:
-@ref{GETPID}, @gol
+@ref{GETPID}, @*
@ref{GETUID}
@end table
@@ -7308,7 +7308,7 @@ end program info
@end smallexample
@item @emph{See also}:
-@ref{GETGID}, @gol
+@ref{GETGID}, @*
@ref{GETUID}
@end table
@@ -7342,7 +7342,7 @@ kind.
See @code{GETPID} for an example.
@item @emph{See also}:
-@ref{GETPID}, @gol
+@ref{GETPID}, @*
@ref{GETLOG}
@end table
@@ -7399,10 +7399,10 @@ effect, zero if not, and negative if the information is not available.
@end enumerate
@item @emph{See also}:
-@ref{DATE_AND_TIME}, @gol
-@ref{CTIME}, @gol
-@ref{LTIME}, @gol
-@ref{TIME}, @gol
+@ref{DATE_AND_TIME}, @*
+@ref{CTIME}, @*
+@ref{LTIME}, @*
+@ref{TIME}, @*
@ref{TIME8}
@end table
@@ -7550,7 +7550,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)}
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -7571,8 +7571,8 @@ See @ref{ICHAR} for a discussion of converting between numerical values
and formatted string representations.
@item @emph{See also}:
-@ref{ACHAR}, @gol
-@ref{CHAR}, @gol
+@ref{ACHAR}, @*
+@ref{CHAR}, @*
@ref{ICHAR}
@end table
@@ -7633,8 +7633,8 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{IANY}, @gol
-@ref{IPARITY}, @gol
+@ref{IANY}, @*
+@ref{IPARITY}, @*
@ref{IAND}
@end table
@@ -7697,11 +7697,11 @@ END PROGRAM
@end multitable
@item @emph{See also}:
-@ref{IOR}, @gol
-@ref{IEOR}, @gol
-@ref{IBITS}, @gol
-@ref{IBSET}, @gol
-@ref{IBCLR}, @gol
+@ref{IOR}, @*
+@ref{IEOR}, @*
+@ref{IBITS}, @*
+@ref{IBSET}, @*
+@ref{IBCLR}, @*
@ref{NOT}
@end table
@@ -7762,8 +7762,8 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{IPARITY}, @gol
-@ref{IALL}, @gol
+@ref{IPARITY}, @*
+@ref{IALL}, @*
@ref{IOR}
@end table
@@ -7805,11 +7805,11 @@ The number of command line arguments, type @code{INTEGER(4)}.
See @ref{GETARG}
@item @emph{See also}:
-GNU Fortran 77 compatibility subroutine: @gol
-@ref{GETARG} @gol
-Fortran 2003 functions and subroutines: @gol
-@ref{GET_COMMAND}, @gol
-@ref{GET_COMMAND_ARGUMENT}, @gol
+GNU Fortran 77 compatibility subroutine: @*
+@ref{GETARG} @*
+Fortran 2003 functions and subroutines: @*
+@ref{GET_COMMAND}, @*
+@ref{GET_COMMAND_ARGUMENT}, @*
@ref{COMMAND_ARGUMENT_COUNT}
@end table
@@ -7860,11 +7860,11 @@ The return value is of type @code{INTEGER} and of the same kind as
@end multitable
@item @emph{See also}:
-@ref{IBITS}, @gol
-@ref{IBSET}, @gol
-@ref{IAND}, @gol
-@ref{IOR}, @gol
-@ref{IEOR}, @gol
+@ref{IBITS}, @*
+@ref{IBSET}, @*
+@ref{IAND}, @*
+@ref{IOR}, @*
+@ref{IEOR}, @*
@ref{MVBITS}
@end table
@@ -7919,11 +7919,11 @@ The return value is of type @code{INTEGER} and of the same kind as
@end multitable
@item @emph{See also}:
-@ref{BIT_SIZE}, @gol
-@ref{IBCLR}, @gol
-@ref{IBSET}, @gol
-@ref{IAND}, @gol
-@ref{IOR}, @gol
+@ref{BIT_SIZE}, @*
+@ref{IBCLR}, @*
+@ref{IBSET}, @*
+@ref{IAND}, @*
+@ref{IOR}, @*
@ref{IEOR}
@end table
@@ -7973,11 +7973,11 @@ The return value is of type @code{INTEGER} and of the same kind as
@end multitable
@item @emph{See also}:
-@ref{IBCLR}, @gol
-@ref{IBITS}, @gol
-@ref{IAND}, @gol
-@ref{IOR}, @gol
-@ref{IEOR}, @gol
+@ref{IBCLR}, @*
+@ref{IBITS}, @*
+@ref{IAND}, @*
+@ref{IOR}, @*
+@ref{IEOR}, @*
@ref{MVBITS}
@end table
@@ -8007,7 +8007,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{C} @tab Shall be a scalar @code{CHARACTER}, with @code{INTENT(IN)}
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -8053,8 +8053,8 @@ end program read_val
@end smallexample
@item @emph{See also}:
-@ref{ACHAR}, @gol
-@ref{CHAR}, @gol
+@ref{ACHAR}, @*
+@ref{CHAR}, @*
@ref{IACHAR}
@end table
@@ -8161,11 +8161,11 @@ type parameter of the other argument as-if a call to @ref{INT} occurred.
@end multitable
@item @emph{See also}:
-@ref{IOR}, @gol
-@ref{IAND}, @gol
-@ref{IBITS}, @gol
-@ref{IBSET}, @gol
-@ref{IBCLR}, @gol
+@ref{IOR}, @*
+@ref{IAND}, @*
+@ref{IBITS}, @*
+@ref{IBSET}, @*
+@ref{IBCLR}, @*
@ref{NOT}
@end table
@@ -8242,7 +8242,7 @@ WRITE (*,*) IMAGE_INDEX (array, [2,0,3,1])
@end smallexample
@item @emph{See also}:
-@ref{THIS_IMAGE}, @gol
+@ref{THIS_IMAGE}, @*
@ref{NUM_IMAGES}
@end table
@@ -8279,7 +8279,7 @@ Elemental function
@code{INTENT(IN)}
@item @var{BACK} @tab (Optional) Shall be a scalar @code{LOGICAL}, with
@code{INTENT(IN)}
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -8294,7 +8294,7 @@ The return value is of type @code{INTEGER} and of kind @var{KIND}. If
@end multitable
@item @emph{See also}:
-@ref{SCAN}, @gol
+@ref{SCAN}, @*
@ref{VERIFY}
@end table
@@ -8324,7 +8324,7 @@ Elemental function
@multitable @columnfractions .15 .70
@item @var{A} @tab Shall be of type @code{INTEGER},
@code{REAL}, or @code{COMPLEX} or a boz-literal-constant.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -8395,7 +8395,7 @@ Elemental function
The return value is a @code{INTEGER(2)} variable.
@item @emph{See also}:
-@ref{INT}, @gol
+@ref{INT}, @*
@ref{INT8}
@end table
@@ -8431,7 +8431,7 @@ Elemental function
The return value is a @code{INTEGER(8)} variable.
@item @emph{See also}:
-@ref{INT}, @gol
+@ref{INT}, @*
@ref{INT2}
@end table
@@ -8486,11 +8486,11 @@ type parameter of the other argument as-if a call to @ref{INT} occurred.
@end multitable
@item @emph{See also}:
-@ref{IEOR}, @gol
-@ref{IAND}, @gol
-@ref{IBITS}, @gol
-@ref{IBSET}, @gol
-@ref{IBCLR}, @gol
+@ref{IEOR}, @*
+@ref{IAND}, @*
+@ref{IBITS}, @*
+@ref{IBSET}, @*
+@ref{IBCLR}, @*
@ref{NOT}
@end table
@@ -8552,9 +8552,9 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{IANY}, @gol
-@ref{IALL}, @gol
-@ref{IEOR}, @gol
+@ref{IANY}, @*
+@ref{IALL}, @*
+@ref{IEOR}, @*
@ref{PARITY}
@end table
@@ -9038,7 +9038,7 @@ Returns 0 on success; otherwise a system-specific error code is returned.
@end multitable
@item @emph{See also}:
-@ref{ABORT}, @gol
+@ref{ABORT}, @*
@ref{EXIT}
@end table
@@ -9109,7 +9109,7 @@ Inquiry function
@multitable @columnfractions .15 .70
@item @var{ARRAY} @tab Shall be an array, of any type.
@item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -9124,7 +9124,7 @@ structure component, or if it has a zero extent along the relevant
dimension, the lower bound is taken to be 1.
@item @emph{See also}:
-@ref{UBOUND}, @gol
+@ref{UBOUND}, @*
@ref{LCOBOUND}
@end table
@@ -9152,7 +9152,7 @@ Inquiry function
@multitable @columnfractions .15 .70
@item @var{ARRAY} @tab Shall be an coarray, of any type.
@item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -9164,7 +9164,7 @@ If @var{DIM} is absent, the result is an array of the lower cobounds of
corresponding to the lower cobound of the array along that codimension.
@item @emph{See also}:
-@ref{UCOBOUND}, @gol
+@ref{UCOBOUND}, @*
@ref{LBOUND}
@end table
@@ -9206,9 +9206,9 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{BIT_SIZE}, @gol
-@ref{TRAILZ}, @gol
-@ref{POPCNT}, @gol
+@ref{BIT_SIZE}, @*
+@ref{TRAILZ}, @*
+@ref{POPCNT}, @*
@ref{POPPAR}
@end table
@@ -9239,7 +9239,7 @@ Inquiry function
@multitable @columnfractions .15 .70
@item @var{STRING} @tab Shall be a scalar or array of type
@code{CHARACTER}, with @code{INTENT(IN)}
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -9256,8 +9256,8 @@ The return value is of type @code{INTEGER} and of kind @var{KIND}. If
@item @emph{See also}:
-@ref{LEN_TRIM}, @gol
-@ref{ADJUSTL}, @gol
+@ref{LEN_TRIM}, @*
+@ref{ADJUSTL}, @*
@ref{ADJUSTR}
@end table
@@ -9285,7 +9285,7 @@ Elemental function
@multitable @columnfractions .15 .70
@item @var{STRING} @tab Shall be a scalar of type @code{CHARACTER},
with @code{INTENT(IN)}
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -9294,8 +9294,8 @@ The return value is of type @code{INTEGER} and of kind @var{KIND}. If
@var{KIND} is absent, the return value is of default integer kind.
@item @emph{See also}:
-@ref{LEN}, @gol
-@ref{ADJUSTL}, @gol
+@ref{LEN}, @*
+@ref{ADJUSTL}, @*
@ref{ADJUSTR}
@end table
@@ -9348,8 +9348,8 @@ otherwise, based on the ASCII ordering.
@end multitable
@item @emph{See also}:
-@ref{LGT}, @gol
-@ref{LLE}, @gol
+@ref{LGT}, @*
+@ref{LLE}, @*
@ref{LLT}
@end table
@@ -9402,8 +9402,8 @@ otherwise, based on the ASCII ordering.
@end multitable
@item @emph{See also}:
-@ref{LGE}, @gol
-@ref{LLE}, @gol
+@ref{LGE}, @*
+@ref{LLE}, @*
@ref{LLT}
@end table
@@ -9447,7 +9447,7 @@ Subroutine, function
@end multitable
@item @emph{See also}:
-@ref{SYMLNK}, @gol
+@ref{SYMLNK}, @*
@ref{UNLINK}
@end table
@@ -9500,8 +9500,8 @@ otherwise, based on the ASCII ordering.
@end multitable
@item @emph{See also}:
-@ref{LGE}, @gol
-@ref{LGT}, @gol
+@ref{LGE}, @*
+@ref{LGT}, @*
@ref{LLT}
@end table
@@ -9554,8 +9554,8 @@ otherwise, based on the ASCII ordering.
@end multitable
@item @emph{See also}:
-@ref{LGE}, @gol
-@ref{LGT}, @gol
+@ref{LGE}, @*
+@ref{LGT}, @*
@ref{LLE}
@end table
@@ -9591,7 +9591,7 @@ with @code{INTENT(IN)}
The return value is of @code{INTEGER(kind=4)} type.
@item @emph{See also}:
-@ref{INDEX intrinsic}, @gol
+@ref{INDEX intrinsic}, @*
@ref{LEN_TRIM}
@end table
@@ -9796,7 +9796,7 @@ end program test_log_gamma
@end multitable
@item @emph{See also}:
-Gamma function: @gol
+Gamma function: @*
@ref{GAMMA}
@end table
@@ -9823,7 +9823,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{L} @tab The type shall be @code{LOGICAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -9833,8 +9833,8 @@ kind corresponding to @var{KIND}, or of the default logical kind if
@var{KIND} is not given.
@item @emph{See also}:
-@ref{INT}, @gol
-@ref{REAL}, @gol
+@ref{INT}, @*
+@ref{REAL}, @*
@ref{CMPLX}
@end table
@@ -9877,11 +9877,11 @@ The return value is of type @code{INTEGER} and of the same kind as
@var{I}.
@item @emph{See also}:
-@ref{ISHFT}, @gol
-@ref{ISHFTC}, @gol
-@ref{RSHIFT}, @gol
-@ref{SHIFTA}, @gol
-@ref{SHIFTL}, @gol
+@ref{ISHFT}, @*
+@ref{ISHFTC}, @*
+@ref{RSHIFT}, @*
+@ref{SHIFTA}, @*
+@ref{SHIFTL}, @*
@ref{SHIFTR}
@end table
@@ -9928,9 +9928,9 @@ Returns 0 on success and a system specific error code otherwise.
See @ref{STAT} for an example.
@item @emph{See also}:
-To stat an open file: @gol
-@ref{FSTAT} @gol
-To stat a file: @gol
+To stat an open file: @*
+@ref{FSTAT} @*
+To stat a file: @*
@ref{STAT}
@end table
@@ -9986,10 +9986,10 @@ effect, zero if not, and negative if the information is not available.
@end enumerate
@item @emph{See also}:
-@ref{DATE_AND_TIME}, @gol
-@ref{CTIME}, @gol
-@ref{GMTIME}, @gol
-@ref{TIME}, @gol
+@ref{DATE_AND_TIME}, @*
+@ref{CTIME}, @*
+@ref{GMTIME}, @*
+@ref{TIME}, @*
@ref{TIME8}
@end table
@@ -10219,8 +10219,8 @@ and has the same type and kind as the first argument.
@end multitable
@item @emph{See also}:
-@ref{MAXLOC} @gol
-@ref{MAXVAL}, @gol
+@ref{MAXLOC} @*
+@ref{MAXVAL}, @*
@ref{MIN}
@end table
@@ -10312,7 +10312,7 @@ Transformational function
inclusive. It may not be an optional dummy argument.
@item @var{MASK} @tab Shall be of type @code{LOGICAL},
and conformable with @var{ARRAY}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@item @var{BACK} @tab (Optional) A scalar of type @code{LOGICAL}.
@end multitable
@@ -10328,8 +10328,8 @@ is present, the result is an integer of kind @var{KIND}, otherwise it
is of default kind.
@item @emph{See also}:
-@ref{FINDLOC}, @gol
-@ref{MAX}, @gol
+@ref{FINDLOC}, @*
+@ref{MAX}, @*
@ref{MAXVAL}
@end table
@@ -10383,7 +10383,7 @@ the size of @var{ARRAY} with the @var{DIM} dimension removed. In all
cases, the result is of the same type and kind as @var{ARRAY}.
@item @emph{See also}:
-@ref{MAX}, @gol
+@ref{MAX}, @*
@ref{MAXLOC}
@end table
@@ -10421,10 +10421,10 @@ number of clock ticks since the start of the process, or @code{-1} if
the system does not support @code{clock(3)}.
@item @emph{See also}:
-@ref{CTIME}, @gol
-@ref{GMTIME}, @gol
-@ref{LTIME}, @gol
-@ref{MCLOCK}, @gol
+@ref{CTIME}, @*
+@ref{GMTIME}, @*
+@ref{LTIME}, @*
+@ref{MCLOCK}, @*
@ref{TIME}
@end table
@@ -10464,10 +10464,10 @@ number of clock ticks since the start of the process, or @code{-1} if
the system does not support @code{clock(3)}.
@item @emph{See also}:
-@ref{CTIME}, @gol
-@ref{GMTIME}, @gol
-@ref{LTIME}, @gol
-@ref{MCLOCK}, @gol
+@ref{CTIME}, @*
+@ref{GMTIME}, @*
+@ref{LTIME}, @*
+@ref{MCLOCK}, @*
@ref{TIME8}
@end table
@@ -10594,8 +10594,8 @@ and has the same type and kind as the first argument.
@end multitable
@item @emph{See also}:
-@ref{MAX}, @gol
-@ref{MINLOC}, @gol
+@ref{MAX}, @*
+@ref{MINLOC}, @*
@ref{MINVAL}
@end table
@@ -10679,7 +10679,7 @@ Transformational function
inclusive. It may not be an optional dummy argument.
@item @var{MASK} @tab Shall be of type @code{LOGICAL},
and conformable with @var{ARRAY}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@item @var{BACK} @tab (Optional) A scalar of type @code{LOGICAL}.
@end multitable
@@ -10695,8 +10695,8 @@ is present, the result is an integer of kind @var{KIND}, otherwise it
is of default kind.
@item @emph{See also}:
-@ref{FINDLOC}, @gol
-@ref{MIN}, @gol
+@ref{FINDLOC}, @*
+@ref{MIN}, @*
@ref{MINVAL}
@end table
@@ -10750,7 +10750,7 @@ the size of @var{ARRAY} with the @var{DIM} dimension removed. In all
cases, the result is of the same type and kind as @var{ARRAY}.
@item @emph{See also}:
-@ref{MIN}, @gol
+@ref{MIN}, @*
@ref{MINLOC}
@end table
@@ -10992,11 +10992,11 @@ same kind as @var{FROM}.
@end multitable
@item @emph{See also}:
-@ref{IBCLR}, @gol
-@ref{IBSET}, @gol
-@ref{IBITS}, @gol
-@ref{IAND}, @gol
-@ref{IOR}, @gol
+@ref{IBCLR}, @*
+@ref{IBSET}, @*
+@ref{IBITS}, @*
+@ref{IAND}, @*
+@ref{IOR}, @*
@ref{IEOR}
@end table
@@ -11111,7 +11111,7 @@ Elemental function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{A} @tab The type of the argument shall be @code{REAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -11139,7 +11139,7 @@ end program test_nint
@end multitable
@item @emph{See also}:
-@ref{CEILING}, @gol
+@ref{CEILING}, @*
@ref{FLOOR}
@end table
@@ -11240,11 +11240,11 @@ argument.
@end multitable
@item @emph{See also}:
-@ref{IAND}, @gol
-@ref{IEOR}, @gol
-@ref{IOR}, @gol
-@ref{IBITS}, @gol
-@ref{IBSET}, @gol
+@ref{IAND}, @*
+@ref{IEOR}, @*
+@ref{IOR}, @*
+@ref{IBITS}, @*
+@ref{IBSET}, @*
@ref{IBCLR}
@end table
@@ -11347,7 +11347,7 @@ END IF
@end smallexample
@item @emph{See also}:
-@ref{THIS_IMAGE}, @gol
+@ref{THIS_IMAGE}, @*
@ref{IMAGE_INDEX}
@end table
@@ -11407,7 +11407,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-Fortran 95 elemental function: @gol
+Fortran 95 elemental function: @*
@ref{IOR}
@end table
@@ -11604,8 +11604,8 @@ program test_population
end program test_population
@end smallexample
@item @emph{See also}:
-@ref{POPPAR}, @gol
-@ref{LEADZ}, @gol
+@ref{POPPAR}, @*
+@ref{LEADZ}, @*
@ref{TRAILZ}
@end table
@@ -11651,8 +11651,8 @@ program test_population
end program test_population
@end smallexample
@item @emph{See also}:
-@ref{POPCNT}, @gol
-@ref{LEADZ}, @gol
+@ref{POPCNT}, @*
+@ref{LEADZ}, @*
@ref{TRAILZ}
@end table
@@ -11698,7 +11698,7 @@ program prec_and_range
end program prec_and_range
@end smallexample
@item @emph{See also}:
-@ref{SELECTED_REAL_KIND}, @gol
+@ref{SELECTED_REAL_KIND}, @*
@ref{RANGE}
@end table
@@ -11866,7 +11866,7 @@ GNU extension
Function
@item @emph{See also}:
-@ref{RAND}, @gol
+@ref{RAND}, @*
@ref{RANDOM_NUMBER}
@end table
@@ -11919,7 +11919,7 @@ end program test_rand
@end smallexample
@item @emph{See also}:
-@ref{SRAND}, @gol
+@ref{SRAND}, @*
@ref{RANDOM_NUMBER}
@end table
@@ -11976,7 +11976,7 @@ end program test_random_seed
@end smallexample
@item @emph{See also}:
-@ref{RANDOM_NUMBER}, @gol
+@ref{RANDOM_NUMBER}, @*
@ref{RANDOM_SEED}
@end table
@@ -12025,7 +12025,7 @@ end program
@end smallexample
@item @emph{See also}:
-@ref{RANDOM_SEED}, @gol
+@ref{RANDOM_SEED}, @*
@ref{RANDOM_INIT}
@end table
@@ -12096,7 +12096,7 @@ end program test_random_seed
@end smallexample
@item @emph{See also}:
-@ref{RANDOM_NUMBER}, @gol
+@ref{RANDOM_NUMBER}, @*
@ref{RANDOM_INIT}
@end table
@@ -12134,7 +12134,7 @@ kind.
@item @emph{Example}:
See @code{PRECISION} for an example.
@item @emph{See also}:
-@ref{SELECTED_REAL_KIND}, @gol
+@ref{SELECTED_REAL_KIND}, @*
@ref{PRECISION}
@end table
@@ -12216,7 +12216,7 @@ Elemental function
@multitable @columnfractions .15 .70
@item @var{A} @tab Shall be @code{INTEGER}, @code{REAL}, or
@code{COMPLEX}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -12475,11 +12475,11 @@ The return value is of type @code{INTEGER} and of the same kind as
@var{I}.
@item @emph{See also}:
-@ref{ISHFT}, @gol
-@ref{ISHFTC}, @gol
-@ref{LSHIFT}, @gol
-@ref{SHIFTA}, @gol
-@ref{SHIFTR}, @gol
+@ref{ISHFT}, @*
+@ref{ISHFTC}, @*
+@ref{LSHIFT}, @*
+@ref{SHIFTA}, @*
+@ref{SHIFTR}, @*
@ref{SHIFTL}
@end table
@@ -12594,7 +12594,7 @@ Elemental function
@item @var{STRING} @tab Shall be of type @code{CHARACTER}.
@item @var{SET} @tab Shall be of type @code{CHARACTER}.
@item @var{BACK} @tab (Optional) shall be of type @code{LOGICAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -12612,7 +12612,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{INDEX intrinsic}, @gol
+@ref{INDEX intrinsic}, @*
@ref{VERIFY}
@end table
@@ -12881,8 +12881,8 @@ program real_kinds
end program real_kinds
@end smallexample
@item @emph{See also}:
-@ref{PRECISION}, @gol
-@ref{RANGE}, @gol
+@ref{PRECISION}, @*
+@ref{RANGE}, @*
@ref{RADIX}
@end table
@@ -12956,7 +12956,7 @@ Inquiry function
@item @var{SOURCE} @tab Shall be an array or scalar of any type.
If @var{SOURCE} is a pointer it must be associated and allocatable
arrays must be allocated.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -12977,7 +12977,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{RESHAPE}, @gol
+@ref{RESHAPE}, @*
@ref{SIZE}
@end table
@@ -13019,7 +13019,7 @@ The return value is of type @code{INTEGER} and of the same kind as
@var{I}.
@item @emph{See also}:
-@ref{SHIFTL}, @gol
+@ref{SHIFTL}, @*
@ref{SHIFTR}
@end table
@@ -13059,7 +13059,7 @@ The return value is of type @code{INTEGER} and of the same kind as
@var{I}.
@item @emph{See also}:
-@ref{SHIFTA}, @gol
+@ref{SHIFTA}, @*
@ref{SHIFTR}
@end table
@@ -13099,7 +13099,7 @@ The return value is of type @code{INTEGER} and of the same kind as
@var{I}.
@item @emph{See also}:
-@ref{SHIFTA}, @gol
+@ref{SHIFTA}, @*
@ref{SHIFTL}
@end table
@@ -13269,9 +13269,9 @@ end program test_sin
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{ASIN} @gol
-Degrees function: @gol
+Inverse function: @*
+@ref{ASIN} @*
+Degrees function: @*
@ref{SIND}
@end table
@@ -13331,10 +13331,10 @@ end program test_sind
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{ASIND} @gol
-Radians function: @gol
-@ref{SIN} @gol
+Inverse function: @*
+@ref{ASIND} @*
+Radians function: @*
+@ref{SIN} @*
@end table
@@ -13417,7 +13417,7 @@ a pointer it must be associated and allocatable arrays must be allocated.
@item @var{DIM} @tab (Optional) shall be a scalar of type @code{INTEGER}
and its value shall be in the range from 1 to n, where n equals the rank
of @var{ARRAY}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -13433,7 +13433,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{SHAPE}, @gol
+@ref{SHAPE}, @*
@ref{RESHAPE}
@end table
@@ -13487,7 +13487,7 @@ The example will print @code{.TRUE.} unless you are using a platform
where default @code{REAL} variables are unusually padded.
@item @emph{See also}:
-@ref{C_SIZEOF}, @gol
+@ref{C_SIZEOF}, @*
@ref{STORAGE_SIZE}
@end table
@@ -13719,8 +13719,8 @@ Please note that in GNU Fortran, these two sets of intrinsics (@code{RAND},
pseudo-random number generators.
@item @emph{See also}:
-@ref{RAND}, @gol
-@ref{RANDOM_SEED}, @gol
+@ref{RAND}, @*
+@ref{RANDOM_SEED}, @*
@ref{RANDOM_NUMBER}
@end table
@@ -13808,9 +13808,9 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-To stat an open file: @gol
-@ref{FSTAT} @gol
-To stat a link: @gol
+To stat an open file: @*
+@ref{FSTAT} @*
+To stat a link: @*
@ref{LSTAT}
@end table
@@ -13844,7 +13844,7 @@ expressed in bits for an element of an array that has the dynamic type and type
parameters of A.
@item @emph{See also}:
-@ref{C_SIZEOF}, @gol
+@ref{C_SIZEOF}, @*
@ref{SIZEOF}
@end table
@@ -13948,7 +13948,7 @@ Subroutine, function
@end multitable
@item @emph{See also}:
-@ref{LINK}, @gol
+@ref{LINK}, @*
@ref{UNLINK}
@end table
@@ -14071,7 +14071,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{DATE_AND_TIME}, @gol
+@ref{DATE_AND_TIME}, @*
@ref{CPU_TIME}
@end table
@@ -14121,9 +14121,9 @@ end program test_tan
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{ATAN} @gol
-Degrees function: @gol
+Inverse function: @*
+@ref{ATAN} @*
+Degrees function: @*
@ref{TAND}
@end table
@@ -14176,9 +14176,9 @@ end program test_tand
@end multitable
@item @emph{See also}:
-Inverse function: @gol
-@ref{ATAND} @gol
-Radians function: @gol
+Inverse function: @*
+@ref{ATAND} @*
+Radians function: @*
@ref{TAN}
@end table
@@ -14303,7 +14303,7 @@ IF (THIS_IMAGE(HUGE(1)) /= THIS_IMAGE())
@end smallexample
@item @emph{See also}:
-@ref{NUM_IMAGES}, @gol
+@ref{NUM_IMAGES}, @*
@ref{IMAGE_INDEX}
@end table
@@ -14344,11 +14344,11 @@ Function
The return value is a scalar of type @code{INTEGER(4)}.
@item @emph{See also}:
-@ref{DATE_AND_TIME}, @gol
-@ref{CTIME}, @gol
-@ref{GMTIME}, @gol
-@ref{LTIME}, @gol
-@ref{MCLOCK}, @gol
+@ref{DATE_AND_TIME}, @*
+@ref{CTIME}, @*
+@ref{GMTIME}, @*
+@ref{LTIME}, @*
+@ref{MCLOCK}, @*
@ref{TIME8}
@end table
@@ -14387,11 +14387,11 @@ Function
The return value is a scalar of type @code{INTEGER(8)}.
@item @emph{See also}:
-@ref{DATE_AND_TIME}, @gol
-@ref{CTIME}, @gol
-@ref{GMTIME}, @gol
-@ref{LTIME}, @gol
-@ref{MCLOCK8}, @gol
+@ref{DATE_AND_TIME}, @*
+@ref{CTIME}, @*
+@ref{GMTIME}, @*
+@ref{LTIME}, @*
+@ref{MCLOCK8}, @*
@ref{TIME}
@end table
@@ -14466,9 +14466,9 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{BIT_SIZE}, @gol
-@ref{LEADZ}, @gol
-@ref{POPPAR}, @gol
+@ref{BIT_SIZE}, @*
+@ref{LEADZ}, @*
+@ref{POPPAR}, @*
@ref{POPCNT}
@end table
@@ -14606,7 +14606,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{ADJUSTL}, @gol
+@ref{ADJUSTL}, @*
@ref{ADJUSTR}
@end table
@@ -14680,8 +14680,8 @@ Inquiry function
@item @emph{Arguments}:
@multitable @columnfractions .15 .70
@item @var{ARRAY} @tab Shall be an array, of any type.
-@item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}.
-@item @var{KIND}@tab (Optional) An @code{INTEGER} initialization
+@item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}.
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -14697,7 +14697,7 @@ dimension, the upper bound is taken to be the number of elements along
the relevant dimension.
@item @emph{See also}:
-@ref{LBOUND}, @gol
+@ref{LBOUND}, @*
@ref{LCOBOUND}
@end table
@@ -14725,7 +14725,7 @@ Inquiry function
@multitable @columnfractions .15 .70
@item @var{ARRAY} @tab Shall be an coarray, of any type.
@item @var{DIM} @tab (Optional) Shall be a scalar @code{INTEGER}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -14737,7 +14737,7 @@ If @var{DIM} is absent, the result is an array of the lower cobounds of
corresponding to the lower cobound of the array along that codimension.
@item @emph{See also}:
-@ref{LCOBOUND}, @gol
+@ref{LCOBOUND}, @*
@ref{LBOUND}
@end table
@@ -14812,7 +14812,7 @@ Subroutine, function
@end multitable
@item @emph{See also}:
-@ref{LINK}, @gol
+@ref{LINK}, @*
@ref{SYMLNK}
@end table
@@ -14864,7 +14864,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{PACK}, @gol
+@ref{PACK}, @*
@ref{SPREAD}
@end table
@@ -14900,7 +14900,7 @@ Elemental function
@item @var{STRING} @tab Shall be of type @code{CHARACTER}.
@item @var{SET} @tab Shall be of type @code{CHARACTER}.
@item @var{BACK} @tab (Optional) shall be of type @code{LOGICAL}.
-@item @var{KIND} @tab (Optional) An @code{INTEGER} initialization
+@item @var{KIND} @tab (Optional) A scalar @code{INTEGER} constant
expression indicating the kind parameter of the result.
@end multitable
@@ -14920,7 +14920,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-@ref{SCAN}, @gol
+@ref{SCAN}, @*
@ref{INDEX intrinsic}
@end table
@@ -14981,7 +14981,7 @@ END PROGRAM
@end smallexample
@item @emph{See also}:
-Fortran 95 elemental function: @gol
+Fortran 95 elemental function: @*
@ref{IEOR}
@end table
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 58502d3..38150b1 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -1,10 +1,10 @@
-@c Copyright (C) 2004-2022 Free Software Foundation, Inc.
+@c Copyright (C) 2004-2023 Free Software Foundation, Inc.
@c This is part of the GNU Fortran manual.
@c For copying conditions, see the file gfortran.texi.
@ignore
@c man begin COPYRIGHT
-Copyright @copyright{} 2004-2022 Free Software Foundation, Inc.
+Copyright @copyright{} 2004-2023 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -116,17 +116,17 @@ by type. Explanations are in the following sections.
@table @emph
@item Fortran Language Options
@xref{Fortran Dialect Options,,Options controlling Fortran dialect}.
-@gccoptlist{-fall-intrinsics -fallow-argument-mismatch -fallow-invalid-boz @gol
--fbackslash -fcray-pointer -fd-lines-as-code -fd-lines-as-comments @gol
--fdec -fdec-char-conversions -fdec-structure -fdec-intrinsic-ints @gol
--fdec-static -fdec-math -fdec-include -fdec-format-defaults @gol
--fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8 @gol
--fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok @gol
--ffixed-line-length-@var{n} -ffixed-line-length-none -fpad-source @gol
--ffree-form -ffree-line-length-@var{n} -ffree-line-length-none @gol
--fimplicit-none -finteger-4-integer-8 -fmax-identifier-length @gol
--fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp @gol
--freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10 @gol
+@gccoptlist{-fall-intrinsics -fallow-argument-mismatch -fallow-invalid-boz
+-fbackslash -fcray-pointer -fd-lines-as-code -fd-lines-as-comments
+-fdec -fdec-char-conversions -fdec-structure -fdec-intrinsic-ints
+-fdec-static -fdec-math -fdec-include -fdec-format-defaults
+-fdec-blank-format-item -fdefault-double-8 -fdefault-integer-8
+-fdefault-real-8 -fdefault-real-10 -fdefault-real-16 -fdollar-ok
+-ffixed-line-length-@var{n} -ffixed-line-length-none -fpad-source
+-ffree-form -ffree-line-length-@var{n} -ffree-line-length-none
+-fimplicit-none -finteger-4-integer-8 -fmax-identifier-length
+-fmodule-private -ffixed-form -fno-range-check -fopenacc -fopenmp
+-freal-4-real-10 -freal-4-real-16 -freal-4-real-8 -freal-8-real-10
-freal-8-real-16 -freal-8-real-4 -std=@var{std} -ftest-forall-temp
}
@@ -134,33 +134,33 @@ by type. Explanations are in the following sections.
@xref{Preprocessing Options,,Enable and customize preprocessing}.
@gccoptlist{-A-@var{question}@r{[}=@var{answer}@r{]}
-A@var{question}=@var{answer} -C -CC -D@var{macro}@r{[}=@var{defn}@r{]}
--H -P @gol
+-H -P
-U@var{macro} -cpp -dD -dI -dM -dN -dU -fworking-directory
--imultilib @var{dir} @gol
+-imultilib @var{dir}
-iprefix @var{file} -iquote -isysroot @var{dir} -isystem @var{dir} -nocpp
--nostdinc @gol
+-nostdinc
-undef
}
@item Error and Warning Options
@xref{Error and Warning Options,,Options to request or suppress errors
and warnings}.
-@gccoptlist{-Waliasing -Wall -Wampersand -Warray-bounds @gol
--Wc-binding-type -Wcharacter-truncation -Wconversion @gol
--Wdo-subscript -Wfunction-elimination -Wimplicit-interface @gol
--Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only @gol
--Wintrinsics-std -Wline-truncation -Wno-align-commons @gol
--Wno-overwrite-recursive -Wno-tabs -Wreal-q-constant -Wsurprising @gol
--Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all @gol
--Wfrontend-loop-interchange -Wtarget-lifetime -fmax-errors=@var{n} @gol
--fsyntax-only -pedantic @gol
--pedantic-errors @gol
+@gccoptlist{-Waliasing -Wall -Wampersand -Warray-bounds
+-Wc-binding-type -Wcharacter-truncation -Wconversion
+-Wdo-subscript -Wfunction-elimination -Wimplicit-interface
+-Wimplicit-procedure -Wintrinsic-shadow -Wuse-without-only
+-Wintrinsics-std -Wline-truncation -Wno-align-commons
+-Wno-overwrite-recursive -Wno-tabs -Wreal-q-constant -Wsurprising
+-Wunderflow -Wunused-parameter -Wrealloc-lhs -Wrealloc-lhs-all
+-Wfrontend-loop-interchange -Wtarget-lifetime -fmax-errors=@var{n}
+-fsyntax-only -pedantic
+-pedantic-errors
}
@item Debugging Options
@xref{Debugging Options,,Options for debugging your program or GNU Fortran}.
-@gccoptlist{-fbacktrace -fdump-fortran-optimized -fdump-fortran-original @gol
--fdebug-aux-vars -fdump-fortran-global -fdump-parse-tree -ffpe-trap=@var{list} @gol
+@gccoptlist{-fbacktrace -fdump-fortran-optimized -fdump-fortran-original
+-fdebug-aux-vars -fdump-fortran-global -fdump-parse-tree -ffpe-trap=@var{list}
-ffpe-summary=@var{list}
}
@@ -174,7 +174,7 @@ and warnings}.
@item Runtime Options
@xref{Runtime Options,,Options for influencing runtime behavior}.
-@gccoptlist{-fconvert=@var{conversion} -fmax-subrecord-length=@var{length} @gol
+@gccoptlist{-fconvert=@var{conversion} -fmax-subrecord-length=@var{length}
-frecord-marker=@var{length} -fsign-zero
}
@@ -184,20 +184,20 @@ and warnings}.
@item Code Generation Options
@xref{Code Gen Options,,Options for code generation conventions}.
-@gccoptlist{-faggressive-function-elimination -fblas-matmul-limit=@var{n} @gol
--fbounds-check -ftail-call-workaround -ftail-call-workaround=@var{n} @gol
--fcheck-array-temporaries @gol
--fcheck=@var{<all|array-temps|bits|bounds|do|mem|pointer|recursion>} @gol
--fcoarray=@var{<none|single|lib>} -fexternal-blas -ff2c @gol
--ffrontend-loop-interchange -ffrontend-optimize @gol
--finit-character=@var{n} -finit-integer=@var{n} -finit-local-zero @gol
--finit-derived -finit-logical=@var{<true|false>} @gol
+@gccoptlist{-faggressive-function-elimination -fblas-matmul-limit=@var{n}
+-fbounds-check -ftail-call-workaround -ftail-call-workaround=@var{n}
+-fcheck-array-temporaries
+-fcheck=@var{<all|array-temps|bits|bounds|do|mem|pointer|recursion>}
+-fcoarray=@var{<none|single|lib>} -fexternal-blas -ff2c
+-ffrontend-loop-interchange -ffrontend-optimize
+-finit-character=@var{n} -finit-integer=@var{n} -finit-local-zero
+-finit-derived -finit-logical=@var{<true|false>}
-finit-real=@var{<zero|inf|-inf|nan|snan>}
--finline-matmul-limit=@var{n} @gol
--finline-arg-packing -fmax-array-constructor=@var{n} @gol
--fmax-stack-var-size=@var{n} -fno-align-commons -fno-automatic @gol
--fno-protect-parens -fno-underscoring -fsecond-underscore @gol
--fpack-derived -frealloc-lhs -frecursive -frepack-arrays @gol
+-finline-matmul-limit=@var{n}
+-finline-arg-packing -fmax-array-constructor=@var{n}
+-fmax-stack-var-size=@var{n} -fno-align-commons -fno-automatic
+-fno-protect-parens -fno-underscoring -fsecond-underscore
+-fpack-derived -frealloc-lhs -frecursive -frepack-arrays
-fshort-enums -fstack-arrays
}
@end table
@@ -212,20 +212,20 @@ The following options control the details of the Fortran dialect
accepted by the compiler:
@table @gcctabopt
-@item -ffree-form
-@itemx -ffixed-form
@opindex @code{ffree-form}
@opindex @code{ffixed-form}
@cindex options, Fortran dialect
@cindex file format, free
@cindex file format, fixed
+@item -ffree-form
+@itemx -ffixed-form
Specify the layout used by the source file. The free form layout
was introduced in Fortran 90. Fixed form was traditionally used in
older Fortran programs. When neither option is specified, the source
form is determined by the file extension.
-@item -fall-intrinsics
@opindex @code{fall-intrinsics}
+@item -fall-intrinsics
This option causes all intrinsic procedures (including the GNU-specific
extensions) to be accepted. This can be useful with @option{-std=} to
force standard-compliance but get access to the full range of intrinsics
@@ -233,8 +233,8 @@ available with @command{gfortran}. As a consequence, @option{-Wintrinsics-std}
will be ignored and no user-defined procedure with the same name as any
intrinsic will be called except when it is explicitly declared @code{EXTERNAL}.
-@item -fallow-argument-mismatch
@opindex @code{fallow-argument-mismatch}
+@item -fallow-argument-mismatch
Some code contains calls to external procedures with mismatches
between the calls and the procedure definition, or with mismatches
between different calls. Such code is non-conforming, and will usually
@@ -248,25 +248,25 @@ Using this option is @emph{strongly} discouraged. It is possible to
provide standard-conforming code which allows different types of
arguments by using an explicit interface and @code{TYPE(*)}.
-@item -fallow-invalid-boz
@opindex @code{allow-invalid-boz}
+@item -fallow-invalid-boz
A BOZ literal constant can occur in a limited number of contexts in
standard conforming Fortran. This option degrades an error condition
to a warning, and allows a BOZ literal constant to appear where the
Fortran standard would otherwise prohibit its use.
-@item -fd-lines-as-code
-@itemx -fd-lines-as-comments
@opindex @code{fd-lines-as-code}
@opindex @code{fd-lines-as-comments}
+@item -fd-lines-as-code
+@itemx -fd-lines-as-comments
Enable special treatment for lines beginning with @code{d} or @code{D}
in fixed form sources. If the @option{-fd-lines-as-code} option is
given they are treated as if the first column contained a blank. If the
@option{-fd-lines-as-comments} option is given, they are treated as
comment lines.
-@item -fdec
@opindex @code{fdec}
+@item -fdec
DEC compatibility mode. Enables extensions and other features that mimic
the default behavior of older compilers (such as DEC).
These features are non-standard and should be avoided at all costs.
@@ -282,63 +282,63 @@ Other flags enabled by this switch are:
If @option{-fd-lines-as-code}/@option{-fd-lines-as-comments} are unset, then
@option{-fdec} also sets @option{-fd-lines-as-comments}.
-@item -fdec-char-conversions
@opindex @code{fdec-char-conversions}
+@item -fdec-char-conversions
Enable the use of character literals in assignments and @code{DATA} statements
for non-character variables.
-@item -fdec-structure
@opindex @code{fdec-structure}
+@item -fdec-structure
Enable DEC @code{STRUCTURE} and @code{RECORD} as well as @code{UNION},
@code{MAP}, and dot ('.') as a member separator (in addition to '%'). This is
provided for compatibility only; Fortran 90 derived types should be used
instead where possible.
-@item -fdec-intrinsic-ints
@opindex @code{fdec-intrinsic-ints}
+@item -fdec-intrinsic-ints
Enable B/I/J/K kind variants of existing integer functions (e.g. BIAND, IIAND,
JIAND, etc...). For a complete list of intrinsics see the full documentation.
-@item -fdec-math
@opindex @code{fdec-math}
+@item -fdec-math
Enable legacy math intrinsics such as COTAN and degree-valued trigonometric
functions (e.g. TAND, ATAND, etc...) for compatability with older code.
-@item -fdec-static
@opindex @code{fdec-static}
+@item -fdec-static
Enable DEC-style STATIC and AUTOMATIC attributes to explicitly specify
the storage of variables and other objects.
-@item -fdec-include
@opindex @code{fdec-include}
+@item -fdec-include
Enable parsing of INCLUDE as a statement in addition to parsing it as
INCLUDE line. When parsed as INCLUDE statement, INCLUDE does not have to
be on a single line and can use line continuations.
-@item -fdec-format-defaults
@opindex @code{fdec-format-defaults}
+@item -fdec-format-defaults
Enable format specifiers F, G and I to be used without width specifiers,
default widths will be used instead.
-@item -fdec-blank-format-item
@opindex @code{fdec-blank-format-item}
+@item -fdec-blank-format-item
Enable a blank format item at the end of a format specification i.e. nothing
following the final comma.
-@item -fdollar-ok
@opindex @code{fdollar-ok}
@cindex @code{$}
@cindex symbol names
@cindex character set
+@item -fdollar-ok
Allow @samp{$} as a valid non-first character in a symbol name. Symbols
that start with @samp{$} are rejected since it is unclear which rules to
apply to implicit typing as different vendors implement different rules.
Using @samp{$} in @code{IMPLICIT} statements is also rejected.
-@item -fbackslash
@opindex @code{backslash}
@cindex backslash
@cindex escape characters
+@item -fbackslash
Change the interpretation of backslashes in string literals from a single
backslash character to ``C-style'' escape characters. The following
combinations are expanded @code{\a}, @code{\b}, @code{\f}, @code{\n},
@@ -351,17 +351,17 @@ translated into the Unicode characters corresponding to the specified code
points. All other combinations of a character preceded by \ are
unexpanded.
-@item -fmodule-private
@opindex @code{fmodule-private}
@cindex module entities
@cindex private
+@item -fmodule-private
Set the default accessibility of module entities to @code{PRIVATE}.
Use-associated entities will not be accessible unless they are explicitly
declared as @code{PUBLIC}.
-@item -ffixed-line-length-@var{n}
@opindex @code{ffixed-line-length-}@var{n}
@cindex file format, fixed
+@item -ffixed-line-length-@var{n}
Set column after which characters are ignored in typical fixed-form
lines in the source file, and, unless @code{-fno-pad-source}, through which
spaces are assumed (as if padded to that length) after the ends of short
@@ -376,8 +376,8 @@ to them to fill out the line.
@option{-ffixed-line-length-0} means the same thing as
@option{-ffixed-line-length-none}.
-@item -fno-pad-source
@opindex @code{fpad-source}
+@item -fno-pad-source
By default fixed-form lines have spaces assumed (as if padded to that length)
after the ends of short fixed-form lines. This is not done either if
@option{-ffixed-line-length-0}, @option{-ffixed-line-length-none} or
@@ -385,34 +385,34 @@ if @option{-fno-pad-source} option is used. With any of those options
continued character constants never have implicit spaces appended
to them to fill out the line.
-@item -ffree-line-length-@var{n}
@opindex @code{ffree-line-length-}@var{n}
@cindex file format, free
+@item -ffree-line-length-@var{n}
Set column after which characters are ignored in typical free-form
lines in the source file. The default value is 132.
@var{n} may be @samp{none}, meaning that the entire line is meaningful.
@option{-ffree-line-length-0} means the same thing as
@option{-ffree-line-length-none}.
-@item -fmax-identifier-length=@var{n}
@opindex @code{fmax-identifier-length=}@var{n}
+@item -fmax-identifier-length=@var{n}
Specify the maximum allowed identifier length. Typical values are
31 (Fortran 95) and 63 (Fortran 2003 and later).
-@item -fimplicit-none
@opindex @code{fimplicit-none}
+@item -fimplicit-none
Specify that no implicit typing is allowed, unless overridden by explicit
@code{IMPLICIT} statements. This is the equivalent of adding
@code{implicit none} to the start of every procedure.
-@item -fcray-pointer
@opindex @code{fcray-pointer}
+@item -fcray-pointer
Enable the Cray pointer extension, which provides C-like pointer
functionality.
-@item -fopenacc
@opindex @code{fopenacc}
@cindex OpenACC
+@item -fopenacc
Enable the OpenACC extensions. This includes OpenACC @code{!$acc}
directives in free form and @code{c$acc}, @code{*$acc} and
@code{!$acc} directives in fixed form, @code{!$} conditional
@@ -420,9 +420,9 @@ compilation sentinels in free form and @code{c$}, @code{*$} and
@code{!$} sentinels in fixed form, and when linking arranges for the
OpenACC runtime library to be linked in.
-@item -fopenmp
@opindex @code{fopenmp}
@cindex OpenMP
+@item -fopenmp
Enable the OpenMP extensions. This includes OpenMP @code{!$omp} directives
in free form
and @code{c$omp}, @code{*$omp} and @code{!$omp} directives in fixed form,
@@ -431,8 +431,8 @@ and @code{c$}, @code{*$} and @code{!$} sentinels in fixed form,
and when linking arranges for the OpenMP runtime library to be linked
in. The option @option{-fopenmp} implies @option{-frecursive}.
-@item -fno-range-check
@opindex @code{frange-check}
+@item -fno-range-check
Disable range checking on results of simplification of constant
expressions during compilation. For example, GNU Fortran will give
an error at compile time when simplifying @code{a = 1. / 0}.
@@ -445,15 +445,15 @@ Similarly, @code{DATA i/Z'FFFFFFFF'/} will result in an integer overflow
on most systems, but with @option{-fno-range-check} the value will
``wrap around'' and @code{i} will be initialized to @math{-1} instead.
-@item -fdefault-integer-8
@opindex @code{fdefault-integer-8}
+@item -fdefault-integer-8
Set the default integer and logical types to an 8 byte wide type. This option
also affects the kind of integer constants like @code{42}. Unlike
@option{-finteger-4-integer-8}, it does not promote variables with explicit
kind declaration.
-@item -fdefault-real-8
@opindex @code{fdefault-real-8}
+@item -fdefault-real-8
Set the default real type to an 8 byte wide type. This option also affects
the kind of non-double real constants like @code{1.0}. This option promotes
the default width of @code{DOUBLE PRECISION} and double real constants
@@ -463,8 +463,8 @@ and double real constants are not promoted. Unlike @option{-freal-4-real-8},
@code{fdefault-real-8} does not promote variables with explicit kind
declarations.
-@item -fdefault-real-10
@opindex @code{fdefault-real-10}
+@item -fdefault-real-10
Set the default real type to an 10 byte wide type. This option also affects
the kind of non-double real constants like @code{1.0}. This option promotes
the default width of @code{DOUBLE PRECISION} and double real constants
@@ -474,8 +474,8 @@ and double real constants are not promoted. Unlike @option{-freal-4-real-10},
@code{fdefault-real-10} does not promote variables with explicit kind
declarations.
-@item -fdefault-real-16
@opindex @code{fdefault-real-16}
+@item -fdefault-real-16
Set the default real type to an 16 byte wide type. This option also affects
the kind of non-double real constants like @code{1.0}. This option promotes
the default width of @code{DOUBLE PRECISION} and double real constants
@@ -485,8 +485,8 @@ and double real constants are not promoted. Unlike @option{-freal-4-real-16},
@code{fdefault-real-16} does not promote variables with explicit kind
declarations.
-@item -fdefault-double-8
@opindex @code{fdefault-double-8}
+@item -fdefault-double-8
Set the @code{DOUBLE PRECISION} type and double real constants
like @code{1.d0} to an 8 byte wide type. Do nothing if this
is already the default. This option prevents @option{-fdefault-real-8},
@@ -494,8 +494,8 @@ is already the default. This option prevents @option{-fdefault-real-8},
from promoting @code{DOUBLE PRECISION} and double real constants like
@code{1.d0} to 16 bytes.
-@item -finteger-4-integer-8
@opindex @code{finteger-4-integer-8}
+@item -finteger-4-integer-8
Promote all @code{INTEGER(KIND=4)} entities to an @code{INTEGER(KIND=8)}
entities. If @code{KIND=8} is unavailable, then an error will be issued.
This option should be used with care and may not be suitable for your codes.
@@ -505,12 +505,6 @@ BOZ literal constant conversion, and I/O. Inspection of the intermediate
representation of the translated Fortran code, produced by
@option{-fdump-tree-original}, is suggested.
-@item -freal-4-real-8
-@itemx -freal-4-real-10
-@itemx -freal-4-real-16
-@itemx -freal-8-real-4
-@itemx -freal-8-real-10
-@itemx -freal-8-real-16
@opindex @code{freal-4-real-8}
@opindex @code{freal-4-real-10}
@opindex @code{freal-4-real-16}
@@ -518,6 +512,12 @@ representation of the translated Fortran code, produced by
@opindex @code{freal-8-real-10}
@opindex @code{freal-8-real-16}
@cindex options, real kind type promotion
+@item -freal-4-real-8
+@itemx -freal-4-real-10
+@itemx -freal-4-real-16
+@itemx -freal-8-real-4
+@itemx -freal-8-real-10
+@itemx -freal-8-real-16
Promote all @code{REAL(KIND=M)} entities to @code{REAL(KIND=N)} entities.
If @code{REAL(KIND=N)} is unavailable, then an error will be issued.
The @code{-freal-4-} flags also affect the default real kind and the
@@ -539,8 +539,8 @@ when passing a value to the @code{kind=} dummy argument. Inspection of the
intermediate representation of the translated Fortran code, produced by
@option{-fdump-fortran-original} or @option{-fdump-tree-original}, is suggested.
-@item -std=@var{std}
@opindex @code{std=}@var{std} option
+@item -std=@var{std}
Specify the standard to which the program is expected to conform,
which may be one of @samp{f95}, @samp{f2003}, @samp{f2008},
@samp{f2018}, @samp{gnu}, or @samp{legacy}. The default value for
@@ -559,8 +559,8 @@ standards. The deprecated option @samp{-std=f2008ts} acts as an alias for
@samp{-std=f2018}. It is only present for backwards compatibility with
earlier gfortran versions and should not be used any more.
-@item -ftest-forall-temp
@opindex @code{ftest-forall-temp}
+@item -ftest-forall-temp
Enhance test coverage by forcing most forall assignments to use temporary.
@end table
@@ -612,12 +612,12 @@ to preprocess such files (@uref{http://www.daniellnagle.com/coco.html}).
The following options control preprocessing of Fortran code:
@table @gcctabopt
-@item -cpp
-@itemx -nocpp
@opindex @code{cpp}
@opindex @code{fpp}
@cindex preprocessor, enable
@cindex preprocessor, disable
+@item -cpp
+@itemx -nocpp
Enable preprocessing. The preprocessor is automatically invoked if
the file extension is @file{.fpp}, @file{.FPP}, @file{.F}, @file{.FOR},
@file{.FTN}, @file{.F90}, @file{.F95}, @file{.F03} or @file{.F08}. Use
@@ -632,10 +632,10 @@ preprocessed output as well, so it might be advisable to use the
@option{-ffree-line-length-none} or @option{-ffixed-line-length-none}
options.
-@item -dM
@opindex @code{dM}
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dM
Instead of the normal output, generate a list of @code{'#define'}
directives for all the macros defined during the execution of the
preprocessor, including predefined macros. This gives you a way
@@ -646,40 +646,40 @@ Assuming you have no file @file{foo.f90}, the command
@end smallexample
will show all the predefined macros.
-@item -dD
@opindex @code{dD}
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dD
Like @option{-dM} except in two respects: it does not include the
predefined macros, and it outputs both the @code{#define} directives
and the result of preprocessing. Both kinds of output go to the
standard output file.
-@item -dN
@opindex @code{dN}
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dN
Like @option{-dD}, but emit only the macro names, not their expansions.
-@item -dU
@opindex @code{dU}
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dU
Like @option{dD} except that only macros that are expanded, or whose
definedness is tested in preprocessor directives, are output; the
output is delayed until the use or test of the macro; and @code{'#undef'}
directives are also output for macros tested but undefined at the time.
-@item -dI
@opindex @code{dI}
@cindex preprocessor, debugging
@cindex debugging, preprocessor
+@item -dI
Output @code{'#include'} directives in addition to the result
of preprocessing.
-@item -fworking-directory
@opindex @code{fworking-directory}
@cindex preprocessor, working directory
+@item -fworking-directory
Enable generation of linemarkers in the preprocessor output that will
let the compiler know the current working directory at the time of
preprocessing. When this option is enabled, the preprocessor will emit,
@@ -693,46 +693,46 @@ but this can be inhibited with the negated form
in the command line, this option has no effect, since no @code{#line}
directives are emitted whatsoever.
-@item -idirafter @var{dir}
@opindex @code{idirafter @var{dir}}
@cindex preprocessing, include path
+@item -idirafter @var{dir}
Search @var{dir} for include files, but do it after all directories
specified with @option{-I} and the standard system directories have
been exhausted. @var{dir} is treated as a system include directory.
If dir begins with @code{=}, then the @code{=} will be replaced by
the sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
-@item -imultilib @var{dir}
@opindex @code{imultilib @var{dir}}
@cindex preprocessing, include path
+@item -imultilib @var{dir}
Use @var{dir} as a subdirectory of the directory containing target-specific
C++ headers.
-@item -iprefix @var{prefix}
@opindex @code{iprefix @var{prefix}}
@cindex preprocessing, include path
+@item -iprefix @var{prefix}
Specify @var{prefix} as the prefix for subsequent @option{-iwithprefix}
options. If the @var{prefix} represents a directory, you should include
the final @code{'/'}.
-@item -isysroot @var{dir}
@opindex @code{isysroot @var{dir}}
@cindex preprocessing, include path
+@item -isysroot @var{dir}
This option is like the @option{--sysroot} option, but applies only to
header files. See the @option{--sysroot} option for more information.
-@item -iquote @var{dir}
@opindex @code{iquote @var{dir}}
@cindex preprocessing, include path
+@item -iquote @var{dir}
Search @var{dir} only for header files requested with @code{#include "file"};
they are not searched for @code{#include <file>}, before all directories
specified by @option{-I} and before the standard system directories. If
@var{dir} begins with @code{=}, then the @code{=} will be replaced by the
sysroot prefix; see @option{--sysroot} and @option{-isysroot}.
-@item -isystem @var{dir}
@opindex @code{isystem @var{dir}}
@cindex preprocessing, include path
+@item -isystem @var{dir}
Search @var{dir} for header files, after all directories specified by
@option{-I} but before the standard system directories. Mark it as a
system directory, so that it gets the same special treatment as is
@@ -740,32 +740,32 @@ applied to the standard system directories. If @var{dir} begins with
@code{=}, then the @code{=} will be replaced by the sysroot prefix;
see @option{--sysroot} and @option{-isysroot}.
-@item -nostdinc
@opindex @code{nostdinc}
+@item -nostdinc
Do not search the standard system directories for header files. Only
the directories you have specified with @option{-I} options (and the
directory of the current file, if appropriate) are searched.
-@item -undef
@opindex @code{undef}
+@item -undef
Do not predefine any system-specific or GCC-specific macros.
The standard predefined macros remain defined.
-@item -A@var{predicate}=@var{answer}
@opindex @code{A@var{predicate}=@var{answer}}
@cindex preprocessing, assertion
+@item -A@var{predicate}=@var{answer}
Make an assertion with the predicate @var{predicate} and answer @var{answer}.
This form is preferred to the older form -A predicate(answer), which is still
supported, because it does not use shell special characters.
-@item -A-@var{predicate}=@var{answer}
@opindex @code{A-@var{predicate}=@var{answer}}
@cindex preprocessing, assertion
+@item -A-@var{predicate}=@var{answer}
Cancel an assertion with the predicate @var{predicate} and answer @var{answer}.
-@item -C
@opindex @code{C}
@cindex preprocessing, keep comments
+@item -C
Do not discard comments. All comments are passed through to the output
file, except for comments in processed directives, which are deleted
along with the directive.
@@ -779,9 +779,9 @@ token on the line is no longer a @code{'#'}.
Warning: this currently handles C-Style comments only. The preprocessor
does not yet recognize Fortran-style comments.
-@item -CC
@opindex @code{CC}
@cindex preprocessing, keep comments
+@item -CC
Do not discard comments, including during macro expansion. This is like
@option{-C}, except that comments contained within macros are also passed
through to the output file where the macro is expanded.
@@ -795,14 +795,14 @@ is generally used to support lint comments.
Warning: this currently handles C- and C++-Style comments only. The
preprocessor does not yet recognize Fortran-style comments.
-@item -D@var{name}
@opindex @code{D@var{name}}
@cindex preprocessing, define macros
+@item -D@var{name}
Predefine name as a macro, with definition @code{1}.
-@item -D@var{name}=@var{definition}
@opindex @code{D@var{name}=@var{definition}}
@cindex preprocessing, define macros
+@item -D@var{name}=@var{definition}
The contents of @var{definition} are tokenized and processed as if they
appeared during translation phase three in a @code{'#define'} directive.
In particular, the definition will be truncated by embedded newline
@@ -822,23 +822,23 @@ works.
given on the command line. All -imacros file and -include file options
are processed after all -D and -U options.
-@item -H
@opindex @code{H}
+@item -H
Print the name of each header file used, in addition to other normal
activities. Each name is indented to show how deep in the @code{'#include'}
stack it is.
-@item -P
@opindex @code{P}
@cindex preprocessing, no linemarkers
+@item -P
Inhibit generation of linemarkers in the output from the preprocessor.
This might be useful when running the preprocessor on something that
is not C code, and will be sent to a program which might be confused
by the linemarkers.
-@item -U@var{name}
@opindex @code{U@var{name}}
@cindex preprocessing, undefine macros
+@item -U@var{name}
Cancel any previous definition of @var{name}, either built in or provided
with a @option{-D} option.
@end table
@@ -874,25 +874,25 @@ These options control the amount and kinds of errors and warnings produced
by GNU Fortran:
@table @gcctabopt
-@item -fmax-errors=@var{n}
@opindex @code{fmax-errors=}@var{n}
@cindex errors, limiting
+@item -fmax-errors=@var{n}
Limits the maximum number of error messages to @var{n}, at which point
GNU Fortran bails out rather than attempting to continue processing the
source code. If @var{n} is 0, there is no limit on the number of error
messages produced.
-@item -fsyntax-only
@opindex @code{fsyntax-only}
@cindex syntax checking
+@item -fsyntax-only
Check the code for syntax errors, but do not actually compile it. This
will generate module files for each module present in the code, but no
other output file.
-@item -Wpedantic
-@itemx -pedantic
@opindex @code{pedantic}
@opindex @code{Wpedantic}
+@item -Wpedantic
+@itemx -pedantic
Issue warnings for uses of extensions to Fortran.
@option{-pedantic} also applies to C-language constructs where they
occur in GNU Fortran source files, such as use of @samp{\e} in a
@@ -912,15 +912,15 @@ However, improvements to GNU Fortran in this area are welcome.
This should be used in conjunction with @option{-std=f95},
@option{-std=f2003}, @option{-std=f2008} or @option{-std=f2018}.
-@item -pedantic-errors
@opindex @code{pedantic-errors}
+@item -pedantic-errors
Like @option{-pedantic}, except that errors are produced rather than
warnings.
-@item -Wall
@opindex @code{Wall}
@cindex all warnings
@cindex warnings, all
+@item -Wall
Enables commonly used warning options pertaining to usage that
we recommend avoiding and that we believe are easy to avoid.
This currently includes @option{-Waliasing}, @option{-Wampersand},
@@ -930,10 +930,10 @@ This currently includes @option{-Waliasing}, @option{-Wampersand},
@option{-Winteger-division}, @option{-Wreal-q-constant}, @option{-Wunused}
and @option{-Wundefined-do-loop}.
-@item -Waliasing
@opindex @code{Waliasing}
@cindex aliasing
@cindex warnings, aliasing
+@item -Waliasing
Warn about possible aliasing of dummy arguments. Specifically, it warns
if the same actual argument is associated with a dummy argument with
@code{INTENT(IN)} and a dummy argument with @code{INTENT(OUT)} in a call
@@ -952,10 +952,10 @@ The following example will trigger the warning.
call bar(a,a)
@end smallexample
-@item -Wampersand
@opindex @code{Wampersand}
@cindex warnings, ampersand
@cindex @code{&}
+@item -Wampersand
Warn about missing ampersand in continued character constants. The
warning is given with @option{-Wampersand}, @option{-pedantic},
@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008} and
@@ -964,112 +964,112 @@ character constant, GNU Fortran assumes continuation at the first
non-comment, non-whitespace character after the ampersand that
initiated the continuation.
-@item -Warray-temporaries
@opindex @code{Warray-temporaries}
@cindex warnings, array temporaries
+@item -Warray-temporaries
Warn about array temporaries generated by the compiler. The information
generated by this warning is sometimes useful in optimization, in order to
avoid such temporaries.
-@item -Wc-binding-type
@opindex @code{Wc-binding-type}
@cindex warning, C binding type
+@item -Wc-binding-type
Warn if the a variable might not be C interoperable. In particular, warn if
the variable has been declared using an intrinsic type with default kind
instead of using a kind parameter defined for C interoperability in the
intrinsic @code{ISO_C_Binding} module. This option is implied by
@option{-Wall}.
-@item -Wcharacter-truncation
@opindex @code{Wcharacter-truncation}
@cindex warnings, character truncation
+@item -Wcharacter-truncation
Warn when a character assignment will truncate the assigned string.
-@item -Wline-truncation
@opindex @code{Wline-truncation}
@cindex warnings, line truncation
+@item -Wline-truncation
Warn when a source code line will be truncated. This option is
implied by @option{-Wall}. For free-form source code, the default is
@option{-Werror=line-truncation} such that truncations are reported as
error.
-@item -Wconversion
@opindex @code{Wconversion}
@cindex warnings, conversion
@cindex conversion
+@item -Wconversion
Warn about implicit conversions that are likely to change the value of
the expression after conversion. Implied by @option{-Wall}.
-@item -Wconversion-extra
@opindex @code{Wconversion-extra}
@cindex warnings, conversion
@cindex conversion
+@item -Wconversion-extra
Warn about implicit conversions between different types and kinds. This
option does @emph{not} imply @option{-Wconversion}.
-@item -Wextra
@opindex @code{Wextra}
@cindex extra warnings
@cindex warnings, extra
+@item -Wextra
Enables some warning options for usages of language features which
may be problematic. This currently includes @option{-Wcompare-reals},
@option{-Wunused-parameter} and @option{-Wdo-subscript}.
-@item -Wfrontend-loop-interchange
@opindex @code{Wfrontend-loop-interchange}
@cindex warnings, loop interchange
@cindex loop interchange, warning
+@item -Wfrontend-loop-interchange
Warn when using @option{-ffrontend-loop-interchange} for performing loop
interchanges.
-@item -Wimplicit-interface
@opindex @code{Wimplicit-interface}
@cindex warnings, implicit interface
+@item -Wimplicit-interface
Warn if a procedure is called without an explicit interface.
Note this only checks that an explicit interface is present. It does not
check that the declared interfaces are consistent across program units.
-@item -Wimplicit-procedure
@opindex @code{Wimplicit-procedure}
@cindex warnings, implicit procedure
+@item -Wimplicit-procedure
Warn if a procedure is called that has neither an explicit interface
nor has been declared as @code{EXTERNAL}.
-@item -Winteger-division
@opindex @code{Winteger-division}
@cindex warnings, integer division
@cindex warnings, division of integers
+@item -Winteger-division
Warn if a constant integer division truncates its result.
As an example, 3/5 evaluates to 0.
-@item -Wintrinsics-std
@opindex @code{Wintrinsics-std}
@cindex warnings, non-standard intrinsics
@cindex warnings, intrinsics of other standards
+@item -Wintrinsics-std
Warn if @command{gfortran} finds a procedure named like an intrinsic not
available in the currently selected standard (with @option{-std}) and treats
it as @code{EXTERNAL} procedure because of this. @option{-fall-intrinsics} can
be used to never trigger this behavior and always link to the intrinsic
regardless of the selected standard.
-@item -Wno-overwrite-recursive
@opindex @code{Woverwrite-recursive}
@cindex warnings, overwrite recursive
+@item -Wno-overwrite-recursive
Do not warn when @option{-fno-automatic} is used with @option{-frecursive}. Recursion
will be broken if the relevant local variables do not have the attribute
@code{AUTOMATIC} explicitly declared. This option can be used to suppress the warning
when it is known that recursion is not broken. Useful for build environments that use
@option{-Werror}.
-@item -Wreal-q-constant
@opindex @code{Wreal-q-constant}
@cindex warnings, @code{q} exponent-letter
+@item -Wreal-q-constant
Produce a warning if a real-literal-constant contains a @code{q}
exponent-letter.
-@item -Wsurprising
@opindex @code{Wsurprising}
@cindex warnings, suspicious code
+@item -Wsurprising
Produce a warning when ``suspicious'' code constructs are encountered.
While technically legal these usually indicate that an error has been made.
@@ -1099,10 +1099,10 @@ vendor-extension sentinel is encountered. (The equivalent @code{ompx},
used in free-form source code, is diagnosed by default.)
@end itemize
-@item -Wtabs
@opindex @code{Wtabs}
@cindex warnings, tabs
@cindex tabulators
+@item -Wtabs
By default, tabs are accepted as whitespace, but tabs are not members
of the Fortran Character Set. For continuation lines, a tab followed
by a digit between 1 and 9 is supported. @option{-Wtabs} will cause a
@@ -1111,47 +1111,47 @@ active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
@option{-std=f2008}, @option{-std=f2018} and
@option{-Wall}.
-@item -Wundefined-do-loop
@opindex @code{Wundefined-do-loop}
@cindex warnings, undefined do loop
+@item -Wundefined-do-loop
Warn if a DO loop with step either 1 or -1 yields an underflow or an overflow
during iteration of an induction variable of the loop.
This option is implied by @option{-Wall}.
-@item -Wunderflow
@opindex @code{Wunderflow}
@cindex warnings, underflow
@cindex underflow
+@item -Wunderflow
Produce a warning when numerical constant expressions are
encountered, which yield an UNDERFLOW during compilation. Enabled by default.
-@item -Wintrinsic-shadow
@opindex @code{Wintrinsic-shadow}
@cindex warnings, intrinsic
@cindex intrinsic
+@item -Wintrinsic-shadow
Warn if a user-defined procedure or module procedure has the same name as an
intrinsic; in this case, an explicit interface or @code{EXTERNAL} or
@code{INTRINSIC} declaration might be needed to get calls later resolved to
the desired intrinsic/procedure. This option is implied by @option{-Wall}.
-@item -Wuse-without-only
@opindex @code{Wuse-without-only}
@cindex warnings, use statements
@cindex intrinsic
+@item -Wuse-without-only
Warn if a @code{USE} statement has no @code{ONLY} qualifier and
thus implicitly imports all public entities of the used module.
-@item -Wunused-dummy-argument
@opindex @code{Wunused-dummy-argument}
@cindex warnings, unused dummy argument
@cindex unused dummy argument
@cindex dummy argument, unused
+@item -Wunused-dummy-argument
Warn about unused dummy arguments. This option is implied by @option{-Wall}.
-@item -Wunused-parameter
@opindex @code{Wunused-parameter}
@cindex warnings, unused parameter
@cindex unused parameter
+@item -Wunused-parameter
Contrary to @command{gcc}'s meaning of @option{-Wunused-parameter},
@command{gfortran}'s implementation of this option does not warn
about unused dummy arguments (see @option{-Wunused-dummy-argument}),
@@ -1159,25 +1159,25 @@ but about unused @code{PARAMETER} values. @option{-Wunused-parameter}
is implied by @option{-Wextra} if also @option{-Wunused} or
@option{-Wall} is used.
-@item -Walign-commons
@opindex @code{Walign-commons}
@cindex warnings, alignment of @code{COMMON} blocks
@cindex alignment of @code{COMMON} blocks
+@item -Walign-commons
By default, @command{gfortran} warns about any occasion of variables being
padded for proper alignment inside a @code{COMMON} block. This warning can be turned
off via @option{-Wno-align-commons}. See also @option{-falign-commons}.
-@item -Wfunction-elimination
@opindex @code{Wfunction-elimination}
@cindex function elimination
@cindex warnings, function elimination
+@item -Wfunction-elimination
Warn if any calls to impure functions are eliminated by the optimizations
enabled by the @option{-ffrontend-optimize} option.
This option is implied by @option{-Wextra}.
-@item -Wrealloc-lhs
@opindex @code{Wrealloc-lhs}
@cindex Reallocate the LHS in assignments, notification
+@item -Wrealloc-lhs
Warn when the compiler might insert code to for allocation or reallocation of
an allocatable array variable of intrinsic type in intrinsic assignments. In
hot loops, the Fortran 2003 reallocation feature may reduce the performance.
@@ -1188,28 +1188,28 @@ is shown, even if the compiler will optimize reallocation checks away. For
instance, when the right-hand side contains the same variable multiplied by
a scalar. See also @option{-frealloc-lhs}.
-@item -Wrealloc-lhs-all
@opindex @code{Wrealloc-lhs-all}
+@item -Wrealloc-lhs-all
Warn when the compiler inserts code to for allocation or reallocation of an
allocatable variable; this includes scalars and derived types.
-@item -Wcompare-reals
@opindex @code{Wcompare-reals}
+@item -Wcompare-reals
Warn when comparing real or complex types for equality or inequality.
This option is implied by @option{-Wextra}.
-@item -Wtarget-lifetime
@opindex @code{Wtargt-lifetime}
+@item -Wtarget-lifetime
Warn if the pointer in a pointer assignment might be longer than the its
target. This option is implied by @option{-Wall}.
-@item -Wzerotrip
@opindex @code{Wzerotrip}
+@item -Wzerotrip
Warn if a @code{DO} loop is known to execute zero times at compile
time. This option is implied by @option{-Wall}.
-@item -Wdo-subscript
@opindex @code{Wdo-subscript}
+@item -Wdo-subscript
Warn if an array subscript inside a DO loop could lead to an
out-of-bounds access even if the compiler cannot prove that the
statement is actually executed, in cases like
@@ -1223,9 +1223,9 @@ statement is actually executed, in cases like
@end smallexample
This option is implied by @option{-Wextra}.
-@item -Werror
@opindex @code{Werror}
@cindex warnings, to errors
+@item -Werror
Turns all warnings into errors.
@end table
@@ -1245,8 +1245,8 @@ GNU Fortran has various special options that are used for debugging
either your program or the GNU Fortran compiler.
@table @gcctabopt
-@item -fdump-fortran-original
@opindex @code{fdump-fortran-original}
+@item -fdump-fortran-original
Output the internal parse tree after translating the source program
into internal representation. This option is mostly useful for
debugging the GNU Fortran compiler itself. The output generated by
@@ -1254,16 +1254,16 @@ this option might change between releases. This option may also
generate internal compiler errors for features which have only
recently been added.
-@item -fdump-fortran-optimized
@opindex @code{fdump-fortran-optimized}
+@item -fdump-fortran-optimized
Output the parse tree after front-end optimization. Mostly useful for
debugging the GNU Fortran compiler itself. The output generated by
this option might change between releases. This option may also
generate internal compiler errors for features which have only
recently been added.
-@item -fdump-parse-tree
@opindex @code{fdump-parse-tree}
+@item -fdump-parse-tree
Output the internal parse tree after translating the source program
into internal representation. Mostly useful for debugging the GNU
Fortran compiler itself. The output generated by this option might
@@ -1271,8 +1271,8 @@ change between releases. This option may also generate internal
compiler errors for features which have only recently been added. This
option is deprecated; use @code{-fdump-fortran-original} instead.
-@item -fdebug-aux-vars
@opindex @code{fdebug-aux-vars}
+@item -fdebug-aux-vars
Renames internal variables created by the gfortran front end and makes
them accessible to a debugger. The name of the internal variables then
start with upper-case letters followed by an underscore. This option is
@@ -1280,16 +1280,16 @@ useful for debugging the compiler's code generation together with
@code{-fdump-tree-original} and enabling debugging of the executable
program by using @code{-g} or @code{-ggdb3}.
-@item -fdump-fortran-global
@opindex @code{fdump-fortran-global}
+@item -fdump-fortran-global
Output a list of the global identifiers after translating into
middle-end representation. Mostly useful for debugging the GNU Fortran
compiler itself. The output generated by this option might change
between releases. This option may also generate internal compiler
errors for features which have only recently been added.
-@item -ffpe-trap=@var{list}
@opindex @code{ffpe-trap=}@var{list}
+@item -ffpe-trap=@var{list}
Specify a list of floating point exception traps to enable. On most
systems, if a floating point exception occurs and the trap for that
exception is enabled, a SIGFPE signal will be sent and the program
@@ -1322,8 +1322,8 @@ be uninteresting in practice.
By default no exception traps are enabled.
-@item -ffpe-summary=@var{list}
@opindex @code{ffpe-summary=}@var{list}
+@item -ffpe-summary=@var{list}
Specify a list of floating-point exceptions, whose flag status is printed
to @code{ERROR_UNIT} when invoking @code{STOP} and @code{ERROR STOP}.
@var{list} can be either @samp{none}, @samp{all} or a comma-separated list
@@ -1336,10 +1336,10 @@ last one will be used.
By default, a summary for all exceptions but @samp{inexact} is shown.
-@item -fno-backtrace
@opindex @code{fno-backtrace}
@cindex backtrace
@cindex trace
+@item -fno-backtrace
When a serious runtime error is encountered or a deadly signal is
emitted (segmentation fault, illegal instruction, bus error,
floating-point exception, and the other POSIX signals that have the
@@ -1369,13 +1369,13 @@ It also affects the search paths used by @command{cpp} when used to preprocess
Fortran source.
@table @gcctabopt
-@item -I@var{dir}
@opindex @code{I}@var{dir}
@cindex directory, search paths for inclusion
@cindex inclusion, directory search paths for
@cindex search paths, for included files
@cindex paths, search
@cindex module search path
+@item -I@var{dir}
These affect interpretation of the @code{INCLUDE} directive
(as well as of the @code{#include} directive of the @command{cpp}
preprocessor).
@@ -1392,21 +1392,21 @@ compiled modules are required by a @code{USE} statement.
gcc,Using the GNU Compiler Collection (GCC)}, for information on the
@option{-I} option.
-@item -J@var{dir}
@opindex @code{J}@var{dir}
@opindex @code{M}@var{dir}
@cindex paths, search
@cindex module search path
+@item -J@var{dir}
This option specifies where to put @file{.mod} files for compiled modules.
It is also added to the list of directories to searched by an @code{USE}
statement.
The default is the current directory.
-@item -fintrinsic-modules-path @var{dir}
@opindex @code{fintrinsic-modules-path} @var{dir}
@cindex paths, search
@cindex module search path
+@item -fintrinsic-modules-path @var{dir}
This option specifies the location of pre-compiled intrinsic modules, if
they are not in the default location expected by the compiler.
@end table
@@ -1421,8 +1421,8 @@ executable output file. They are meaningless if the compiler is not doing
a link step.
@table @gcctabopt
-@item -static-libgfortran
@opindex @code{static-libgfortran}
+@item -static-libgfortran
On systems that provide @file{libgfortran} as a shared and a static
library, this option forces the use of the static version. If no
shared version of @file{libgfortran} was built when the compiler was
@@ -1431,8 +1431,8 @@ configured, this option has no effect.
@table @gcctabopt
-@item -static-libquadmath
@opindex @code{static-libquadmath}
+@item -static-libquadmath
On systems that provide @file{libquadmath} as a shared and a static
library, this option forces the use of the static version. If no
shared version of @file{libquadmath} was built when the compiler was
@@ -1451,8 +1451,8 @@ requirements when redistributing the resulting binaries.
These options affect the runtime behavior of programs compiled with GNU Fortran.
@table @gcctabopt
-@item -fconvert=@var{conversion}
@opindex @code{fconvert=}@var{conversion}
+@item -fconvert=@var{conversion}
Specify the representation of data for unformatted files. Valid
values for conversion on most systems are: @samp{native}, the default;
@samp{swap}, swap between big- and little-endian; @samp{big-endian}, use
@@ -1473,8 +1473,8 @@ commas. Those are
The @code{CONVERT} specifier and the GFORTRAN_CONVERT_UNIT environment
variable override the default specified by @option{-fconvert}.}
-@item -frecord-marker=@var{length}
@opindex @code{frecord-marker=}@var{length}
+@item -frecord-marker=@var{length}
Specify the length of record markers for unformatted files.
Valid values for @var{length} are 4 and 8. Default is 4.
@emph{This is different from previous versions of @command{gfortran}},
@@ -1482,14 +1482,14 @@ which specified a default record marker length of 8 on most
systems. If you want to read or write files compatible
with earlier versions of @command{gfortran}, use @option{-frecord-marker=8}.
-@item -fmax-subrecord-length=@var{length}
@opindex @code{fmax-subrecord-length=}@var{length}
+@item -fmax-subrecord-length=@var{length}
Specify the maximum length for a subrecord. The maximum permitted
value for length is 2147483639, which is also the default. Only
really useful for use by the gfortran testsuite.
-@item -fsign-zero
@opindex @code{fsign-zero}
+@item -fsign-zero
When enabled, floating point numbers of value zero with the sign bit set
are written as negative number in formatted output and treated as
negative in the @code{SIGN} intrinsic. @option{-fno-sign-zero} does not
@@ -1514,10 +1514,10 @@ can figure out the other form by either removing @option{no-} or adding
it.
@table @gcctabopt
-@item -fno-automatic
@opindex @code{fno-automatic}
@cindex @code{SAVE} statement
@cindex statement, @code{SAVE}
+@item -fno-automatic
Treat each program unit (except those marked as RECURSIVE) as if the
@code{SAVE} statement were specified for every local variable and array
referenced in it. Does not affect common blocks. (Some Fortran compilers
@@ -1529,12 +1529,12 @@ Use the option @option{-frecursive} to use no static memory.
Local variables or arrays having an explicit @code{SAVE} attribute are
silently ignored unless the @option{-pedantic} option is added.
-@item -ff2c
@opindex ff2c
@cindex calling convention
@cindex @command{f2c} calling convention
@cindex @command{g77} calling convention
@cindex libf2c calling convention
+@item -ff2c
Generate code designed to be compatible with code generated
by @command{g77} and @command{f2c}.
@@ -1563,17 +1563,17 @@ calling conventions will break at execution time.
of type default @code{REAL} or @code{COMPLEX} as actual arguments, as
the library implementations use the @option{-fno-f2c} calling conventions.
-@item -fno-underscoring
@opindex @code{fno-underscoring}
@cindex underscore
@cindex symbol names, underscores
@cindex transforming symbol names
@cindex symbol names, transforming
+@item -fno-underscoring
Do not transform names of entities specified in the Fortran
source file by appending underscores to them.
With @option{-funderscoring} in effect, GNU Fortran appends one
-underscore to external names with no underscores. This is done to ensure
+underscore to external names. This is done to ensure
compatibility with code produced by many UNIX Fortran compilers.
@emph{Caution}: The default behavior of GNU Fortran is
@@ -1596,7 +1596,7 @@ I = J() + MAX_COUNT (MY_VAR, LVAR)
@noindent
is implemented as something akin to:
@smallexample
-i = j_() + max_count__(&my_var__, &lvar);
+i = j_() + max_count_(&my_var, &lvar);
@end smallexample
With @option{-fno-underscoring}, the same statement is implemented as:
@@ -1632,7 +1632,6 @@ in the source, even if the names as seen by the linker are mangled to
prevent accidental linking between procedures with incompatible
interfaces.
-@item -fsecond-underscore
@opindex @code{fsecond-underscore}
@cindex underscore
@cindex symbol names, underscores
@@ -1641,6 +1640,7 @@ interfaces.
@cindex @command{f2c} calling convention
@cindex @command{g77} calling convention
@cindex libf2c calling convention
+@item -fsecond-underscore
By default, GNU Fortran appends an underscore to external
names. If this option is used GNU Fortran appends two
underscores to names with underscores and one underscore to external names
@@ -1657,9 +1657,9 @@ is implemented as a reference to the link-time external symbol
for compatibility with @command{g77} and @command{f2c}, and is implied
by use of the @option{-ff2c} option.
-@item -fcoarray=@var{<keyword>}
@opindex @code{fcoarray}
@cindex coarrays
+@item -fcoarray=@var{<keyword>}
@table @asis
@item @samp{none}
@@ -1675,7 +1675,6 @@ library needs to be linked.
@end table
-@item -fcheck=@var{<keyword>}
@opindex @code{fcheck}
@cindex array, bounds checking
@cindex bit intrinsics checking
@@ -1687,6 +1686,7 @@ library needs to be linked.
@cindex checking subscripts
@cindex run-time checking
@cindex checking array temporaries
+@item -fcheck=@var{<keyword>}
Enable the generation of run-time checks; the argument shall be
a comma-delimited list of the following keywords. Prefixing a check with
@@ -1748,14 +1748,14 @@ will compile the file with all checks enabled as specified above except
warnings for generated array temporaries.
-@item -fbounds-check
@opindex @code{fbounds-check}
+@item -fbounds-check
@c Note: This option is also referred in gcc's manpage
Deprecated alias for @option{-fcheck=bounds}.
+@opindex @code{tail-call-workaround}
@item -ftail-call-workaround
@itemx -ftail-call-workaround=@var{n}
-@opindex @code{tail-call-workaround}
Some C interfaces to Fortran codes violate the gfortran ABI by
omitting the hidden character length arguments as described in
@xref{Argument passing conventions}. This can lead to crashes
@@ -1786,12 +1786,12 @@ The negative form, @option{-fno-tail-call-workaround} or equivalent
Default is currently @option{-ftail-call-workaround}, this will change
in future releases.
-@item -fcheck-array-temporaries
@opindex @code{fcheck-array-temporaries}
+@item -fcheck-array-temporaries
Deprecated alias for @option{-fcheck=array-temps}.
-@item -fmax-array-constructor=@var{n}
@opindex @code{fmax-array-constructor}
+@item -fmax-array-constructor=@var{n}
This option can be used to increase the upper limit permitted in
array constructors. The code below requires this option to expand
the array at compile time.
@@ -1812,8 +1812,8 @@ large object files.}
The default value for @var{n} is 65535.
-@item -fmax-stack-var-size=@var{n}
@opindex @code{fmax-stack-var-size}
+@item -fmax-stack-var-size=@var{n}
This option specifies the size in bytes of the largest array that will be put
on the stack; if the size is exceeded static memory is used (except in
procedures marked as RECURSIVE). Use the option @option{-frecursive} to
@@ -1826,8 +1826,8 @@ Future versions of GNU Fortran may improve this behavior.
The default value for @var{n} is 65536.
-@item -fstack-arrays
@opindex @code{fstack-arrays}
+@item -fstack-arrays
Adding this option will make the Fortran compiler put all arrays of
unknown size and array temporaries onto stack memory. If your program uses very
large local arrays it is possible that you will have to extend your runtime
@@ -1835,16 +1835,16 @@ limits for stack memory on some operating systems. This flag is enabled
by default at optimization level @option{-Ofast} unless
@option{-fmax-stack-var-size} is specified.
-@item -fpack-derived
@opindex @code{fpack-derived}
@cindex structure packing
+@item -fpack-derived
This option tells GNU Fortran to pack derived type members as closely as
possible. Code compiled with this option is likely to be incompatible
with code compiled without this option, and may execute slower.
-@item -frepack-arrays
@opindex @code{frepack-arrays}
@cindex repacking arrays
+@item -frepack-arrays
In some circumstances GNU Fortran may pass assumed shape array
sections via a descriptor describing a noncontiguous area of memory.
This option adds code to the function prologue to repack the data into
@@ -1854,15 +1854,15 @@ This should result in faster accesses to the array. However it can introduce
significant overhead to the function call, especially when the passed data
is noncontiguous.
-@item -fshort-enums
@opindex @code{fshort-enums}
+@item -fshort-enums
This option is provided for interoperability with C code that was
compiled with the @option{-fshort-enums} option. It will make
GNU Fortran choose the smallest @code{INTEGER} kind a given
enumerator set will fit in, and give all its enumerators this kind.
-@item -finline-arg-packing
@opindex @code{finline-arg-packing}
+@item -finline-arg-packing
When passing an assumed-shape argument of a procedure as actual
argument to an assumed-size or explicit size or as argument to a
procedure that does not have an explicit interface, the argument may
@@ -1889,8 +1889,8 @@ size and also compilation time may become excessive. If that is the
case, it may be better to disable this option. Instances of packing
can be found by using @option{-Warray-temporaries}.
-@item -fexternal-blas
@opindex @code{fexternal-blas}
+@item -fexternal-blas
This option will make @command{gfortran} generate calls to BLAS functions
for some matrix operations like @code{MATMUL}, instead of using our own
algorithms, if the size of the matrices involved is larger than a given
@@ -1898,8 +1898,8 @@ limit (see @option{-fblas-matmul-limit}). This may be profitable if an
optimized vendor BLAS library is available. The BLAS library will have
to be specified at link time.
-@item -fblas-matmul-limit=@var{n}
@opindex @code{fblas-matmul-limit}
+@item -fblas-matmul-limit=@var{n}
Only significant when @option{-fexternal-blas} is in effect.
Matrix multiplication of matrices with size larger than (or equal to) @var{n}
will be performed by calls to BLAS functions, while others will be
@@ -1909,8 +1909,8 @@ geometric mean of the dimensions of the argument and result matrices.
The default value for @var{n} is 30.
-@item -finline-matmul-limit=@var{n}
@opindex @code{finline-matmul-limit}
+@item -finline-matmul-limit=@var{n}
When front-end optimization is active, some calls to the @code{MATMUL}
intrinsic function will be inlined. This may result in code size
increase if the size of the matrix cannot be determined at compile
@@ -1924,24 +1924,24 @@ the dimensions of the argument and result matrices.
The default value for @var{n} is 30. The @code{-fblas-matmul-limit}
can be used to change this value.
-@item -frecursive
@opindex @code{frecursive}
+@item -frecursive
Allow indirect recursion by forcing all local arrays to be allocated
on the stack. This flag cannot be used together with
@option{-fmax-stack-var-size=} or @option{-fno-automatic}.
-@item -finit-local-zero
-@itemx -finit-derived
-@itemx -finit-integer=@var{n}
-@itemx -finit-real=@var{<zero|inf|-inf|nan|snan>}
-@itemx -finit-logical=@var{<true|false>}
-@itemx -finit-character=@var{n}
@opindex @code{finit-local-zero}
@opindex @code{finit-derived}
@opindex @code{finit-integer}
@opindex @code{finit-real}
@opindex @code{finit-logical}
@opindex @code{finit-character}
+@item -finit-local-zero
+@itemx -finit-derived
+@itemx -finit-integer=@var{n}
+@itemx -finit-real=@var{<zero|inf|-inf|nan|snan>}
+@itemx -finit-logical=@var{<true|false>}
+@itemx -finit-character=@var{n}
The @option{-finit-local-zero} option instructs the compiler to
initialize local @code{INTEGER}, @code{REAL}, and @code{COMPLEX}
variables to zero, @code{LOGICAL} variables to false, and
@@ -1985,9 +1985,9 @@ Finally, note that enabling any of the @option{-finit-*} options will
silence warnings that would have been emitted by @option{-Wuninitialized}
for the affected local variables.
-@item -falign-commons
@opindex @code{falign-commons}
@cindex alignment of @code{COMMON} blocks
+@item -falign-commons
By default, @command{gfortran} enforces proper alignment of all variables in a
@code{COMMON} block by padding them as needed. On certain platforms this is mandatory,
on others it increases performance. If a @code{COMMON} block is not declared with
@@ -1997,9 +1997,9 @@ same form of this option should be used for all files that share a @code{COMMON}
To avoid potential alignment issues in @code{COMMON} blocks, it is recommended to order
objects from largest to smallest.
-@item -fno-protect-parens
@opindex @code{fno-protect-parens}
@cindex re-association of parenthesized expressions
+@item -fno-protect-parens
By default the parentheses in expression are honored for all optimization
levels such that the compiler does not do any re-association. Using
@option{-fno-protect-parens} allows the compiler to reorder @code{REAL} and
@@ -2008,17 +2008,17 @@ optimization @option{-fno-signed-zeros} and @option{-fno-trapping-math}
need to be in effect. The parentheses protection is enabled by default, unless
@option{-Ofast} is given.
-@item -frealloc-lhs
@opindex @code{frealloc-lhs}
@cindex Reallocate the LHS in assignments
+@item -frealloc-lhs
An allocatable left-hand side of an intrinsic assignment is automatically
(re)allocated if it is either unallocated or has a different shape. The
option is enabled by default except when @option{-std=f95} is given. See
also @option{-Wrealloc-lhs}.
-@item -faggressive-function-elimination
@opindex @code{faggressive-function-elimination}
@cindex Elimination of functions with identical argument lists
+@item -faggressive-function-elimination
Functions with identical argument lists are eliminated within
statements, regardless of whether these functions are marked
@code{PURE} or not. For example, in
@@ -2028,9 +2028,9 @@ statements, regardless of whether these functions are marked
there will only be a single call to @code{f}. This option only works
if @option{-ffrontend-optimize} is in effect.
-@item -ffrontend-optimize
@opindex @code{frontend-optimize}
@cindex Front-end optimization
+@item -ffrontend-optimize
This option performs front-end optimization, based on manipulating
parts the Fortran parse tree. Enabled by default by any @option{-O} option
except @option{-O0} and @option{-Og}. Optimizations enabled by this option
@@ -2044,9 +2044,9 @@ include:
@end itemize
It can be deselected by specifying @option{-fno-frontend-optimize}.
-@item -ffrontend-loop-interchange
@opindex @code{frontend-loop-interchange}
@cindex loop interchange, Fortran
+@item -ffrontend-loop-interchange
Attempt to interchange loops in the Fortran front end where
profitable. Enabled by default by any @option{-O} option.
At the moment, this option only affects @code{FORALL} and
@@ -2065,9 +2065,9 @@ shared by @command{gfortran}, @command{gcc}, and other GNU compilers.
@table @asis
-@item -fc-prototypes
@opindex @code{c-prototypes}
@cindex Generating C prototypes from Fortran BIND(C) enteties
+@item -fc-prototypes
This option will generate C prototypes from @code{BIND(C)} variable
declarations, types and procedure interfaces and writes them to
standard output. @code{ENUM} is not yet supported.
@@ -2087,9 +2087,9 @@ $ gfortran -fc-prototypes -fsyntax-only foo.f90 > foo.h
where the C code intended for interoperating with the Fortran code
then uses @code{#include "foo.h"}.
-@item -fc-prototypes-external
@opindex @code{c-prototypes-external}
@cindex Generating C prototypes from external procedures
+@item -fc-prototypes-external
This option will generate C prototypes from external functions and
subroutines and write them to standard output. This may be useful for
making sure that C bindings to Fortran code are correct. This option
diff --git a/gcc/fortran/io.cc b/gcc/fortran/io.cc
index 902aa19..594f609 100644
--- a/gcc/fortran/io.cc
+++ b/gcc/fortran/io.cc
@@ -1,5 +1,5 @@
/* Deal with I/O statements & related stuff.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -2513,7 +2513,7 @@ check_open_constraints (gfc_open *open, locus *where)
spec = "";
}
- warn_or_error (G_("%s specifier at %L not allowed in OPEN statement for "
+ warn_or_error (G_("%sspecifier at %L not allowed in OPEN statement for "
"unformatted I/O"), spec, loc);
}
diff --git a/gcc/fortran/ioparm.def b/gcc/fortran/ioparm.def
index 35a5785..d96c78d 100644
--- a/gcc/fortran/ioparm.def
+++ b/gcc/fortran/ioparm.def
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2005-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/iresolve.cc b/gcc/fortran/iresolve.cc
index dea1935..33794f0 100644
--- a/gcc/fortran/iresolve.cc
+++ b/gcc/fortran/iresolve.cc
@@ -1,5 +1,5 @@
/* Intrinsic function resolution.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught & Katherine Holcomb
This file is part of GCC.
@@ -94,9 +94,12 @@ check_charlen_present (gfc_expr *source)
else if (source->expr_type == EXPR_ARRAY)
{
gfc_constructor *c = gfc_constructor_first (source->value.constructor);
- source->ts.u.cl->length
- = gfc_get_int_expr (gfc_charlen_int_kind, NULL,
- c->expr->value.character.length);
+ if (c)
+ source->ts.u.cl->length
+ = gfc_get_int_expr (gfc_charlen_int_kind, NULL,
+ c->expr->value.character.length);
+ if (source->ts.u.cl->length == NULL)
+ gfc_internal_error ("check_charlen_present(): length not set");
}
}
diff --git a/gcc/fortran/iso-c-binding.def b/gcc/fortran/iso-c-binding.def
index 27779fa..0c64117 100644
--- a/gcc/fortran/iso-c-binding.def
+++ b/gcc/fortran/iso-c-binding.def
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/iso-fortran-env.def b/gcc/fortran/iso-fortran-env.def
index d3f7ca5..fc5b5d3 100644
--- a/gcc/fortran/iso-fortran-env.def
+++ b/gcc/fortran/iso-fortran-env.def
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/lang-specs.h b/gcc/fortran/lang-specs.h
index 371ee63..7b29845 100644
--- a/gcc/fortran/lang-specs.h
+++ b/gcc/fortran/lang-specs.h
@@ -1,6 +1,6 @@
/* Contribution to the specs for the GNU Compiler Collection
from GNU Fortran 95 compiler.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index b18a6d3..7236351 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -1,5 +1,5 @@
; Options for the Fortran front end.
-; Copyright (C) 2003-2022 Free Software Foundation, Inc.
+; Copyright (C) 2003-2023 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
index 79a8c2f..cb84b59 100644
--- a/gcc/fortran/libgfortran.h
+++ b/gcc/fortran/libgfortran.h
@@ -1,5 +1,5 @@
/* Header file to the Fortran front-end and runtime library
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/match.cc b/gcc/fortran/match.cc
index 8b8b6e7..5eb6d0e 100644
--- a/gcc/fortran/match.cc
+++ b/gcc/fortran/match.cc
@@ -1,5 +1,5 @@
/* Matching subroutines in all sizes, shapes and colors.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -193,7 +193,7 @@ gfc_match_member_sep(gfc_symbol *sym)
if (gfc_match_name (name) != MATCH_YES)
{
gfc_error ("Expected structure component or operator name "
- "after '.' at %C");
+ "after %<.%> at %C");
goto error;
}
@@ -5345,6 +5345,16 @@ gfc_match_common (void)
goto cleanup;
}
+ /* F2018:R874: common-block-object is variable-name [ (array-spec) ]
+ F2018:C8121: A variable-name shall not be a name made accessible
+ by use association. */
+ if (sym->attr.use_assoc)
+ {
+ gfc_error ("Symbol %qs at %C is USE associated from module %qs "
+ "and cannot occur in COMMON", sym->name, sym->module);
+ goto cleanup;
+ }
+
/* Deal with an optional array specification after the
symbol name. */
m = gfc_match_array_spec (&as, true, true);
@@ -5524,13 +5534,15 @@ gfc_free_namelist (gfc_namelist *name)
/* Free an OpenMP namelist structure. */
void
-gfc_free_omp_namelist (gfc_omp_namelist *name, bool free_ns)
+gfc_free_omp_namelist (gfc_omp_namelist *name, bool free_ns, bool free_align)
{
gfc_omp_namelist *n;
for (; name; name = n)
{
gfc_free_expr (name->expr);
+ if (free_align)
+ gfc_free_expr (name->u.align);
if (free_ns)
gfc_free_namespace (name->u2.ns);
else if (name->u2.udr)
@@ -5913,6 +5925,30 @@ recursive_stmt_fcn (gfc_expr *e, gfc_symbol *sym)
}
+/* Check for invalid uses of statement function dummy arguments in body. */
+
+static bool
+chk_stmt_fcn_body (gfc_expr *e, gfc_symbol *sym, int *f ATTRIBUTE_UNUSED)
+{
+ gfc_formal_arglist *formal;
+
+ if (e == NULL || e->symtree == NULL || e->expr_type != EXPR_FUNCTION)
+ return false;
+
+ for (formal = sym->formal; formal; formal = formal->next)
+ {
+ if (formal->sym == e->symtree->n.sym)
+ {
+ gfc_error ("Invalid use of statement function argument at %L",
+ &e->where);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
/* Match a statement function declaration. It is so easy to match
non-statement function statements with a MATCH_ERROR as opposed to
MATCH_NO that we suppress error message in most cases. */
@@ -5981,6 +6017,9 @@ gfc_match_st_function (void)
return MATCH_ERROR;
}
+ if (gfc_traverse_expr (expr, sym, chk_stmt_fcn_body, 0))
+ return MATCH_ERROR;
+
sym->value = expr;
if ((gfc_current_state () == COMP_FUNCTION
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index 1f53e0c..4430aff 100644
--- a/gcc/fortran/match.h
+++ b/gcc/fortran/match.h
@@ -1,5 +1,5 @@
/* All matcher functions.
- Copyright (C) 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2023 Free Software Foundation, Inc.
Contributed by Steven Bosscher
This file is part of GCC.
@@ -149,6 +149,8 @@ match gfc_match_oacc_routine (void);
/* OpenMP directive matchers. */
match gfc_match_omp_eos_error (void);
+match gfc_match_omp_assume (void);
+match gfc_match_omp_assumes (void);
match gfc_match_omp_atomic (void);
match gfc_match_omp_barrier (void);
match gfc_match_omp_cancel (void);
diff --git a/gcc/fortran/matchexp.cc b/gcc/fortran/matchexp.cc
index 942af78..f64ec4d 100644
--- a/gcc/fortran/matchexp.cc
+++ b/gcc/fortran/matchexp.cc
@@ -1,5 +1,5 @@
/* Expression parser.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
diff --git a/gcc/fortran/mathbuiltins.def b/gcc/fortran/mathbuiltins.def
index 9d55c34..c6bb3e8 100644
--- a/gcc/fortran/mathbuiltins.def
+++ b/gcc/fortran/mathbuiltins.def
@@ -1,4 +1,4 @@
-/* Copyright (C) 2004-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2004-2023 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/fortran/misc.cc b/gcc/fortran/misc.cc
index af36347..bae6d29 100644
--- a/gcc/fortran/misc.cc
+++ b/gcc/fortran/misc.cc
@@ -1,5 +1,5 @@
/* Miscellaneous stuff that doesn't fit anywhere else.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc
index 5ddabdc..601497e 100644
--- a/gcc/fortran/module.cc
+++ b/gcc/fortran/module.cc
@@ -1,6 +1,6 @@
/* Handle modules, which amounts to loading and saving symbols and
their attendant structures.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc
index 457e983..b8b6686 100644
--- a/gcc/fortran/openmp.cc
+++ b/gcc/fortran/openmp.cc
@@ -1,5 +1,5 @@
/* OpenMP directive matching and resolving.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
Contributed by Jakub Jelinek
This file is part of GCC.
@@ -29,6 +29,86 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "gomp-constants.h"
#include "target-memory.h" /* For gfc_encode_character. */
+#include "bitmap.h"
+
+
+static gfc_statement omp_code_to_statement (gfc_code *);
+
+enum gfc_omp_directive_kind {
+ GFC_OMP_DIR_DECLARATIVE,
+ GFC_OMP_DIR_EXECUTABLE,
+ GFC_OMP_DIR_INFORMATIONAL,
+ GFC_OMP_DIR_META,
+ GFC_OMP_DIR_SUBSIDIARY,
+ GFC_OMP_DIR_UTILITY
+};
+
+struct gfc_omp_directive {
+ const char *name;
+ enum gfc_omp_directive_kind kind;
+ gfc_statement st;
+};
+
+/* Alphabetically sorted OpenMP clauses, except that longer strings are before
+ substrings; excludes combined/composite directives. See note for "ordered"
+ and "nothing". */
+
+static const struct gfc_omp_directive gfc_omp_directives[] = {
+ /* {"allocate", GFC_OMP_DIR_DECLARATIVE, ST_OMP_ALLOCATE}, */
+ /* {"allocators", GFC_OMP_DIR_EXECUTABLE, ST_OMP_ALLOCATORS}, */
+ {"assumes", GFC_OMP_DIR_INFORMATIONAL, ST_OMP_ASSUMES},
+ {"assume", GFC_OMP_DIR_INFORMATIONAL, ST_OMP_ASSUME},
+ {"atomic", GFC_OMP_DIR_EXECUTABLE, ST_OMP_ATOMIC},
+ {"barrier", GFC_OMP_DIR_EXECUTABLE, ST_OMP_BARRIER},
+ {"cancellation point", GFC_OMP_DIR_EXECUTABLE, ST_OMP_CANCELLATION_POINT},
+ {"cancel", GFC_OMP_DIR_EXECUTABLE, ST_OMP_CANCEL},
+ {"critical", GFC_OMP_DIR_EXECUTABLE, ST_OMP_CRITICAL},
+ /* {"declare mapper", GFC_OMP_DIR_DECLARATIVE, ST_OMP_DECLARE_MAPPER}, */
+ {"declare reduction", GFC_OMP_DIR_DECLARATIVE, ST_OMP_DECLARE_REDUCTION},
+ {"declare simd", GFC_OMP_DIR_DECLARATIVE, ST_OMP_DECLARE_SIMD},
+ {"declare target", GFC_OMP_DIR_DECLARATIVE, ST_OMP_DECLARE_TARGET},
+ {"declare variant", GFC_OMP_DIR_DECLARATIVE, ST_OMP_DECLARE_VARIANT},
+ {"depobj", GFC_OMP_DIR_EXECUTABLE, ST_OMP_DEPOBJ},
+ /* {"dispatch", GFC_OMP_DIR_EXECUTABLE, ST_OMP_DISPATCH}, */
+ {"distribute", GFC_OMP_DIR_EXECUTABLE, ST_OMP_DISTRIBUTE},
+ {"do", GFC_OMP_DIR_EXECUTABLE, ST_OMP_DO},
+ /* "error" becomes GFC_OMP_DIR_EXECUTABLE with at(execution) */
+ {"error", GFC_OMP_DIR_UTILITY, ST_OMP_ERROR},
+ {"flush", GFC_OMP_DIR_EXECUTABLE, ST_OMP_FLUSH},
+ /* {"interop", GFC_OMP_DIR_EXECUTABLE, ST_OMP_INTEROP}, */
+ {"loop", GFC_OMP_DIR_EXECUTABLE, ST_OMP_LOOP},
+ {"masked", GFC_OMP_DIR_EXECUTABLE, ST_OMP_MASKED},
+ /* {"metadirective", GFC_OMP_DIR_META, ST_OMP_METADIRECTIVE}, */
+ /* Note: gfc_match_omp_nothing returns ST_NONE. */
+ {"nothing", GFC_OMP_DIR_UTILITY, ST_OMP_NOTHING},
+ /* Special case; for now map to the first one.
+ ordered-blockassoc = ST_OMP_ORDERED
+ ordered-standalone = ST_OMP_ORDERED_DEPEND + depend/doacross. */
+ {"ordered", GFC_OMP_DIR_EXECUTABLE, ST_OMP_ORDERED},
+ {"parallel", GFC_OMP_DIR_EXECUTABLE, ST_OMP_PARALLEL},
+ {"requires", GFC_OMP_DIR_INFORMATIONAL, ST_OMP_REQUIRES},
+ {"scan", GFC_OMP_DIR_SUBSIDIARY, ST_OMP_SCAN},
+ {"scope", GFC_OMP_DIR_EXECUTABLE, ST_OMP_SCOPE},
+ {"sections", GFC_OMP_DIR_EXECUTABLE, ST_OMP_SECTIONS},
+ {"section", GFC_OMP_DIR_SUBSIDIARY, ST_OMP_SECTION},
+ {"simd", GFC_OMP_DIR_EXECUTABLE, ST_OMP_SIMD},
+ {"single", GFC_OMP_DIR_EXECUTABLE, ST_OMP_SINGLE},
+ {"target data", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TARGET_DATA},
+ {"target enter data", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TARGET_ENTER_DATA},
+ {"target exit data", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TARGET_EXIT_DATA},
+ {"target update", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TARGET_UPDATE},
+ {"target", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TARGET},
+ {"taskloop", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TASKLOOP},
+ {"taskwait", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TASKWAIT},
+ {"taskyield", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TASKYIELD},
+ {"task", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TASK},
+ {"teams", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TEAMS},
+ {"threadprivate", GFC_OMP_DIR_DECLARATIVE, ST_OMP_THREADPRIVATE},
+ /* {"tile", GFC_OMP_DIR_EXECUTABLE, ST_OMP_TILE}, */
+ /* {"unroll", GFC_OMP_DIR_EXECUTABLE, ST_OMP_UNROLL}, */
+ {"workshare", GFC_OMP_DIR_EXECUTABLE, ST_OMP_WORKSHARE},
+};
+
/* Match an end of OpenMP directive. End of OpenMP directive is optional
whitespace, followed by '\n' or comment '!'. */
@@ -107,10 +187,18 @@ gfc_free_omp_clauses (gfc_omp_clauses *c)
gfc_free_expr (c->vector_length_expr);
for (i = 0; i < OMP_LIST_NUM; i++)
gfc_free_omp_namelist (c->lists[i],
- i == OMP_LIST_AFFINITY || i == OMP_LIST_DEPEND);
+ i == OMP_LIST_AFFINITY || i == OMP_LIST_DEPEND,
+ i == OMP_LIST_ALLOCATE);
gfc_free_expr_list (c->wait_list);
gfc_free_expr_list (c->tile_list);
free (CONST_CAST (char *, c->critical_name));
+ if (c->assume)
+ {
+ free (c->assume->absent);
+ free (c->assume->contains);
+ gfc_free_expr_list (c->assume->holds);
+ free (c->assume);
+ }
free (c);
}
@@ -455,7 +543,7 @@ syntax:
gfc_error ("Syntax error in OpenMP variable list at %C");
cleanup:
- gfc_free_omp_namelist (head, false);
+ gfc_free_omp_namelist (head, false, false);
gfc_current_locus = old_loc;
return MATCH_ERROR;
}
@@ -545,7 +633,7 @@ syntax:
gfc_error ("Syntax error in OpenMP variable list at %C");
cleanup:
- gfc_free_omp_namelist (head, false);
+ gfc_free_omp_namelist (head, false, false);
gfc_current_locus = old_loc;
return MATCH_ERROR;
}
@@ -654,7 +742,7 @@ syntax:
gfc_error ("Syntax error in OpenMP SINK dependence-type list at %C");
cleanup:
- gfc_free_omp_namelist (head, false);
+ gfc_free_omp_namelist (head, false, false);
gfc_current_locus = old_loc;
return MATCH_ERROR;
}
@@ -992,6 +1080,7 @@ enum omp_mask2
OMP_CLAUSE_HAS_DEVICE_ADDR, /* OpenMP 5.1 */
OMP_CLAUSE_ENTER, /* OpenMP 5.2 */
OMP_CLAUSE_DOACROSS, /* OpenMP 5.2 */
+ OMP_CLAUSE_ASSUMPTIONS, /* OpenMP 5.1. */
/* This must come last. */
OMP_MASK2_LAST
};
@@ -1379,7 +1468,7 @@ gfc_match_omp_clause_reduction (char pc, gfc_omp_clauses *c, bool openacc,
*head = NULL;
gfc_error_now ("!$OMP DECLARE REDUCTION %s not found at %L",
buffer, &old_loc);
- gfc_free_omp_namelist (n, false);
+ gfc_free_omp_namelist (n, false, false);
}
else
for (n = *head; n; n = n->next)
@@ -1407,6 +1496,173 @@ gfc_match_omp_clause_reduction (char pc, gfc_omp_clauses *c, bool openacc,
return MATCH_YES;
}
+static match
+gfc_omp_absent_contains_clause (gfc_omp_assumptions **assume, bool is_absent)
+{
+ if (*assume == NULL)
+ *assume = gfc_get_omp_assumptions ();
+ do
+ {
+ gfc_statement st = ST_NONE;
+ gfc_gobble_whitespace ();
+ locus old_loc = gfc_current_locus;
+ char c = gfc_peek_ascii_char ();
+ enum gfc_omp_directive_kind kind
+ = GFC_OMP_DIR_DECLARATIVE; /* Silence warning. */
+ for (size_t i = 0; i < ARRAY_SIZE (gfc_omp_directives); i++)
+ {
+ if (gfc_omp_directives[i].name[0] > c)
+ break;
+ if (gfc_omp_directives[i].name[0] != c)
+ continue;
+ if (gfc_match (gfc_omp_directives[i].name) == MATCH_YES)
+ {
+ st = gfc_omp_directives[i].st;
+ kind = gfc_omp_directives[i].kind;
+ }
+ }
+ gfc_gobble_whitespace ();
+ c = gfc_peek_ascii_char ();
+ if (st == ST_NONE || (c != ',' && c != ')'))
+ {
+ if (st == ST_NONE)
+ gfc_error ("Unknown directive at %L", &old_loc);
+ else
+ gfc_error ("Invalid combined or composite directive at %L",
+ &old_loc);
+ return MATCH_ERROR;
+ }
+ if (kind == GFC_OMP_DIR_DECLARATIVE
+ || kind == GFC_OMP_DIR_INFORMATIONAL
+ || kind == GFC_OMP_DIR_META)
+ {
+ gfc_error ("Invalid %qs directive at %L in %s clause: declarative, "
+ "informational and meta directives not permitted",
+ gfc_ascii_statement (st, true), &old_loc,
+ is_absent ? "ABSENT" : "CONTAINS");
+ return MATCH_ERROR;
+ }
+ if (is_absent)
+ {
+ /* Use exponential allocation; equivalent to pow2p(x). */
+ int i = (*assume)->n_absent;
+ int size = ((i == 0) ? 4
+ : pow2p_hwi (i) == 1 ? i*2 : 0);
+ if (size != 0)
+ (*assume)->absent = XRESIZEVEC (gfc_statement,
+ (*assume)->absent, size);
+ (*assume)->absent[(*assume)->n_absent++] = st;
+ }
+ else
+ {
+ int i = (*assume)->n_contains;
+ int size = ((i == 0) ? 4
+ : pow2p_hwi (i) == 1 ? i*2 : 0);
+ if (size != 0)
+ (*assume)->contains = XRESIZEVEC (gfc_statement,
+ (*assume)->contains, size);
+ (*assume)->contains[(*assume)->n_contains++] = st;
+ }
+ gfc_gobble_whitespace ();
+ if (gfc_match(",") == MATCH_YES)
+ continue;
+ if (gfc_match(")") == MATCH_YES)
+ break;
+ gfc_error ("Expected %<,%> or %<)%> at %C");
+ return MATCH_ERROR;
+ }
+ while (true);
+
+ return MATCH_YES;
+}
+
+/* Check 'check' argument for duplicated statements in absent and/or contains
+ clauses. If 'merge', merge them from check to 'merge'. */
+
+static match
+omp_verify_merge_absent_contains (gfc_statement st, gfc_omp_assumptions *check,
+ gfc_omp_assumptions *merge, locus *loc)
+{
+ if (check == NULL)
+ return MATCH_YES;
+ bitmap_head absent_head, contains_head;
+ bitmap_obstack_initialize (NULL);
+ bitmap_initialize (&absent_head, &bitmap_default_obstack);
+ bitmap_initialize (&contains_head, &bitmap_default_obstack);
+
+ match m = MATCH_YES;
+ for (int i = 0; i < check->n_absent; i++)
+ if (!bitmap_set_bit (&absent_head, check->absent[i]))
+ {
+ gfc_error ("%qs directive mentioned multiple times in %s clause in %s "
+ "directive at %L",
+ gfc_ascii_statement (check->absent[i], true),
+ "ABSENT", gfc_ascii_statement (st), loc);
+ m = MATCH_ERROR;
+ }
+ for (int i = 0; i < check->n_contains; i++)
+ {
+ if (!bitmap_set_bit (&contains_head, check->contains[i]))
+ {
+ gfc_error ("%qs directive mentioned multiple times in %s clause in %s "
+ "directive at %L",
+ gfc_ascii_statement (check->contains[i], true),
+ "CONTAINS", gfc_ascii_statement (st), loc);
+ m = MATCH_ERROR;
+ }
+ if (bitmap_bit_p (&absent_head, check->contains[i]))
+ {
+ gfc_error ("%qs directive mentioned both times in ABSENT and CONTAINS "
+ "clauses in %s directive at %L",
+ gfc_ascii_statement (check->absent[i], true),
+ gfc_ascii_statement (st), loc);
+ m = MATCH_ERROR;
+ }
+ }
+
+ if (m == MATCH_ERROR)
+ return MATCH_ERROR;
+ if (merge == NULL)
+ return MATCH_YES;
+ if (merge->absent == NULL && check->absent)
+ {
+ merge->n_absent = check->n_absent;
+ merge->absent = check->absent;
+ check->absent = NULL;
+ }
+ else if (merge->absent && check->absent)
+ {
+ check->absent = XRESIZEVEC (gfc_statement, check->absent,
+ merge->n_absent + check->n_absent);
+ for (int i = 0; i < merge->n_absent; i++)
+ if (!bitmap_bit_p (&absent_head, merge->absent[i]))
+ check->absent[check->n_absent++] = merge->absent[i];
+ free (merge->absent);
+ merge->absent = check->absent;
+ merge->n_absent = check->n_absent;
+ check->absent = NULL;
+ }
+ if (merge->contains == NULL && check->contains)
+ {
+ merge->n_contains = check->n_contains;
+ merge->contains = check->contains;
+ check->contains = NULL;
+ }
+ else if (merge->contains && check->contains)
+ {
+ check->contains = XRESIZEVEC (gfc_statement, check->contains,
+ merge->n_contains + check->n_contains);
+ for (int i = 0; i < merge->n_contains; i++)
+ if (!bitmap_bit_p (&contains_head, merge->contains[i]))
+ check->contains[check->n_contains++] = merge->contains[i];
+ free (merge->contains);
+ merge->contains = check->contains;
+ merge->n_contains = check->n_contains;
+ check->contains = NULL;
+ }
+ return MATCH_YES;
+}
+
/* Match with duplicate check. Matches 'name'. If expr != NULL, it
then matches '(expr)', otherwise, if open_parens is true,
@@ -1511,6 +1767,14 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
case 'a':
end_colon = false;
head = NULL;
+ if ((mask & OMP_CLAUSE_ASSUMPTIONS)
+ && gfc_match ("absent ( ") == MATCH_YES)
+ {
+ if (gfc_omp_absent_contains_clause (&c->assume, true)
+ != MATCH_YES)
+ goto error;
+ continue;
+ }
if ((mask & OMP_CLAUSE_ALIGNED)
&& gfc_match_omp_variable_list ("aligned (",
&c->lists[OMP_LIST_ALIGNED],
@@ -1522,7 +1786,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
if (end_colon && gfc_match (" %e )", &alignment) != MATCH_YES)
{
- gfc_free_omp_namelist (*head, false);
+ gfc_free_omp_namelist (*head, false, false);
gfc_current_locus = old_loc;
*head = NULL;
break;
@@ -1590,17 +1854,33 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
&& gfc_match ("allocate ( ") == MATCH_YES)
{
gfc_expr *allocator = NULL;
+ gfc_expr *align = NULL;
old_loc = gfc_current_locus;
- m = gfc_match_expr (&allocator);
- if (m == MATCH_YES && gfc_match (" : ") != MATCH_YES)
+ if ((m = gfc_match ("allocator ( %e )", &allocator)) == MATCH_YES)
+ gfc_match (" , align ( %e )", &align);
+ else if ((m = gfc_match ("align ( %e )", &align)) == MATCH_YES)
+ gfc_match (" , allocator ( %e )", &allocator);
+
+ if (m == MATCH_YES)
{
- /* If no ":" then there is no allocator, we backtrack
- and read the variable list. */
- gfc_free_expr (allocator);
- allocator = NULL;
- gfc_current_locus = old_loc;
+ if (gfc_match (" : ") != MATCH_YES)
+ {
+ gfc_error ("Expected %<:%> at %C");
+ goto error;
+ }
+ }
+ else
+ {
+ m = gfc_match_expr (&allocator);
+ if (m == MATCH_YES && gfc_match (" : ") != MATCH_YES)
+ {
+ /* If no ":" then there is no allocator, we backtrack
+ and read the variable list. */
+ gfc_free_expr (allocator);
+ allocator = NULL;
+ gfc_current_locus = old_loc;
+ }
}
-
gfc_omp_namelist **head = NULL;
m = gfc_match_omp_variable_list ("", &c->lists[OMP_LIST_ALLOCATE],
true, NULL, &head);
@@ -1608,16 +1888,18 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
if (m != MATCH_YES)
{
gfc_free_expr (allocator);
+ gfc_free_expr (align);
gfc_error ("Expected variable list at %C");
goto error;
}
for (gfc_omp_namelist *n = *head; n; n = n->next)
- if (allocator)
- n->expr = gfc_copy_expr (allocator);
- else
- n->expr = NULL;
+ {
+ n->expr = (allocator) ? gfc_copy_expr (allocator) : NULL;
+ n->u.align = (align) ? gfc_copy_expr (align) : NULL;
+ }
gfc_free_expr (allocator);
+ gfc_free_expr (align);
continue;
}
if ((mask & OMP_CLAUSE_AT)
@@ -1743,6 +2025,14 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
needs_space = true;
continue;
}
+ if ((mask & OMP_CLAUSE_ASSUMPTIONS)
+ && gfc_match ("contains ( ") == MATCH_YES)
+ {
+ if (gfc_omp_absent_contains_clause (&c->assume, false)
+ != MATCH_YES)
+ goto error;
+ continue;
+ }
if ((mask & OMP_CLAUSE_COPY)
&& gfc_match ("copy ( ") == MATCH_YES
&& gfc_match_omp_map_clause (&c->lists[OMP_LIST_MAP],
@@ -2228,9 +2518,10 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
true) == MATCH_YES)
continue;
if ((mask & OMP_CLAUSE_FROM)
- && gfc_match_omp_variable_list ("from (",
+ && (gfc_match_omp_variable_list ("from (",
&c->lists[OMP_LIST_FROM], false,
- NULL, &head, true) == MATCH_YES)
+ NULL, &head, true, true)
+ == MATCH_YES))
continue;
break;
case 'g':
@@ -2277,6 +2568,20 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
goto error;
continue;
}
+ if ((mask & OMP_CLAUSE_ASSUMPTIONS)
+ && gfc_match ("holds ( ") == MATCH_YES)
+ {
+ gfc_expr *e;
+ if (gfc_match ("%e )", &e) != MATCH_YES)
+ goto error;
+ if (c->assume == NULL)
+ c->assume = gfc_get_omp_assumptions ();
+ gfc_expr_list *el = XCNEW (gfc_expr_list);
+ el->expr = e;
+ el->next = c->assume->holds;
+ c->assume->holds = el;
+ continue;
+ }
if ((mask & OMP_CLAUSE_HOST_SELF)
&& gfc_match ("host ( ") == MATCH_YES
&& gfc_match_omp_map_clause (&c->lists[OMP_LIST_MAP],
@@ -2423,7 +2728,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
end_colon = true;
else if (gfc_match (" )") != MATCH_YES)
{
- gfc_free_omp_namelist (*head, false);
+ gfc_free_omp_namelist (*head, false, false);
gfc_current_locus = old_loc;
*head = NULL;
break;
@@ -2434,7 +2739,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
{
if (gfc_match (" %e )", &step) != MATCH_YES)
{
- gfc_free_omp_namelist (*head, false);
+ gfc_free_omp_namelist (*head, false, false);
gfc_current_locus = old_loc;
*head = NULL;
goto error;
@@ -2531,7 +2836,7 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
}
if (has_error)
{
- gfc_free_omp_namelist (*head, false);
+ gfc_free_omp_namelist (*head, false, false);
*head = NULL;
goto error;
}
@@ -2664,6 +2969,41 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
OMP_MAP_IF_PRESENT, true,
allow_derived))
continue;
+ if ((mask & OMP_CLAUSE_ASSUMPTIONS)
+ && (m = gfc_match_dupl_check (!c->assume
+ || !c->assume->no_openmp_routines,
+ "no_openmp_routines")) == MATCH_YES)
+ {
+ if (m == MATCH_ERROR)
+ goto error;
+ if (c->assume == NULL)
+ c->assume = gfc_get_omp_assumptions ();
+ c->assume->no_openmp_routines = needs_space = true;
+ continue;
+ }
+ if ((mask & OMP_CLAUSE_ASSUMPTIONS)
+ && (m = gfc_match_dupl_check (!c->assume || !c->assume->no_openmp,
+ "no_openmp")) == MATCH_YES)
+ {
+ if (m == MATCH_ERROR)
+ goto error;
+ if (c->assume == NULL)
+ c->assume = gfc_get_omp_assumptions ();
+ c->assume->no_openmp = needs_space = true;
+ continue;
+ }
+ if ((mask & OMP_CLAUSE_ASSUMPTIONS)
+ && (m = gfc_match_dupl_check (!c->assume
+ || !c->assume->no_parallelism,
+ "no_parallelism")) == MATCH_YES)
+ {
+ if (m == MATCH_ERROR)
+ goto error;
+ if (c->assume == NULL)
+ c->assume = gfc_get_omp_assumptions ();
+ c->assume->no_parallelism = needs_space = true;
+ continue;
+ }
if ((mask & OMP_CLAUSE_NOGROUP)
&& (m = gfc_match_dupl_check (!c->nogroup, "nogroup"))
!= MATCH_NO)
@@ -3116,9 +3456,10 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const omp_mask mask,
continue;
}
else if ((mask & OMP_CLAUSE_TO)
- && gfc_match_omp_variable_list ("to (",
+ && (gfc_match_omp_variable_list ("to (",
&c->lists[OMP_LIST_TO], false,
- NULL, &head, true) == MATCH_YES)
+ NULL, &head, true, true)
+ == MATCH_YES))
continue;
break;
case 'u':
@@ -3718,7 +4059,7 @@ gfc_match_oacc_routine (void)
if (gfc_match_char (')') != MATCH_YES)
{
gfc_error ("Syntax error in !$ACC ROUTINE ( NAME ) at %C, expecting"
- " ')' after NAME");
+ " %<)%> after NAME");
gfc_current_locus = old_loc;
return MATCH_ERROR;
}
@@ -3851,17 +4192,19 @@ cleanup:
(omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_FIRSTPRIVATE \
| OMP_CLAUSE_LASTPRIVATE | OMP_CLAUSE_REDUCTION \
| OMP_CLAUSE_SCHEDULE | OMP_CLAUSE_ORDERED | OMP_CLAUSE_COLLAPSE \
- | OMP_CLAUSE_LINEAR | OMP_CLAUSE_ORDER | OMP_CLAUSE_ALLOCATE)
+ | OMP_CLAUSE_LINEAR | OMP_CLAUSE_ORDER | OMP_CLAUSE_ALLOCATE \
+ | OMP_CLAUSE_NOWAIT)
#define OMP_LOOP_CLAUSES \
(omp_mask (OMP_CLAUSE_BIND) | OMP_CLAUSE_COLLAPSE | OMP_CLAUSE_ORDER \
| OMP_CLAUSE_PRIVATE | OMP_CLAUSE_LASTPRIVATE | OMP_CLAUSE_REDUCTION)
#define OMP_SCOPE_CLAUSES \
(omp_mask (OMP_CLAUSE_PRIVATE) |OMP_CLAUSE_FIRSTPRIVATE \
- | OMP_CLAUSE_REDUCTION | OMP_CLAUSE_ALLOCATE)
+ | OMP_CLAUSE_REDUCTION | OMP_CLAUSE_ALLOCATE | OMP_CLAUSE_NOWAIT)
#define OMP_SECTIONS_CLAUSES \
(omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_FIRSTPRIVATE \
- | OMP_CLAUSE_LASTPRIVATE | OMP_CLAUSE_REDUCTION | OMP_CLAUSE_ALLOCATE)
+ | OMP_CLAUSE_LASTPRIVATE | OMP_CLAUSE_REDUCTION \
+ | OMP_CLAUSE_ALLOCATE | OMP_CLAUSE_NOWAIT)
#define OMP_SIMD_CLAUSES \
(omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_LASTPRIVATE \
| OMP_CLAUSE_REDUCTION | OMP_CLAUSE_COLLAPSE | OMP_CLAUSE_SAFELEN \
@@ -3911,7 +4254,7 @@ cleanup:
| OMP_CLAUSE_ORDER | OMP_CLAUSE_ALLOCATE)
#define OMP_SINGLE_CLAUSES \
(omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_FIRSTPRIVATE \
- | OMP_CLAUSE_ALLOCATE)
+ | OMP_CLAUSE_ALLOCATE | OMP_CLAUSE_NOWAIT | OMP_CLAUSE_COPYPRIVATE)
#define OMP_ORDERED_CLAUSES \
(omp_mask (OMP_CLAUSE_THREADS) | OMP_CLAUSE_SIMD)
#define OMP_DECLARE_TARGET_CLAUSES \
@@ -3925,7 +4268,8 @@ cleanup:
(omp_mask (OMP_CLAUSE_FILTER))
#define OMP_ERROR_CLAUSES \
(omp_mask (OMP_CLAUSE_AT) | OMP_CLAUSE_MESSAGE | OMP_CLAUSE_SEVERITY)
-
+#define OMP_WORKSHARE_CLAUSES \
+ omp_mask (OMP_CLAUSE_NOWAIT)
static match
@@ -3942,6 +4286,69 @@ match_omp (gfc_exec_op op, const omp_mask mask)
match
+gfc_match_omp_assume (void)
+{
+ gfc_omp_clauses *c;
+ locus loc = gfc_current_locus;
+ if ((gfc_match_omp_clauses (&c, omp_mask (OMP_CLAUSE_ASSUMPTIONS))
+ != MATCH_YES)
+ || (omp_verify_merge_absent_contains (ST_OMP_ASSUME, c->assume, NULL,
+ &loc) != MATCH_YES))
+ return MATCH_ERROR;
+ new_st.op = EXEC_OMP_ASSUME;
+ new_st.ext.omp_clauses = c;
+ return MATCH_YES;
+}
+
+
+match
+gfc_match_omp_assumes (void)
+{
+ gfc_omp_clauses *c;
+ locus loc = gfc_current_locus;
+ if (!gfc_current_ns->proc_name
+ || (gfc_current_ns->proc_name->attr.flavor != FL_MODULE
+ && !gfc_current_ns->proc_name->attr.subroutine
+ && !gfc_current_ns->proc_name->attr.function))
+ {
+ gfc_error ("!$OMP ASSUMES at %C must be in the specification part of a "
+ "subprogram or module");
+ return MATCH_ERROR;
+ }
+ if ((gfc_match_omp_clauses (&c, omp_mask (OMP_CLAUSE_ASSUMPTIONS))
+ != MATCH_YES)
+ || (omp_verify_merge_absent_contains (ST_OMP_ASSUMES, c->assume,
+ gfc_current_ns->omp_assumes, &loc)
+ != MATCH_YES))
+ return MATCH_ERROR;
+ if (gfc_current_ns->omp_assumes == NULL)
+ {
+ gfc_current_ns->omp_assumes = c->assume;
+ c->assume = NULL;
+ }
+ else if (gfc_current_ns->omp_assumes && c->assume)
+ {
+ gfc_current_ns->omp_assumes->no_openmp |= c->assume->no_openmp;
+ gfc_current_ns->omp_assumes->no_openmp_routines
+ |= c->assume->no_openmp_routines;
+ gfc_current_ns->omp_assumes->no_parallelism |= c->assume->no_parallelism;
+ if (gfc_current_ns->omp_assumes->holds && c->assume->holds)
+ {
+ gfc_expr_list *el = gfc_current_ns->omp_assumes->holds;
+ for ( ; el->next ; el = el->next)
+ ;
+ el->next = c->assume->holds;
+ }
+ else if (c->assume->holds)
+ gfc_current_ns->omp_assumes->holds = c->assume->holds;
+ c->assume->holds = NULL;
+ }
+ gfc_free_omp_clauses (c);
+ return MATCH_YES;
+}
+
+
+match
gfc_match_omp_critical (void)
{
char n[GFC_MAX_SYMBOL_LEN+1];
@@ -4073,8 +4480,8 @@ gfc_match_omp_distribute_parallel_do (void)
return match_omp (EXEC_OMP_DISTRIBUTE_PARALLEL_DO,
(OMP_DISTRIBUTE_CLAUSES | OMP_PARALLEL_CLAUSES
| OMP_DO_CLAUSES)
- & ~(omp_mask (OMP_CLAUSE_ORDERED))
- & ~(omp_mask (OMP_CLAUSE_LINEAR)));
+ & ~(omp_mask (OMP_CLAUSE_ORDERED)
+ | OMP_CLAUSE_LINEAR | OMP_CLAUSE_NOWAIT));
}
@@ -4084,7 +4491,7 @@ gfc_match_omp_distribute_parallel_do_simd (void)
return match_omp (EXEC_OMP_DISTRIBUTE_PARALLEL_DO_SIMD,
(OMP_DISTRIBUTE_CLAUSES | OMP_PARALLEL_CLAUSES
| OMP_DO_CLAUSES | OMP_SIMD_CLAUSES)
- & ~(omp_mask (OMP_CLAUSE_ORDERED)));
+ & ~(omp_mask (OMP_CLAUSE_ORDERED) | OMP_CLAUSE_NOWAIT));
}
@@ -4239,14 +4646,14 @@ gfc_match_omp_flush (void)
{
gfc_error ("List specified together with memory order clause in FLUSH "
"directive at %C");
- gfc_free_omp_namelist (list, false);
+ gfc_free_omp_namelist (list, false, false);
gfc_free_omp_clauses (c);
return MATCH_ERROR;
}
if (gfc_match_omp_eos () != MATCH_YES)
{
gfc_error ("Unexpected junk after $OMP FLUSH statement at %C");
- gfc_free_omp_namelist (list, false);
+ gfc_free_omp_namelist (list, false, false);
gfc_free_omp_clauses (c);
return MATCH_ERROR;
}
@@ -4941,8 +5348,8 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss)
}
else
{
- gfc_error ("selector '%s' not allowed for context selector "
- "set '%s' at %C",
+ gfc_error ("selector %qs not allowed for context selector "
+ "set %qs at %C",
selector, oss->trait_set_selector_name);
return MATCH_ERROR;
}
@@ -4961,7 +5368,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss)
{
if (property_kind == CTX_PROPERTY_NONE)
{
- gfc_error ("selector '%s' does not accept any properties at %C",
+ gfc_error ("selector %qs does not accept any properties at %C",
selector);
return MATCH_ERROR;
}
@@ -4970,7 +5377,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss)
{
if (gfc_match (" (") != MATCH_YES)
{
- gfc_error ("expected '(' at %C");
+ gfc_error ("expected %<(%> at %C");
return MATCH_ERROR;
}
if (gfc_match_expr (&os->score) != MATCH_YES
@@ -4992,7 +5399,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss)
if (gfc_match (" )") != MATCH_YES)
{
- gfc_error ("expected ')' at %C");
+ gfc_error ("expected %<)%> at %C");
return MATCH_ERROR;
}
@@ -5105,7 +5512,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss)
if (gfc_match (" )") != MATCH_YES)
{
- gfc_error ("expected ')' at %C");
+ gfc_error ("expected %<)%> at %C");
return MATCH_ERROR;
}
}
@@ -5115,7 +5522,7 @@ gfc_match_omp_context_selector (gfc_omp_set_selector *oss)
{
if (gfc_match (" (") != MATCH_YES)
{
- gfc_error ("expected '(' at %C");
+ gfc_error ("expected %<(%> at %C");
return MATCH_ERROR;
}
}
@@ -5161,22 +5568,22 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv)
if (m != MATCH_YES || i == selector_set_count)
{
- gfc_error ("expected 'construct', 'device', 'implementation' or "
- "'user' at %C");
+ gfc_error ("expected %<construct%>, %<device%>, %<implementation%> "
+ "or %<user%> at %C");
return MATCH_ERROR;
}
m = gfc_match (" =");
if (m != MATCH_YES)
{
- gfc_error ("expected '=' at %C");
+ gfc_error ("expected %<=%> at %C");
return MATCH_ERROR;
}
m = gfc_match (" {");
if (m != MATCH_YES)
{
- gfc_error ("expected '{' at %C");
+ gfc_error ("expected %<{%> at %C");
return MATCH_ERROR;
}
@@ -5191,7 +5598,7 @@ gfc_match_omp_context_selector_specification (gfc_omp_declare_variant *odv)
m = gfc_match (" }");
if (m != MATCH_YES)
{
- gfc_error ("expected '}' at %C");
+ gfc_error ("expected %<}%> at %C");
return MATCH_ERROR;
}
@@ -5213,7 +5620,7 @@ gfc_match_omp_declare_variant (void)
if (gfc_match (" (") != MATCH_YES)
{
- gfc_error ("expected '(' at %C");
+ gfc_error ("expected %<(%> at %C");
return MATCH_ERROR;
}
@@ -5261,7 +5668,7 @@ gfc_match_omp_declare_variant (void)
if (gfc_match (" )") != MATCH_YES)
{
- gfc_error ("expected ')' at %C");
+ gfc_error ("expected %<)%> at %C");
return MATCH_ERROR;
}
@@ -5271,7 +5678,7 @@ gfc_match_omp_declare_variant (void)
{
if (first_p)
{
- gfc_error ("expected 'match' at %C");
+ gfc_error ("expected %<match%> at %C");
return MATCH_ERROR;
}
else
@@ -5280,7 +5687,7 @@ gfc_match_omp_declare_variant (void)
if (gfc_match (" (") != MATCH_YES)
{
- gfc_error ("expected '(' at %C");
+ gfc_error ("expected %<(%> at %C");
return MATCH_ERROR;
}
@@ -5289,7 +5696,7 @@ gfc_match_omp_declare_variant (void)
if (gfc_match (" )") != MATCH_YES)
{
- gfc_error ("expected ')' at %C");
+ gfc_error ("expected %<)%> at %C");
return MATCH_ERROR;
}
@@ -5385,7 +5792,8 @@ match
gfc_match_omp_parallel_do (void)
{
return match_omp (EXEC_OMP_PARALLEL_DO,
- OMP_PARALLEL_CLAUSES | OMP_DO_CLAUSES);
+ (OMP_PARALLEL_CLAUSES | OMP_DO_CLAUSES)
+ & ~(omp_mask (OMP_CLAUSE_NOWAIT)));
}
@@ -5393,7 +5801,8 @@ match
gfc_match_omp_parallel_do_simd (void)
{
return match_omp (EXEC_OMP_PARALLEL_DO_SIMD,
- OMP_PARALLEL_CLAUSES | OMP_DO_CLAUSES | OMP_SIMD_CLAUSES);
+ (OMP_PARALLEL_CLAUSES | OMP_DO_CLAUSES | OMP_SIMD_CLAUSES)
+ & ~(omp_mask (OMP_CLAUSE_NOWAIT)));
}
@@ -5449,7 +5858,8 @@ match
gfc_match_omp_parallel_sections (void)
{
return match_omp (EXEC_OMP_PARALLEL_SECTIONS,
- OMP_PARALLEL_CLAUSES | OMP_SECTIONS_CLAUSES);
+ (OMP_PARALLEL_CLAUSES | OMP_SECTIONS_CLAUSES)
+ & ~(omp_mask (OMP_CLAUSE_NOWAIT)));
}
@@ -5935,8 +6345,8 @@ gfc_match_omp_teams_distribute_parallel_do (void)
return match_omp (EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO,
(OMP_TEAMS_CLAUSES | OMP_DISTRIBUTE_CLAUSES
| OMP_PARALLEL_CLAUSES | OMP_DO_CLAUSES)
- & ~(omp_mask (OMP_CLAUSE_ORDERED))
- & ~(omp_mask (OMP_CLAUSE_LINEAR)));
+ & ~(omp_mask (OMP_CLAUSE_ORDERED)
+ | OMP_CLAUSE_LINEAR | OMP_CLAUSE_NOWAIT));
}
@@ -5946,7 +6356,8 @@ gfc_match_omp_teams_distribute_parallel_do_simd (void)
return match_omp (EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD,
(OMP_TEAMS_CLAUSES | OMP_DISTRIBUTE_CLAUSES
| OMP_PARALLEL_CLAUSES | OMP_DO_CLAUSES
- | OMP_SIMD_CLAUSES) & ~(omp_mask (OMP_CLAUSE_ORDERED)));
+ | OMP_SIMD_CLAUSES)
+ & ~(omp_mask (OMP_CLAUSE_ORDERED) | OMP_CLAUSE_NOWAIT));
}
@@ -5962,14 +6373,7 @@ gfc_match_omp_teams_distribute_simd (void)
match
gfc_match_omp_workshare (void)
{
- if (gfc_match_omp_eos () != MATCH_YES)
- {
- gfc_error ("Unexpected junk after $OMP WORKSHARE statement at %C");
- return MATCH_ERROR;
- }
- new_st.op = EXEC_OMP_WORKSHARE;
- new_st.ext.omp_clauses = gfc_get_omp_clauses ();
- return MATCH_YES;
+ return match_omp (EXEC_OMP_WORKSHARE, OMP_WORKSHARE_CLAUSES);
}
@@ -6273,14 +6677,8 @@ match
gfc_match_omp_end_single (void)
{
gfc_omp_clauses *c;
- if (gfc_match ("% nowait") == MATCH_YES)
- {
- new_st.op = EXEC_OMP_END_NOWAIT;
- new_st.ext.omp_bool = true;
- return MATCH_YES;
- }
- if (gfc_match_omp_clauses (&c, omp_mask (OMP_CLAUSE_COPYPRIVATE))
- != MATCH_YES)
+ if (gfc_match_omp_clauses (&c, omp_mask (OMP_CLAUSE_COPYPRIVATE)
+ | OMP_CLAUSE_NOWAIT) != MATCH_YES)
return MATCH_ERROR;
new_st.op = EXEC_OMP_END_SINGLE;
new_st.ext.omp_clauses = c;
@@ -6505,13 +6903,29 @@ resolve_omp_udr_clause (gfc_omp_namelist *n, gfc_namespace *ns,
return copy;
}
+
+/* Resolve ASSUME's and ASSUMES' assumption clauses. Note that absent/contains
+ is handled during parse time in omp_verify_merge_absent_contains. */
+
+void
+gfc_resolve_omp_assumptions (gfc_omp_assumptions *assume)
+{
+ for (gfc_expr_list *el = assume->holds; el; el = el->next)
+ if (!gfc_resolve_expr (el->expr)
+ || el->expr->ts.type != BT_LOGICAL
+ || el->expr->rank != 0)
+ gfc_error ("HOLDS expression at %L must be a scalar logical expression",
+ &el->expr->where);
+}
+
+
/* OpenMP directive resolving routines. */
static void
resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
gfc_namespace *ns, bool openacc = false)
{
- gfc_omp_namelist *n;
+ gfc_omp_namelist *n, *last;
gfc_expr_list *el;
int list;
int ifc;
@@ -6738,6 +7152,10 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
continue;
n->sym->mark = 0;
n->sym->comp_mark = 0;
+ n->sym->data_mark = 0;
+ n->sym->dev_mark = 0;
+ n->sym->gen_mark = 0;
+ n->sym->reduc_mark = 0;
if (n->sym->attr.flavor == FL_VARIABLE
|| n->sym->attr.proc_pointer
|| (!code && (!n->sym->attr.dummy || n->sym->ns != ns)))
@@ -6806,14 +7224,9 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
&& list != OMP_LIST_LASTPRIVATE
&& list != OMP_LIST_ALIGNED
&& list != OMP_LIST_DEPEND
- && (list != OMP_LIST_MAP || openacc)
&& list != OMP_LIST_FROM
&& list != OMP_LIST_TO
&& (list != OMP_LIST_REDUCTION || !openacc)
- && list != OMP_LIST_REDUCTION_INSCAN
- && list != OMP_LIST_REDUCTION_TASK
- && list != OMP_LIST_IN_REDUCTION
- && list != OMP_LIST_TASK_REDUCTION
&& list != OMP_LIST_ALLOCATE)
for (n = omp_clauses->lists[list]; n; n = n->next)
{
@@ -6825,10 +7238,58 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
for (gfc_ref *ref = n->expr->ref; ref; ref = ref->next)
if (ref->type == REF_COMPONENT)
component_ref_p = true;
- if ((!component_ref_p && n->sym->comp_mark)
- || (component_ref_p && n->sym->mark))
- gfc_error ("Symbol %qs has mixed component and non-component "
- "accesses at %L", n->sym->name, &n->where);
+ if ((list == OMP_LIST_IS_DEVICE_PTR
+ || list == OMP_LIST_HAS_DEVICE_ADDR)
+ && !component_ref_p)
+ {
+ if (n->sym->gen_mark
+ || n->sym->dev_mark
+ || n->sym->reduc_mark
+ || n->sym->mark)
+ gfc_error ("Symbol %qs present on multiple clauses at %L",
+ n->sym->name, &n->where);
+ else
+ n->sym->dev_mark = 1;
+ }
+ else if ((list == OMP_LIST_USE_DEVICE_PTR
+ || list == OMP_LIST_USE_DEVICE_ADDR
+ || list == OMP_LIST_PRIVATE
+ || list == OMP_LIST_SHARED)
+ && !component_ref_p)
+ {
+ if (n->sym->gen_mark || n->sym->dev_mark || n->sym->reduc_mark)
+ gfc_error ("Symbol %qs present on multiple clauses at %L",
+ n->sym->name, &n->where);
+ else
+ {
+ n->sym->gen_mark = 1;
+ /* Set both generic and device bits if we have
+ use_device_*(x) or shared(x). This allows us to diagnose
+ "map(x) private(x)" below. */
+ if (list != OMP_LIST_PRIVATE)
+ n->sym->dev_mark = 1;
+ }
+ }
+ else if ((list == OMP_LIST_REDUCTION
+ || list == OMP_LIST_REDUCTION_TASK
+ || list == OMP_LIST_REDUCTION_INSCAN
+ || list == OMP_LIST_IN_REDUCTION
+ || list == OMP_LIST_TASK_REDUCTION)
+ && !component_ref_p)
+ {
+ /* Attempts to mix reduction types are diagnosed below. */
+ if (n->sym->gen_mark || n->sym->dev_mark)
+ gfc_error ("Symbol %qs present on multiple clauses at %L",
+ n->sym->name, &n->where);
+ n->sym->reduc_mark = 1;
+ }
+ else if ((!component_ref_p && n->sym->comp_mark)
+ || (component_ref_p && n->sym->mark))
+ {
+ if (openacc)
+ gfc_error ("Symbol %qs has mixed component and non-component "
+ "accesses at %L", n->sym->name, &n->where);
+ }
else if (n->sym->mark)
gfc_error ("Symbol %qs present on multiple clauses at %L",
n->sym->name, &n->where);
@@ -6841,34 +7302,62 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
}
}
+ /* Detect specifically the case where we have "map(x) private(x)" and raise
+ an error. If we have "...simd" combined directives though, the "private"
+ applies to the simd part, so this is permitted though. */
+ for (n = omp_clauses->lists[OMP_LIST_PRIVATE]; n; n = n->next)
+ if (n->sym->mark
+ && n->sym->gen_mark
+ && !n->sym->dev_mark
+ && !n->sym->reduc_mark
+ && code->op != EXEC_OMP_TARGET_SIMD
+ && code->op != EXEC_OMP_TARGET_PARALLEL_DO_SIMD
+ && code->op != EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD
+ && code->op != EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD)
+ gfc_error ("Symbol %qs present on multiple clauses at %L",
+ n->sym->name, &n->where);
+
gcc_assert (OMP_LIST_LASTPRIVATE == OMP_LIST_FIRSTPRIVATE + 1);
for (list = OMP_LIST_FIRSTPRIVATE; list <= OMP_LIST_LASTPRIVATE; list++)
for (n = omp_clauses->lists[list]; n; n = n->next)
- if (n->sym->mark)
+ if (n->sym->data_mark || n->sym->gen_mark || n->sym->dev_mark)
{
gfc_error ("Symbol %qs present on multiple clauses at %L",
n->sym->name, &n->where);
- n->sym->mark = 0;
- }
+ n->sym->data_mark = n->sym->gen_mark = n->sym->dev_mark = 0;
+ }
+ else if (n->sym->mark
+ && code->op != EXEC_OMP_TARGET_TEAMS
+ && code->op != EXEC_OMP_TARGET_TEAMS_DISTRIBUTE
+ && code->op != EXEC_OMP_TARGET_TEAMS_LOOP
+ && code->op != EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD
+ && code->op != EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO
+ && code->op != EXEC_OMP_TARGET_PARALLEL
+ && code->op != EXEC_OMP_TARGET_PARALLEL_DO
+ && code->op != EXEC_OMP_TARGET_PARALLEL_LOOP
+ && code->op != EXEC_OMP_TARGET_PARALLEL_DO_SIMD
+ && code->op != EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD)
+ gfc_error ("Symbol %qs present on both data and map clauses "
+ "at %L", n->sym->name, &n->where);
for (n = omp_clauses->lists[OMP_LIST_FIRSTPRIVATE]; n; n = n->next)
{
- if (n->sym->mark)
+ if (n->sym->data_mark || n->sym->gen_mark || n->sym->dev_mark)
gfc_error ("Symbol %qs present on multiple clauses at %L",
n->sym->name, &n->where);
else
- n->sym->mark = 1;
+ n->sym->data_mark = 1;
}
for (n = omp_clauses->lists[OMP_LIST_LASTPRIVATE]; n; n = n->next)
- n->sym->mark = 0;
+ n->sym->data_mark = 0;
for (n = omp_clauses->lists[OMP_LIST_LASTPRIVATE]; n; n = n->next)
{
- if (n->sym->mark)
+ if (n->sym->data_mark || n->sym->gen_mark || n->sym->dev_mark)
gfc_error ("Symbol %qs present on multiple clauses at %L",
n->sym->name, &n->where);
else
- n->sym->mark = 1;
+ n->sym->data_mark = 1;
}
for (n = omp_clauses->lists[OMP_LIST_ALIGNED]; n; n = n->next)
@@ -6886,19 +7375,37 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
if (omp_clauses->lists[OMP_LIST_ALLOCATE])
{
for (n = omp_clauses->lists[OMP_LIST_ALLOCATE]; n; n = n->next)
- if (n->expr && (n->expr->ts.type != BT_INTEGER
- || n->expr->ts.kind != gfc_c_intptr_kind))
- {
- gfc_error ("Expected integer expression of the "
- "'omp_allocator_handle_kind' kind at %L",
- &n->expr->where);
- break;
- }
+ {
+ if (n->expr && (!gfc_resolve_expr (n->expr)
+ || n->expr->ts.type != BT_INTEGER
+ || n->expr->ts.kind != gfc_c_intptr_kind))
+ {
+ gfc_error ("Expected integer expression of the "
+ "%<omp_allocator_handle_kind%> kind at %L",
+ &n->expr->where);
+ break;
+ }
+ if (!n->u.align)
+ continue;
+ int alignment = 0;
+ if (!gfc_resolve_expr (n->u.align)
+ || n->u.align->ts.type != BT_INTEGER
+ || n->u.align->rank != 0
+ || gfc_extract_int (n->u.align, &alignment)
+ || alignment <= 0
+ || !pow2p_hwi (alignment))
+ {
+ gfc_error ("ALIGN modifier requires at %L a scalar positive "
+ "constant integer alignment expression that is a "
+ "power of two", &n->u.align->where);
+ break;
+ }
+ }
/* Check for 2 things here.
- 1. There is no duplication of variable in allocate clause.
- 2. Variable in allocate clause are also present in some
- privatization clase (non-composite case). */
+ 1. There is no duplication of variable in allocate clause.
+ 2. Variable in allocate clause are also present in some
+ privatization clase (non-composite case). */
for (n = omp_clauses->lists[OMP_LIST_ALLOCATE]; n; n = n->next)
n->sym->mark = 0;
@@ -6915,7 +7422,7 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
{
prev->next = n->next;
n->next = NULL;
- gfc_free_omp_namelist (n, 0);
+ gfc_free_omp_namelist (n, false, true);
n = prev->next;
}
continue;
@@ -6949,7 +7456,7 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
for (n = omp_clauses->lists[OMP_LIST_ALLOCATE]; n; n = n->next)
if (n->sym->mark == 1)
- gfc_error ("%qs specified in 'allocate' clause at %L but not "
+ gfc_error ("%qs specified in %<allocate%> clause at %L but not "
"in an explicit privatization clause",
n->sym->name, &n->where);
}
@@ -7007,6 +7514,9 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
}
break;
case OMP_LIST_COPYPRIVATE:
+ if (omp_clauses->nowait)
+ gfc_error ("NOWAIT clause must not be used with COPYPRIVATE "
+ "clause at %L", &n->where);
for (; n != NULL; n = n->next)
{
if (n->sym->as && n->sym->as->type == AS_ASSUMED_SIZE)
@@ -7369,30 +7879,58 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
}
break;
case OMP_LIST_IS_DEVICE_PTR:
- for (n = omp_clauses->lists[list]; n != NULL; n = n->next)
+ last = NULL;
+ for (n = omp_clauses->lists[list]; n != NULL; )
{
- if (!n->sym->attr.dummy)
- gfc_error ("Non-dummy object %qs in %s clause at %L",
- n->sym->name, name, &n->where);
- if (n->sym->attr.allocatable
- || (n->sym->ts.type == BT_CLASS
- && CLASS_DATA (n->sym)->attr.allocatable))
- gfc_error ("ALLOCATABLE object %qs in %s clause at %L",
- n->sym->name, name, &n->where);
- if (n->sym->attr.pointer
- || (n->sym->ts.type == BT_CLASS
- && CLASS_DATA (n->sym)->attr.pointer))
- gfc_error ("POINTER object %qs in %s clause at %L",
- n->sym->name, name, &n->where);
- if (n->sym->attr.value)
- gfc_error ("VALUE object %qs in %s clause at %L",
- n->sym->name, name, &n->where);
+ if (n->sym->ts.type == BT_DERIVED
+ && n->sym->ts.u.derived->ts.is_iso_c
+ && code->op != EXEC_OMP_TARGET)
+ /* Non-TARGET (i.e. DISPATCH) requires a C_PTR. */
+ gfc_error ("List item %qs in %s clause at %L must be of "
+ "TYPE(C_PTR)", n->sym->name, name, &n->where);
+ else if (n->sym->ts.type != BT_DERIVED
+ || !n->sym->ts.u.derived->ts.is_iso_c)
+ {
+ /* For TARGET, non-C_PTR are deprecated and handled as
+ has_device_addr. */
+ gfc_omp_namelist *n2 = n;
+ n = n->next;
+ if (last)
+ last->next = n;
+ else
+ omp_clauses->lists[list] = n;
+ n2->next = omp_clauses->lists[OMP_LIST_HAS_DEVICE_ADDR];
+ omp_clauses->lists[OMP_LIST_HAS_DEVICE_ADDR] = n2;
+ continue;
+ }
+ last = n;
+ n = n->next;
}
break;
case OMP_LIST_HAS_DEVICE_ADDR:
- case OMP_LIST_USE_DEVICE_PTR:
case OMP_LIST_USE_DEVICE_ADDR:
- /* FIXME: Handle OMP_LIST_USE_DEVICE_PTR. */
+ break;
+ case OMP_LIST_USE_DEVICE_PTR:
+ /* Non-C_PTR are deprecated and handled as use_device_ADDR. */
+ last = NULL;
+ for (n = omp_clauses->lists[list]; n != NULL; )
+ {
+ gfc_omp_namelist *n2 = n;
+ if (n->sym->ts.type != BT_DERIVED
+ || !n->sym->ts.u.derived->ts.is_iso_c)
+ {
+ n = n->next;
+ if (last)
+ last->next = n;
+ else
+ omp_clauses->lists[list] = n;
+ n2->next = omp_clauses->lists[OMP_LIST_USE_DEVICE_ADDR];
+ omp_clauses->lists[OMP_LIST_USE_DEVICE_ADDR] = n2;
+ continue;
+ }
+ last = n;
+ n = n->next;
+ }
break;
default:
for (; n != NULL; n = n->next)
@@ -7758,7 +8296,7 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
&omp_clauses->num_teams_lower->where,
&omp_clauses->num_teams_upper->where);
if (omp_clauses->device)
- resolve_nonnegative_int_expr (omp_clauses->device, "DEVICE");
+ resolve_scalar_int_expr (omp_clauses->device, "DEVICE");
if (omp_clauses->filter)
resolve_nonnegative_int_expr (omp_clauses->filter, "FILTER");
if (omp_clauses->hint)
@@ -7860,6 +8398,9 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses,
gfc_error ("%<DETACH%> clause at %L must not be used together with "
"%<MERGEABLE%> clause", &omp_clauses->detach->where);
}
+
+ if (omp_clauses->assume)
+ gfc_resolve_omp_assumptions (omp_clauses->assume);
}
@@ -8584,28 +9125,32 @@ gfc_resolve_omp_parallel_blocks (gfc_code *code, gfc_namespace *ns)
{
case EXEC_OMP_DISTRIBUTE_PARALLEL_DO:
case EXEC_OMP_DISTRIBUTE_PARALLEL_DO_SIMD:
+ case EXEC_OMP_MASKED_TASKLOOP:
+ case EXEC_OMP_MASKED_TASKLOOP_SIMD:
+ case EXEC_OMP_MASTER_TASKLOOP:
+ case EXEC_OMP_MASTER_TASKLOOP_SIMD:
case EXEC_OMP_PARALLEL_DO:
case EXEC_OMP_PARALLEL_DO_SIMD:
+ case EXEC_OMP_PARALLEL_LOOP:
case EXEC_OMP_PARALLEL_MASKED_TASKLOOP:
case EXEC_OMP_PARALLEL_MASKED_TASKLOOP_SIMD:
case EXEC_OMP_PARALLEL_MASTER_TASKLOOP:
case EXEC_OMP_PARALLEL_MASTER_TASKLOOP_SIMD:
- case EXEC_OMP_MASKED_TASKLOOP:
- case EXEC_OMP_MASKED_TASKLOOP_SIMD:
- case EXEC_OMP_MASTER_TASKLOOP:
- case EXEC_OMP_MASTER_TASKLOOP_SIMD:
case EXEC_OMP_TARGET_PARALLEL_DO:
case EXEC_OMP_TARGET_PARALLEL_DO_SIMD:
+ case EXEC_OMP_TARGET_PARALLEL_LOOP:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD:
+ case EXEC_OMP_TARGET_TEAMS_LOOP:
case EXEC_OMP_TASKLOOP:
case EXEC_OMP_TASKLOOP_SIMD:
case EXEC_OMP_TEAMS_DISTRIBUTE:
case EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO:
case EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD:
case EXEC_OMP_TEAMS_DISTRIBUTE_SIMD:
+ case EXEC_OMP_TEAMS_LOOP:
gfc_resolve_omp_do_blocks (code, ns);
break;
default:
@@ -8684,6 +9229,7 @@ gfc_resolve_do_iterator (gfc_code *code, gfc_symbol *sym, bool add_clause)
p = gfc_get_omp_namelist ();
p->sym = sym;
+ p->where = omp_current_ctx->code->loc;
p->next = omp_clauses->lists[OMP_LIST_PRIVATE];
omp_clauses->lists[OMP_LIST_PRIVATE] = p;
}
@@ -9088,6 +9634,8 @@ omp_code_to_statement (gfc_code *code)
return ST_OMP_DO;
case EXEC_OMP_LOOP:
return ST_OMP_LOOP;
+ case EXEC_OMP_ASSUME:
+ return ST_OMP_ASSUME;
case EXEC_OMP_ATOMIC:
return ST_OMP_ATOMIC;
case EXEC_OMP_BARRIER:
@@ -9607,6 +10155,7 @@ gfc_resolve_omp_directive (gfc_code *code, gfc_namespace *ns)
case EXEC_OMP_TEAMS_LOOP:
resolve_omp_do (code);
break;
+ case EXEC_OMP_ASSUME:
case EXEC_OMP_CANCEL:
case EXEC_OMP_ERROR:
case EXEC_OMP_MASKED:
diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc
index 08afb78..27311961 100644
--- a/gcc/fortran/options.cc
+++ b/gcc/fortran/options.cc
@@ -1,5 +1,5 @@
/* Parse and display command line options.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
diff --git a/gcc/fortran/parse.cc b/gcc/fortran/parse.cc
index 5b13441..f1e55316 100644
--- a/gcc/fortran/parse.cc
+++ b/gcc/fortran/parse.cc
@@ -1,5 +1,5 @@
/* Main parser.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -885,6 +885,11 @@ decode_omp_directive (void)
switch (c)
{
case 'a':
+ /* For -fopenmp-simd, ignore 'assumes'; note no clause starts with 's'. */
+ if (!flag_openmp && gfc_match ("assumes") == MATCH_YES)
+ break;
+ matcho ("assumes", gfc_match_omp_assumes, ST_OMP_ASSUMES);
+ matchs ("assume", gfc_match_omp_assume, ST_OMP_ASSUME);
matcho ("atomic", gfc_match_omp_atomic, ST_OMP_ATOMIC);
break;
case 'b':
@@ -913,6 +918,7 @@ decode_omp_directive (void)
break;
case 'e':
matcho ("error", gfc_match_omp_error, ST_OMP_ERROR);
+ matchs ("end assume", gfc_match_omp_eos_error, ST_OMP_END_ASSUME);
matcho ("end atomic", gfc_match_omp_eos_error, ST_OMP_END_ATOMIC);
matcho ("end critical", gfc_match_omp_end_critical, ST_OMP_END_CRITICAL);
matchs ("end distribute parallel do simd", gfc_match_omp_eos_error,
@@ -924,7 +930,7 @@ decode_omp_directive (void)
matcho ("end distribute", gfc_match_omp_eos_error, ST_OMP_END_DISTRIBUTE);
matchs ("end do simd", gfc_match_omp_end_nowait, ST_OMP_END_DO_SIMD);
matcho ("end do", gfc_match_omp_end_nowait, ST_OMP_END_DO);
- matcho ("end loop", gfc_match_omp_eos_error, ST_OMP_END_LOOP);
+ matchs ("end loop", gfc_match_omp_eos_error, ST_OMP_END_LOOP);
matchs ("end simd", gfc_match_omp_eos_error, ST_OMP_END_SIMD);
matcho ("end masked taskloop simd", gfc_match_omp_eos_error,
ST_OMP_END_MASKED_TASKLOOP_SIMD);
@@ -939,7 +945,8 @@ decode_omp_directive (void)
matchs ("end ordered", gfc_match_omp_eos_error, ST_OMP_END_ORDERED);
matchs ("end parallel do simd", gfc_match_omp_eos_error,
ST_OMP_END_PARALLEL_DO_SIMD);
- matcho ("end parallel do", gfc_match_omp_eos_error, ST_OMP_END_PARALLEL_DO);
+ matcho ("end parallel do", gfc_match_omp_eos_error,
+ ST_OMP_END_PARALLEL_DO);
matcho ("end parallel loop", gfc_match_omp_eos_error,
ST_OMP_END_PARALLEL_LOOP);
matcho ("end parallel masked taskloop simd", gfc_match_omp_eos_error,
@@ -1023,7 +1030,7 @@ decode_omp_directive (void)
matcho ("nothing", gfc_match_omp_nothing, ST_NONE);
break;
case 'l':
- matcho ("loop", gfc_match_omp_loop, ST_OMP_LOOP);
+ matchs ("loop", gfc_match_omp_loop, ST_OMP_LOOP);
break;
case 'o':
if (gfc_match ("ordered depend (") == MATCH_YES
@@ -1070,7 +1077,7 @@ decode_omp_directive (void)
matcho ("requires", gfc_match_omp_requires, ST_OMP_REQUIRES);
break;
case 's':
- matcho ("scan", gfc_match_omp_scan, ST_OMP_SCAN);
+ matchs ("scan", gfc_match_omp_scan, ST_OMP_SCAN);
matcho ("scope", gfc_match_omp_scope, ST_OMP_SCOPE);
matcho ("sections", gfc_match_omp_sections, ST_OMP_SECTIONS);
matcho ("section", gfc_match_omp_eos_error, ST_OMP_SECTION);
@@ -1716,6 +1723,7 @@ next_statement (void)
case ST_OMP_TARGET_SIMD: case ST_OMP_TASKLOOP: case ST_OMP_TASKLOOP_SIMD: \
case ST_OMP_LOOP: case ST_OMP_PARALLEL_LOOP: case ST_OMP_TEAMS_LOOP: \
case ST_OMP_TARGET_PARALLEL_LOOP: case ST_OMP_TARGET_TEAMS_LOOP: \
+ case ST_OMP_ASSUME: \
case ST_CRITICAL: \
case ST_OACC_PARALLEL_LOOP: case ST_OACC_PARALLEL: case ST_OACC_KERNELS: \
case ST_OACC_DATA: case ST_OACC_HOST_DATA: case ST_OACC_LOOP: \
@@ -1733,7 +1741,7 @@ next_statement (void)
#define case_omp_decl case ST_OMP_THREADPRIVATE: case ST_OMP_DECLARE_SIMD: \
case ST_OMP_DECLARE_TARGET: case ST_OMP_DECLARE_REDUCTION: \
- case ST_OMP_DECLARE_VARIANT: \
+ case ST_OMP_DECLARE_VARIANT: case ST_OMP_ASSUMES: \
case ST_OMP_REQUIRES: case ST_OACC_ROUTINE: case ST_OACC_DECLARE
/* Block end statements. Errors associated with interchanging these
@@ -1925,10 +1933,11 @@ gfc_enclosing_unit (gfc_compile_state * result)
}
-/* Translate a statement enum to a string. */
+/* Translate a statement enum to a string. If strip_sentinel is true,
+ the !$OMP/!$ACC sentinel is excluded. */
const char *
-gfc_ascii_statement (gfc_statement st)
+gfc_ascii_statement (gfc_statement st, bool strip_sentinel)
{
const char *p;
@@ -2353,6 +2362,12 @@ gfc_ascii_statement (gfc_statement st)
case ST_OACC_END_ATOMIC:
p = "!$ACC END ATOMIC";
break;
+ case ST_OMP_ASSUME:
+ p = "!$OMP ASSUME";
+ break;
+ case ST_OMP_ASSUMES:
+ p = "!$OMP ASSUMES";
+ break;
case ST_OMP_ATOMIC:
p = "!$OMP ATOMIC";
break;
@@ -2401,6 +2416,9 @@ gfc_ascii_statement (gfc_statement st)
case ST_OMP_DO_SIMD:
p = "!$OMP DO SIMD";
break;
+ case ST_OMP_END_ASSUME:
+ p = "!$OMP END ASSUME";
+ break;
case ST_OMP_END_ATOMIC:
p = "!$OMP END ATOMIC";
break;
@@ -2600,6 +2618,10 @@ gfc_ascii_statement (gfc_statement st)
case ST_OMP_ORDERED_DEPEND:
p = "!$OMP ORDERED";
break;
+ case ST_OMP_NOTHING:
+ /* Note: gfc_match_omp_nothing returns ST_NONE. */
+ p = "!$OMP NOTHING";
+ break;
case ST_OMP_PARALLEL:
p = "!$OMP PARALLEL";
break;
@@ -2751,6 +2773,8 @@ gfc_ascii_statement (gfc_statement st)
gfc_internal_error ("gfc_ascii_statement(): Bad statement code");
}
+ if (strip_sentinel && p[0] == '!')
+ return p + strlen ("!$OMP ");
return p;
}
@@ -3913,7 +3937,7 @@ match_deferred_characteristics (gfc_typespec * ts)
m = gfc_match_prefix (ts);
gfc_buffer_error (false);
- if (ts->type == BT_DERIVED)
+ if (ts->type == BT_DERIVED || ts->type == BT_CLASS)
{
ts->kind = 0;
@@ -3950,21 +3974,30 @@ match_deferred_characteristics (gfc_typespec * ts)
For return types specified in a FUNCTION prefix, the IMPLICIT rules of the
scope are not yet parsed so this has to be delayed up to parse_spec. */
-static void
+static bool
check_function_result_typed (void)
{
gfc_typespec ts;
gcc_assert (gfc_current_state () == COMP_FUNCTION);
- if (!gfc_current_ns->proc_name->result) return;
+ if (!gfc_current_ns->proc_name->result)
+ return true;
ts = gfc_current_ns->proc_name->result->ts;
/* Check type-parameters, at the moment only CHARACTER lengths possible. */
/* TODO: Extend when KIND type parameters are implemented. */
if (ts.type == BT_CHARACTER && ts.u.cl && ts.u.cl->length)
- gfc_expr_check_typed (ts.u.cl->length, gfc_current_ns, true);
+ {
+ /* Reject invalid type of specification expression for length. */
+ if (ts.u.cl->length->ts.type != BT_INTEGER)
+ return false;
+
+ gfc_expr_check_typed (ts.u.cl->length, gfc_current_ns, true);
+ }
+
+ return true;
}
@@ -3994,7 +4027,7 @@ parse_spec (gfc_statement st)
gfc_symbol* proc = gfc_current_ns->proc_name;
gcc_assert (proc);
- if (proc->result->ts.type == BT_UNKNOWN)
+ if (proc->result && proc->result->ts.type == BT_UNKNOWN)
function_result_typed = true;
}
@@ -4072,10 +4105,7 @@ loop:
}
if (verify_now)
- {
- check_function_result_typed ();
- function_result_typed = true;
- }
+ function_result_typed = check_function_result_typed ();
}
switch (st)
@@ -4086,10 +4116,7 @@ loop:
case ST_IMPLICIT_NONE:
case ST_IMPLICIT:
if (!function_result_typed)
- {
- check_function_result_typed ();
- function_result_typed = true;
- }
+ function_result_typed = check_function_result_typed ();
goto declSt;
case ST_FORMAT:
@@ -4194,7 +4221,7 @@ declSt:
if (bad_characteristic)
{
ts = &gfc_current_block ()->result->ts;
- if (ts->type != BT_DERIVED)
+ if (ts->type != BT_DERIVED && ts->type != BT_CLASS)
gfc_error ("Bad kind expression for function %qs at %L",
gfc_current_block ()->name,
&gfc_current_block ()->declared_at);
@@ -5285,7 +5312,13 @@ parse_omp_do (gfc_statement omp_st)
if (st == omp_end_st)
{
if (new_st.op == EXEC_OMP_END_NOWAIT)
- cp->ext.omp_clauses->nowait |= new_st.ext.omp_bool;
+ {
+ if (cp->ext.omp_clauses->nowait && new_st.ext.omp_bool)
+ gfc_error_now ("Duplicated NOWAIT clause on %s and %s at %C",
+ gfc_ascii_statement (omp_st),
+ gfc_ascii_statement (omp_end_st));
+ cp->ext.omp_clauses->nowait |= new_st.ext.omp_bool;
+ }
else
gcc_assert (new_st.op == EXEC_NOP);
gfc_clear_new_st ();
@@ -5518,6 +5551,9 @@ parse_omp_structured_block (gfc_statement omp_st, bool workshare_stmts_only)
switch (omp_st)
{
+ case ST_OMP_ASSUME:
+ omp_end_st = ST_OMP_END_ASSUME;
+ break;
case ST_OMP_PARALLEL:
omp_end_st = ST_OMP_END_PARALLEL;
break;
@@ -5651,6 +5687,7 @@ parse_omp_structured_block (gfc_statement omp_st, bool workshare_stmts_only)
parse_forall_block ();
break;
+ case ST_OMP_ASSUME:
case ST_OMP_PARALLEL:
case ST_OMP_PARALLEL_MASKED:
case ST_OMP_PARALLEL_MASTER:
@@ -5721,6 +5758,10 @@ parse_omp_structured_block (gfc_statement omp_st, bool workshare_stmts_only)
switch (new_st.op)
{
case EXEC_OMP_END_NOWAIT:
+ if (cp->ext.omp_clauses->nowait && new_st.ext.omp_bool)
+ gfc_error_now ("Duplicated NOWAIT clause on %s and %s at %C",
+ gfc_ascii_statement (omp_st),
+ gfc_ascii_statement (omp_end_st));
cp->ext.omp_clauses->nowait |= new_st.ext.omp_bool;
break;
case EXEC_OMP_END_CRITICAL:
@@ -5735,8 +5776,22 @@ parse_omp_structured_block (gfc_statement omp_st, bool workshare_stmts_only)
new_st.ext.omp_name = NULL;
break;
case EXEC_OMP_END_SINGLE:
- cp->ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE]
- = new_st.ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE];
+ if (cp->ext.omp_clauses->nowait && new_st.ext.omp_clauses->nowait)
+ gfc_error_now ("Duplicated NOWAIT clause on %s and %s at %C",
+ gfc_ascii_statement (omp_st),
+ gfc_ascii_statement (omp_end_st));
+ cp->ext.omp_clauses->nowait |= new_st.ext.omp_clauses->nowait;
+ if (cp->ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE])
+ {
+ gfc_omp_namelist *nl;
+ for (nl = cp->ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE];
+ nl->next; nl = nl->next)
+ ;
+ nl->next = new_st.ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE];
+ }
+ else
+ cp->ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE]
+ = new_st.ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE];
new_st.ext.omp_clauses->lists[OMP_LIST_COPYPRIVATE] = NULL;
gfc_free_omp_clauses (new_st.ext.omp_clauses);
break;
@@ -5874,6 +5929,7 @@ parse_executable (gfc_statement st)
parse_oacc_structured_block (st);
break;
+ case ST_OMP_ASSUME:
case ST_OMP_PARALLEL:
case ST_OMP_PARALLEL_MASKED:
case ST_OMP_PARALLEL_MASTER:
@@ -6452,7 +6508,6 @@ parse_module (void)
{
gfc_statement st;
gfc_gsymbol *s;
- bool error;
s = gfc_get_gsymbol (gfc_new_block->name, false);
if (s->defined || (s->type != GSYM_UNKNOWN && s->type != GSYM_MODULE))
@@ -6475,7 +6530,6 @@ parse_module (void)
st = parse_spec (ST_NONE);
- error = false;
loop:
switch (st)
{
@@ -6494,16 +6548,11 @@ loop:
default:
gfc_error ("Unexpected %s statement in MODULE at %C",
gfc_ascii_statement (st));
-
- error = true;
reject_statement ();
st = next_statement ();
goto loop;
}
-
- /* Make sure not to free the namespace twice on error. */
- if (!error)
- s->ns = gfc_current_ns;
+ s->ns = gfc_current_ns;
}
diff --git a/gcc/fortran/parse.h b/gcc/fortran/parse.h
index 7ddea10..75aac8b 100644
--- a/gcc/fortran/parse.h
+++ b/gcc/fortran/parse.h
@@ -1,5 +1,5 @@
/* Parser header
- Copyright (C) 2003-2022 Free Software Foundation, Inc.
+ Copyright (C) 2003-2023 Free Software Foundation, Inc.
Contributed by Steven Bosscher
This file is part of GCC.
@@ -66,7 +66,7 @@ extern gfc_state_data *gfc_state_stack;
int gfc_check_do_variable (gfc_symtree *);
bool gfc_find_state (gfc_compile_state);
gfc_state_data *gfc_enclosing_unit (gfc_compile_state *);
-const char *gfc_ascii_statement (gfc_statement);
+const char *gfc_ascii_statement (gfc_statement, bool strip_sentinel = false) ;
match gfc_match_enum (void);
match gfc_match_enumerator_def (void);
void gfc_free_enum_history (void);
diff --git a/gcc/fortran/primary.cc b/gcc/fortran/primary.cc
index 19f2e78..00d35a7 100644
--- a/gcc/fortran/primary.cc
+++ b/gcc/fortran/primary.cc
@@ -1,5 +1,5 @@
/* Primary expression subroutines
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -586,7 +586,7 @@ match_real_constant (gfc_expr **result, int signflag)
if (c == 'q')
{
- if (!gfc_notify_std (GFC_STD_GNU, "exponent-letter 'q' in "
+ if (!gfc_notify_std (GFC_STD_GNU, "exponent-letter %<q%> in "
"real-literal-constant at %C"))
return MATCH_ERROR;
else if (warn_real_q_constant)
@@ -2070,8 +2070,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag,
|| (sym->ts.type == BT_CLASS && CLASS_DATA (sym)
&& CLASS_DATA (sym)->attr.dimension))
{
- gfc_error ("Array section designator, e.g. '(:)', is required "
- "besides the coarray designator '[...]' at %C");
+ gfc_error ("Array section designator, e.g. %<(:)%>, is required "
+ "besides the coarray designator %<[...]%> at %C");
return MATCH_ERROR;
}
if ((sym->ts.type != BT_CLASS && !sym->attr.codimension)
@@ -2640,7 +2640,6 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts)
codimension = CLASS_DATA (sym)->attr.codimension;
pointer = CLASS_DATA (sym)->attr.class_pointer;
allocatable = CLASS_DATA (sym)->attr.allocatable;
- optional |= CLASS_DATA (sym)->attr.optional;
}
else
{
@@ -2770,7 +2769,7 @@ gfc_expr_attr (gfc_expr *e)
{
gfc_symbol *sym = e->value.function.esym->result;
attr = sym->attr;
- if (sym->ts.type == BT_CLASS)
+ if (sym->ts.type == BT_CLASS && sym->attr.class_ok)
{
attr.dimension = CLASS_DATA (sym)->attr.dimension;
attr.pointer = CLASS_DATA (sym)->attr.class_pointer;
@@ -4076,8 +4075,14 @@ match_variable (gfc_expr **result, int equiv_flag, int host_flag)
gfc_error ("Named constant at %C in an EQUIVALENCE");
return MATCH_ERROR;
}
- /* Otherwise this is checked for and an error given in the
- variable definition context checks. */
+ if (gfc_in_match_data())
+ {
+ gfc_error ("PARAMETER %qs shall not appear in a DATA statement at %C",
+ sym->name);
+ return MATCH_ERROR;
+ }
+ /* Otherwise this is checked for an error given in the
+ variable definition context checks. */
break;
case FL_PROCEDURE:
diff --git a/gcc/fortran/resolve.cc b/gcc/fortran/resolve.cc
index ae7ebb6..f6ec76a 100644
--- a/gcc/fortran/resolve.cc
+++ b/gcc/fortran/resolve.cc
@@ -1,5 +1,5 @@
/* Perform type resolution on the various structures.
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -514,7 +514,7 @@ gfc_resolve_formal_arglist (gfc_symbol *proc)
{
/* F03:C1263 (R1238) The function-name and each dummy-arg-name
shall be specified, explicitly or implicitly, to be scalar. */
- gfc_error ("Argument '%s' of statement function '%s' at %L "
+ gfc_error ("Argument %qs of statement function %qs at %L "
"must be scalar", sym->name, proc->name,
&proc->declared_at);
continue;
@@ -953,9 +953,15 @@ resolve_common_vars (gfc_common_head *common_block, bool named_common)
{
gsym = gfc_find_gsymbol (gfc_gsym_root, csym->name);
if (gsym && (gsym->type == GSYM_MODULE || gsym->type == GSYM_PROGRAM))
- gfc_error_now ("Global entity %qs at %L cannot appear in a "
- "COMMON block at %L", gsym->name,
- &gsym->where, &csym->common_block->where);
+ {
+ if (csym->common_block)
+ gfc_error_now ("Global entity %qs at %L cannot appear in a "
+ "COMMON block at %L", gsym->name,
+ &gsym->where, &csym->common_block->where);
+ else
+ gfc_error_now ("Global entity %qs at %L cannot appear in a "
+ "COMMON block", gsym->name, &gsym->where);
+ }
/* gfc_add_in_common may have been called before, but the reported errors
have been ignored to continue parsing.
@@ -1664,9 +1670,11 @@ check_assumed_size_reference (gfc_symbol *sym, gfc_expr *e)
/* FIXME: The comparison "e->ref->u.ar.type == AR_FULL" is wrong.
What should it be? */
- if (e->ref && (e->ref->u.ar.end[e->ref->u.ar.as->rank - 1] == NULL)
- && (e->ref->u.ar.as->type == AS_ASSUMED_SIZE)
- && (e->ref->u.ar.type == AR_FULL))
+ if (e->ref
+ && e->ref->u.ar.as
+ && (e->ref->u.ar.end[e->ref->u.ar.as->rank - 1] == NULL)
+ && (e->ref->u.ar.as->type == AS_ASSUMED_SIZE)
+ && (e->ref->u.ar.type == AR_FULL))
{
gfc_error ("The upper bound in the last dimension must "
"appear in the reference to the assumed size "
@@ -3470,6 +3478,24 @@ resolve_function (gfc_expr *expr)
expr->ts = expr->symtree->n.sym->result->ts;
}
+ /* These derived types with an incomplete namespace, arising from use
+ association, cause gfc_get_derived_vtab to segfault. If the function
+ namespace does not suffice, something is badly wrong. */
+ if (expr->ts.type == BT_DERIVED
+ && !expr->ts.u.derived->ns->proc_name)
+ {
+ gfc_symbol *der;
+ gfc_find_symbol (expr->ts.u.derived->name, expr->symtree->n.sym->ns, 1, &der);
+ if (der)
+ {
+ expr->ts.u.derived->refs--;
+ expr->ts.u.derived = der;
+ der->refs++;
+ }
+ else
+ expr->ts.u.derived->ns = expr->symtree->n.sym->ns;
+ }
+
if (!expr->ref && !expr->value.function.isym)
{
if (expr->value.function.esym)
@@ -4381,8 +4407,8 @@ resolve_operator (gfc_expr *e)
guessed = lookup_uop_fuzzy (name, e->value.op.uop->ns->uop_root);
if (guessed)
snprintf (msg, sizeof (msg),
- _("Unknown operator %%<%s%%> at %%L; did you mean '%s'?"),
- name, guessed);
+ _("Unknown operator %%<%s%%> at %%L; did you mean "
+ "%%<%s%%>?"), name, guessed);
else
snprintf (msg, sizeof (msg), _("Unknown operator %%<%s%%> at %%L"),
name);
@@ -4575,12 +4601,11 @@ compare_bound_int (gfc_expr *a, int b)
{
int i;
- if (a == NULL || a->expr_type != EXPR_CONSTANT)
+ if (a == NULL
+ || a->expr_type != EXPR_CONSTANT
+ || a->ts.type != BT_INTEGER)
return CMP_UNKNOWN;
- if (a->ts.type != BT_INTEGER)
- gfc_internal_error ("compare_bound_int(): Bad expression");
-
i = mpz_cmp_si (a->value.integer, b);
if (i < 0)
@@ -4598,12 +4623,11 @@ compare_bound_mpz_t (gfc_expr *a, mpz_t b)
{
int i;
- if (a == NULL || a->expr_type != EXPR_CONSTANT)
+ if (a == NULL
+ || a->expr_type != EXPR_CONSTANT
+ || a->ts.type != BT_INTEGER)
return CMP_UNKNOWN;
- if (a->ts.type != BT_INTEGER)
- gfc_internal_error ("compare_bound_int(): Bad expression");
-
i = mpz_cmp (a->value.integer, b);
if (i < 0)
@@ -4733,23 +4757,24 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
#define AR_END (ar->end[i] ? ar->end[i] : as->upper[i])
compare_result comp_start_end = compare_bound (AR_START, AR_END);
+ compare_result comp_stride_zero = compare_bound_int (ar->stride[i], 0);
/* Check for zero stride, which is not allowed. */
- if (compare_bound_int (ar->stride[i], 0) == CMP_EQ)
+ if (comp_stride_zero == CMP_EQ)
{
gfc_error ("Illegal stride of zero at %L", &ar->c_where[i]);
return false;
}
- /* if start == len || (stride > 0 && start < len)
- || (stride < 0 && start > len),
+ /* if start == end || (stride > 0 && start < end)
+ || (stride < 0 && start > end),
then the array section contains at least one element. In this
case, there is an out-of-bounds access if
(start < lower || start > upper). */
- if (compare_bound (AR_START, AR_END) == CMP_EQ
- || ((compare_bound_int (ar->stride[i], 0) == CMP_GT
- || ar->stride[i] == NULL) && comp_start_end == CMP_LT)
- || (compare_bound_int (ar->stride[i], 0) == CMP_LT
+ if (comp_start_end == CMP_EQ
+ || ((comp_stride_zero == CMP_GT || ar->stride[i] == NULL)
+ && comp_start_end == CMP_LT)
+ || (comp_stride_zero == CMP_LT
&& comp_start_end == CMP_GT))
{
if (compare_bound (AR_START, as->lower[i]) == CMP_LT)
@@ -5005,8 +5030,9 @@ find_array_spec (gfc_expr *e)
case REF_ARRAY:
if (as == NULL)
{
+ locus loc = ref->u.ar.where.lb ? ref->u.ar.where : e->where;
gfc_error ("Invalid array reference of a non-array entity at %L",
- &ref->u.ar.where);
+ &loc);
return false;
}
@@ -6053,11 +6079,14 @@ resolve_procedure:
/* Checks to see that the correct symbol has been host associated.
- The only situation where this arises is that in which a twice
- contained function is parsed after the host association is made.
- Therefore, on detecting this, change the symbol in the expression
- and convert the array reference into an actual arglist if the old
- symbol is a variable. */
+ The only situations where this arises are:
+ (i) That in which a twice contained function is parsed after
+ the host association is made. On detecting this, change
+ the symbol in the expression and convert the array reference
+ into an actual arglist if the old symbol is a variable; or
+ (ii) That in which an external function is typed but not declared
+ explcitly to be external. Here, the old symbol is changed
+ from a variable to an external function. */
static bool
check_host_association (gfc_expr *e)
{
@@ -6086,7 +6115,6 @@ check_host_association (gfc_expr *e)
gfc_find_symbol (e->symtree->name, gfc_current_ns, 1, &sym);
if (sym && old_sym != sym
- && sym->ts.type == old_sym->ts.type
&& sym->attr.flavor == FL_PROCEDURE
&& sym->attr.contained)
{
@@ -6131,6 +6159,9 @@ check_host_association (gfc_expr *e)
return false;
}
+ if (ref == NULL)
+ return false;
+
gcc_assert (ref->type == REF_ARRAY);
/* Grab the start expressions from the array ref and
@@ -6157,6 +6188,27 @@ check_host_association (gfc_expr *e)
gfc_resolve_expr (e);
sym->refs++;
}
+ /* This case corresponds to a call, from a block or a contained
+ procedure, to an external function, which has not been declared
+ as being external in the main program but has been typed. */
+ else if (sym && old_sym != sym
+ && !e->ref
+ && sym->ts.type == BT_UNKNOWN
+ && old_sym->ts.type != BT_UNKNOWN
+ && sym->attr.flavor == FL_PROCEDURE
+ && old_sym->attr.flavor == FL_VARIABLE
+ && sym->ns->parent == old_sym->ns
+ && sym->ns->proc_name
+ && sym->ns->proc_name->attr.proc != PROC_MODULE
+ && (sym->ns->proc_name->attr.flavor == FL_LABEL
+ || sym->ns->proc_name->attr.flavor == FL_PROCEDURE))
+ {
+ old_sym->attr.flavor = FL_PROCEDURE;
+ old_sym->attr.external = 1;
+ old_sym->attr.function = 1;
+ old_sym->result = old_sym;
+ gfc_resolve_expr (e);
+ }
}
/* This might have changed! */
return e->expr_type == EXPR_FUNCTION;
@@ -7535,7 +7587,8 @@ derived_inaccessible (gfc_symbol *sym)
for (c = sym->components; c; c = c->next)
{
/* Prevent an infinite loop through this function. */
- if (c->ts.type == BT_DERIVED && c->attr.pointer
+ if (c->ts.type == BT_DERIVED
+ && (c->attr.pointer || c->attr.allocatable)
&& sym == c->ts.u.derived)
continue;
@@ -7569,7 +7622,7 @@ resolve_deallocate_expr (gfc_expr *e)
sym = e->symtree->n.sym;
unlimited = UNLIMITED_POLY(sym);
- if (sym->ts.type == BT_CLASS)
+ if (sym->ts.type == BT_CLASS && sym->attr.class_ok && CLASS_DATA (sym))
{
allocatable = CLASS_DATA (sym)->attr.allocatable;
pointer = CLASS_DATA (sym)->attr.class_pointer;
@@ -8211,7 +8264,7 @@ check_symbols:
{
if (i == (ar->dimen + ar->codimen - 1))
{
- gfc_error ("Expected '*' in coindex specification in ALLOCATE "
+ gfc_error ("Expected %<*%> in coindex specification in ALLOCATE "
"statement at %L", &e->where);
goto failure;
}
@@ -10017,6 +10070,7 @@ resolve_transfer (gfc_code *code)
if (exp == NULL || (exp->expr_type != EXPR_VARIABLE
&& exp->expr_type != EXPR_FUNCTION
+ && exp->expr_type != EXPR_ARRAY
&& exp->expr_type != EXPR_STRUCTURE))
return;
@@ -10030,6 +10084,7 @@ resolve_transfer (gfc_code *code)
const gfc_typespec *ts = exp->expr_type == EXPR_STRUCTURE
|| exp->expr_type == EXPR_FUNCTION
+ || exp->expr_type == EXPR_ARRAY
? &exp->ts : &exp->symtree->n.sym->ts;
/* Go to actual component transferred. */
@@ -10128,6 +10183,9 @@ resolve_transfer (gfc_code *code)
if (exp->expr_type == EXPR_STRUCTURE)
return;
+ if (exp->expr_type == EXPR_ARRAY)
+ return;
+
sym = exp->symtree->n.sym;
if (sym->as != NULL && sym->as->type == AS_ASSUMED_SIZE && exp->ref
@@ -10540,6 +10598,11 @@ resolve_where (gfc_code *code, gfc_expr *mask)
if (e && !resolve_where_shape (cnext->expr1, e))
gfc_error ("WHERE assignment target at %L has "
"inconsistent shape", &cnext->expr1->where);
+
+ if (cnext->op == EXEC_ASSIGN
+ && gfc_may_be_finalized (cnext->expr1->ts))
+ cnext->expr1->must_finalize = 1;
+
break;
@@ -10627,6 +10690,11 @@ gfc_resolve_where_code_in_forall (gfc_code *code, int nvar,
/* WHERE assignment statement */
case EXEC_ASSIGN:
gfc_resolve_assign_in_forall (cnext, nvar, var_expr);
+
+ if (cnext->op == EXEC_ASSIGN
+ && gfc_may_be_finalized (cnext->expr1->ts))
+ cnext->expr1->must_finalize = 1;
+
break;
/* WHERE operator assignment statement */
@@ -10673,6 +10741,11 @@ gfc_resolve_forall_body (gfc_code *code, int nvar, gfc_expr **var_expr)
case EXEC_ASSIGN:
case EXEC_POINTER_ASSIGN:
gfc_resolve_assign_in_forall (c, nvar, var_expr);
+
+ if (c->op == EXEC_ASSIGN
+ && gfc_may_be_finalized (c->expr1->ts))
+ c->expr1->must_finalize = 1;
+
break;
case EXEC_ASSIGN_CALL:
@@ -10812,15 +10885,20 @@ gfc_resolve_forall (gfc_code *code, gfc_namespace *ns, int forall_save)
/* Resolve a BLOCK construct statement. */
+static gfc_expr*
+get_temp_from_expr (gfc_expr *, gfc_namespace *);
+static gfc_code *
+build_assignment (gfc_exec_op, gfc_expr *, gfc_expr *,
+ gfc_component *, gfc_component *, locus);
static void
resolve_block_construct (gfc_code* code)
{
- /* Resolve the BLOCK's namespace. */
- gfc_resolve (code->ext.block.ns);
+ gfc_namespace *ns = code->ext.block.ns;
/* For an ASSOCIATE block, the associations (and their targets) are already
- resolved during resolve_symbol. */
+ resolved during resolve_symbol. Resolve the BLOCK's namespace. */
+ gfc_resolve (ns);
}
@@ -10902,6 +10980,7 @@ gfc_resolve_blocks (gfc_code *b, gfc_namespace *ns)
case EXEC_OACC_ENTER_DATA:
case EXEC_OACC_EXIT_DATA:
case EXEC_OACC_ROUTINE:
+ case EXEC_OMP_ASSUME:
case EXEC_OMP_CRITICAL:
case EXEC_OMP_DISTRIBUTE:
case EXEC_OMP_DISTRIBUTE_PARALLEL_DO:
@@ -11179,7 +11258,7 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
{
gfc_error ("Nonallocatable variable must not be polymorphic in intrinsic "
"assignment at %L - check that there is a matching specific "
- "subroutine for '=' operator", &lhs->where);
+ "subroutine for %<=%> operator", &lhs->where);
return false;
}
@@ -11352,6 +11431,7 @@ get_temp_from_expr (gfc_expr *e, gfc_namespace *ns)
tmp->n.sym->attr.use_assoc = 0;
tmp->n.sym->attr.intent = INTENT_UNKNOWN;
+
if (as)
{
tmp->n.sym->as = gfc_copy_array_spec (as);
@@ -11403,9 +11483,62 @@ add_code_to_chain (gfc_code **this_code, gfc_code **head, gfc_code **tail)
}
+/* Generate a final call from a variable expression */
+
+static void
+generate_final_call (gfc_expr *tmp_expr, gfc_code **head, gfc_code **tail)
+{
+ gfc_code *this_code;
+ gfc_expr *final_expr = NULL;
+ gfc_expr *size_expr;
+ gfc_expr *fini_coarray;
+
+ gcc_assert (tmp_expr->expr_type == EXPR_VARIABLE);
+ if (!gfc_is_finalizable (tmp_expr->ts.u.derived, &final_expr) || !final_expr)
+ return;
+
+ /* Now generate the finalizer call. */
+ this_code = gfc_get_code (EXEC_CALL);
+ this_code->symtree = final_expr->symtree;
+ this_code->resolved_sym = final_expr->symtree->n.sym;
+
+ //* Expression to be finalized */
+ this_code->ext.actual = gfc_get_actual_arglist ();
+ this_code->ext.actual->expr = gfc_copy_expr (tmp_expr);
+
+ /* size_expr = STORAGE_SIZE (...) / NUMERIC_STORAGE_SIZE. */
+ this_code->ext.actual->next = gfc_get_actual_arglist ();
+ size_expr = gfc_get_expr ();
+ size_expr->where = gfc_current_locus;
+ size_expr->expr_type = EXPR_OP;
+ size_expr->value.op.op = INTRINSIC_DIVIDE;
+ size_expr->value.op.op1
+ = gfc_build_intrinsic_call (gfc_current_ns, GFC_ISYM_STORAGE_SIZE,
+ "storage_size", gfc_current_locus, 2,
+ gfc_lval_expr_from_sym (tmp_expr->symtree->n.sym),
+ gfc_get_int_expr (gfc_index_integer_kind,
+ NULL, 0));
+ size_expr->value.op.op2 = gfc_get_int_expr (gfc_index_integer_kind, NULL,
+ gfc_character_storage_size);
+ size_expr->value.op.op1->ts = size_expr->value.op.op2->ts;
+ size_expr->ts = size_expr->value.op.op1->ts;
+ this_code->ext.actual->next->expr = size_expr;
+
+ /* fini_coarray */
+ this_code->ext.actual->next->next = gfc_get_actual_arglist ();
+ fini_coarray = gfc_get_constant_expr (BT_LOGICAL, gfc_default_logical_kind,
+ &tmp_expr->where);
+ fini_coarray->value.logical = (int)gfc_expr_attr (tmp_expr).codimension;
+ this_code->ext.actual->next->next->expr = fini_coarray;
+
+ add_code_to_chain (&this_code, head, tail);
+
+}
+
/* Counts the potential number of part array references that would
result from resolution of typebound defined assignments. */
+
static int
nonscalar_typebound_assign (gfc_symbol *derived, int depth)
{
@@ -11438,62 +11571,111 @@ nonscalar_typebound_assign (gfc_symbol *derived, int depth)
}
-/* Implement 7.2.1.3 of the F08 standard:
- "An intrinsic assignment where the variable is of derived type is
- performed as if each component of the variable were assigned from the
- corresponding component of expr using pointer assignment (7.2.2) for
- each pointer component, defined assignment for each nonpointer
- nonallocatable component of a type that has a type-bound defined
- assignment consistent with the component, intrinsic assignment for
- each other nonpointer nonallocatable component, ..."
+/* Implement 10.2.1.3 paragraph 13 of the F18 standard:
+ "An intrinsic assignment where the variable is of derived type is performed
+ as if each component of the variable were assigned from the corresponding
+ component of expr using pointer assignment (10.2.2) for each pointer
+ component, defined assignment for each nonpointer nonallocatable component
+ of a type that has a type-bound defined assignment consistent with the
+ component, intrinsic assignment for each other nonpointer nonallocatable
+ component, and intrinsic assignment for each allocated coarray component.
+ For unallocated coarray components, the corresponding component of the
+ variable shall be unallocated. For a noncoarray allocatable component the
+ following sequence of operations is applied.
+ (1) If the component of the variable is allocated, it is deallocated.
+ (2) If the component of the value of expr is allocated, the
+ corresponding component of the variable is allocated with the same
+ dynamic type and type parameters as the component of the value of
+ expr. If it is an array, it is allocated with the same bounds. The
+ value of the component of the value of expr is then assigned to the
+ corresponding component of the variable using defined assignment if
+ the declared type of the component has a type-bound defined
+ assignment consistent with the component, and intrinsic assignment
+ for the dynamic type of that component otherwise."
+
+ The pointer assignments are taken care of by the intrinsic assignment of the
+ structure itself. This function recursively adds defined assignments where
+ required. The recursion is accomplished by calling gfc_resolve_code.
+
+ When the lhs in a defined assignment has intent INOUT or is intent OUT
+ and the component of 'var' is finalizable, we need a temporary for the
+ lhs. In pseudo-code for an assignment var = expr:
+
+ ! Confine finalization of temporaries, as far as possible.
+ Enclose the code for the assignment in a block
+ ! Only call function 'expr' once.
+ #if ('expr is not a constant or an variable)
+ temp_expr = expr
+ expr = temp_x
+ ! Do the intrinsic assignment
+ #if typeof ('var') has a typebound final subroutine
+ finalize (var)
+ var = expr
+ ! Now do the component assignments
+ #do over derived type components [%cmp]
+ #if (cmp is a pointer of any kind)
+ continue
+ build the assignment
+ resolve the code
+ #if the code is a typebound assignment
+ #if (arg1 is INOUT or finalizable OUT && !t1)
+ t1 = var
+ arg1 = t1
+ deal with allocatation or not of var and this component
+ #elseif the code is an assignment by itself
+ #if this component does not need finalization
+ delete code and continue
+ #else
+ remove the leading assignment
+ #endif
+ commit the code
+ #if (t1 and (arg1 is INOUT or finalizable OUT))
+ var%cmp = t1%cmp
+ #enddo
+ put all code chunks involving t1 to the top of the generated code
+ insert the generated block in place of the original code
+*/
+
+static bool
+is_finalizable_type (gfc_typespec ts)
+{
+ gfc_component *c;
- The pointer assignments are taken care of by the intrinsic
- assignment of the structure itself. This function recursively adds
- defined assignments where required. The recursion is accomplished
- by calling gfc_resolve_code.
+ if (ts.type != BT_DERIVED)
+ return false;
- When the lhs in a defined assignment has intent INOUT, we need a
- temporary for the lhs. In pseudo-code:
+ /* (1) Check for FINAL subroutines. */
+ if (ts.u.derived->f2k_derived && ts.u.derived->f2k_derived->finalizers)
+ return true;
- ! Only call function lhs once.
- if (lhs is not a constant or an variable)
- temp_x = expr2
- expr2 => temp_x
- ! Do the intrinsic assignment
- expr1 = expr2
- ! Now do the defined assignments
- do over components with typebound defined assignment [%cmp]
- #if one component's assignment procedure is INOUT
- t1 = expr1
- #if expr2 non-variable
- temp_x = expr2
- expr2 => temp_x
- # endif
- expr1 = expr2
- # for each cmp
- t1%cmp {defined=} expr2%cmp
- expr1%cmp = t1%cmp
- #else
- expr1 = expr2
+ /* (2) Check for components of finalizable type. */
+ for (c = ts.u.derived->components; c; c = c->next)
+ if (c->ts.type == BT_DERIVED
+ && !c->attr.pointer && !c->attr.proc_pointer && !c->attr.allocatable
+ && c->ts.u.derived->f2k_derived
+ && c->ts.u.derived->f2k_derived->finalizers)
+ return true;
- # for each cmp
- expr1%cmp {defined=} expr2%cmp
- #endif
- */
+ return false;
+}
/* The temporary assignments have to be put on top of the additional
code to avoid the result being changed by the intrinsic assignment.
*/
static int component_assignment_level = 0;
static gfc_code *tmp_head = NULL, *tmp_tail = NULL;
+static bool finalizable_comp;
static void
generate_component_assignments (gfc_code **code, gfc_namespace *ns)
{
gfc_component *comp1, *comp2;
gfc_code *this_code = NULL, *head = NULL, *tail = NULL;
- gfc_expr *t1;
+ gfc_code *tmp_code = NULL;
+ gfc_expr *t1 = NULL;
+ gfc_expr *tmp_expr = NULL;
int error_count, depth;
+ bool finalizable_lhs;
gfc_get_errors (NULL, &error_count);
@@ -11514,19 +11696,39 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
return;
}
+ if (!component_assignment_level)
+ finalizable_comp = true;
+
+ /* Build a block so that function result temporaries are finalized
+ locally on exiting the rather than enclosing scope. */
+ if (!component_assignment_level)
+ {
+ ns = gfc_build_block_ns (ns);
+ tmp_code = gfc_get_code (EXEC_NOP);
+ *tmp_code = **code;
+ tmp_code->next = NULL;
+ (*code)->op = EXEC_BLOCK;
+ (*code)->ext.block.ns = ns;
+ (*code)->ext.block.assoc = NULL;
+ (*code)->expr1 = (*code)->expr2 = NULL;
+ ns->code = tmp_code;
+ code = &ns->code;
+ }
+
component_assignment_level++;
+ finalizable_lhs = is_finalizable_type ((*code)->expr1->ts);
+
/* Create a temporary so that functions get called only once. */
if ((*code)->expr2->expr_type != EXPR_VARIABLE
&& (*code)->expr2->expr_type != EXPR_CONSTANT)
{
- gfc_expr *tmp_expr;
-
/* Assign the rhs to the temporary. */
tmp_expr = get_temp_from_expr ((*code)->expr1, ns);
this_code = build_assignment (EXEC_ASSIGN,
tmp_expr, (*code)->expr2,
NULL, NULL, (*code)->loc);
+ this_code->expr2->must_finalize = 1;
/* Add the code and substitute the rhs expression. */
add_code_to_chain (&this_code, &tmp_head, &tmp_tail);
gfc_free_expr ((*code)->expr2);
@@ -11536,8 +11738,10 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
/* Do the intrinsic assignment. This is not needed if the lhs is one
of the temporaries generated here, since the intrinsic assignment
to the final result already does this. */
- if ((*code)->expr1->symtree->n.sym->name[2] != '@')
+ if ((*code)->expr1->symtree->n.sym->name[2] != '.')
{
+ if (finalizable_lhs)
+ (*code)->expr1->must_finalize = 1;
this_code = build_assignment (EXEC_ASSIGN,
(*code)->expr1, (*code)->expr2,
NULL, NULL, (*code)->loc);
@@ -11547,10 +11751,10 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
comp1 = (*code)->expr1->ts.u.derived->components;
comp2 = (*code)->expr2->ts.u.derived->components;
- t1 = NULL;
for (; comp1; comp1 = comp1->next, comp2 = comp2->next)
{
bool inout = false;
+ bool finalizable_out = false;
/* The intrinsic assignment does the right thing for pointers
of all kinds and allocatable components. */
@@ -11562,6 +11766,9 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
|| comp1->attr.proc_pointer)
continue;
+ finalizable_comp = is_finalizable_type (comp1->ts)
+ && !finalizable_lhs;
+
/* Make an assignment for this component. */
this_code = build_assignment (EXEC_ASSIGN,
(*code)->expr1, (*code)->expr2,
@@ -11594,8 +11801,13 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
a temporary must be generated and used instead. */
rsym = this_code->resolved_sym;
dummy_args = gfc_sym_get_dummy_args (rsym);
- if (dummy_args
- && dummy_args->sym->attr.intent == INTENT_INOUT)
+ finalizable_out = gfc_may_be_finalized (comp1->ts)
+ && dummy_args
+ && dummy_args->sym->attr.intent == INTENT_OUT;
+ inout = dummy_args
+ && dummy_args->sym->attr.intent == INTENT_INOUT;
+ if ((inout || finalizable_out)
+ && !comp1->attr.allocatable)
{
gfc_code *temp_code;
inout = true;
@@ -11604,7 +11816,11 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
it at the head of the generated code. */
if (!t1)
{
- t1 = get_temp_from_expr ((*code)->expr1, ns);
+ gfc_namespace *tmp_ns = ns;
+ if (ns->parent && gfc_may_be_finalized (comp1->ts))
+ tmp_ns = (*code)->expr1->symtree->n.sym->ns;
+ t1 = get_temp_from_expr ((*code)->expr1, tmp_ns);
+ t1->symtree->n.sym->attr.artificial = 1;
temp_code = build_assignment (EXEC_ASSIGN,
t1, (*code)->expr1,
NULL, NULL, (*code)->loc);
@@ -11666,20 +11882,38 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
else if (this_code->op == EXEC_ASSIGN && !this_code->next)
{
/* Don't add intrinsic assignments since they are already
- effected by the intrinsic assignment of the structure. */
- gfc_free_statements (this_code);
- this_code = NULL;
- continue;
+ effected by the intrinsic assignment of the structure, unless
+ finalization is required. */
+ if (finalizable_comp)
+ this_code->expr1->must_finalize = 1;
+ else
+ {
+ gfc_free_statements (this_code);
+ this_code = NULL;
+ continue;
+ }
+ }
+ else
+ {
+ /* Resolution has expanded an assignment of a derived type with
+ defined assigned components. Remove the redundant, leading
+ assignment. */
+ gcc_assert (this_code->op == EXEC_ASSIGN);
+ gfc_code *tmp = this_code;
+ this_code = this_code->next;
+ tmp->next = NULL;
+ gfc_free_statements (tmp);
}
add_code_to_chain (&this_code, &head, &tail);
- if (t1 && inout)
+ if (t1 && (inout || finalizable_out))
{
/* Transfer the value to the final result. */
this_code = build_assignment (EXEC_ASSIGN,
(*code)->expr1, t1,
comp1, comp2, (*code)->loc);
+ this_code->expr1->must_finalize = 0;
add_code_to_chain (&this_code, &head, &tail);
}
}
@@ -11692,8 +11926,8 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
tmp_head = tmp_tail = NULL;
}
- // If we did a pointer assignment - thus, we need to ensure that the LHS is
- // not accidentally deallocated. Hence, nullify t1.
+ /* If we did a pointer assignment - thus, we need to ensure that the LHS is
+ not accidentally deallocated. Hence, nullify t1. */
if (t1 && (*code)->expr1->symtree->n.sym->attr.allocatable
&& gfc_expr_attr ((*code)->expr1).allocatable)
{
@@ -11714,6 +11948,18 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
tail = block;
}
+ component_assignment_level--;
+
+ /* Make an explicit final call for the function result. */
+ if (tmp_expr)
+ generate_final_call (tmp_expr, &head, &tail);
+
+ if (tmp_code)
+ {
+ ns->code = head;
+ return;
+ }
+
/* Now attach the remaining code chain to the input code. Step on
to the end of the new code since resolution is complete. */
gcc_assert ((*code)->op == EXEC_ASSIGN);
@@ -11726,8 +11972,6 @@ generate_component_assignments (gfc_code **code, gfc_namespace *ns)
if (head != tail)
free (head);
*code = tail;
-
- component_assignment_level--;
}
@@ -11908,9 +12152,14 @@ gfc_resolve_code (gfc_code *code, gfc_namespace *ns)
break;
case EXEC_OMP_DISTRIBUTE_PARALLEL_DO:
case EXEC_OMP_DISTRIBUTE_PARALLEL_DO_SIMD:
+ case EXEC_OMP_MASKED_TASKLOOP:
+ case EXEC_OMP_MASKED_TASKLOOP_SIMD:
+ case EXEC_OMP_MASTER_TASKLOOP:
+ case EXEC_OMP_MASTER_TASKLOOP_SIMD:
case EXEC_OMP_PARALLEL:
case EXEC_OMP_PARALLEL_DO:
case EXEC_OMP_PARALLEL_DO_SIMD:
+ case EXEC_OMP_PARALLEL_LOOP:
case EXEC_OMP_PARALLEL_MASKED:
case EXEC_OMP_PARALLEL_MASKED_TASKLOOP:
case EXEC_OMP_PARALLEL_MASKED_TASKLOOP_SIMD:
@@ -11921,11 +12170,13 @@ gfc_resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_OMP_TARGET_PARALLEL:
case EXEC_OMP_TARGET_PARALLEL_DO:
case EXEC_OMP_TARGET_PARALLEL_DO_SIMD:
+ case EXEC_OMP_TARGET_PARALLEL_LOOP:
case EXEC_OMP_TARGET_TEAMS:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD:
case EXEC_OMP_TARGET_TEAMS_DISTRIBUTE_SIMD:
+ case EXEC_OMP_TARGET_TEAMS_LOOP:
case EXEC_OMP_TASK:
case EXEC_OMP_TASKLOOP:
case EXEC_OMP_TASKLOOP_SIMD:
@@ -11934,6 +12185,7 @@ gfc_resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO:
case EXEC_OMP_TEAMS_DISTRIBUTE_PARALLEL_DO_SIMD:
case EXEC_OMP_TEAMS_DISTRIBUTE_SIMD:
+ case EXEC_OMP_TEAMS_LOOP:
omp_workshare_save = omp_workshare_flag;
omp_workshare_flag = 0;
gfc_resolve_omp_parallel_blocks (code, ns);
@@ -11942,6 +12194,7 @@ gfc_resolve_code (gfc_code *code, gfc_namespace *ns)
case EXEC_OMP_DISTRIBUTE_SIMD:
case EXEC_OMP_DO:
case EXEC_OMP_DO_SIMD:
+ case EXEC_OMP_LOOP:
case EXEC_OMP_SIMD:
case EXEC_OMP_TARGET_SIMD:
gfc_resolve_omp_do_blocks (code, ns);
@@ -12138,6 +12391,14 @@ start:
&& code->expr1->ts.u.derived
&& code->expr1->ts.u.derived->attr.defined_assign_comp)
generate_component_assignments (&code, ns);
+ else if (code->op == EXEC_ASSIGN)
+ {
+ if (gfc_may_be_finalized (code->expr1->ts))
+ code->expr1->must_finalize = 1;
+ if (code->expr2->expr_type == EXPR_ARRAY
+ && gfc_may_be_finalized (code->expr2->ts))
+ code->expr2->must_finalize = 1;
+ }
break;
@@ -12376,6 +12637,7 @@ start:
gfc_resolve_oacc_directive (code, ns);
break;
+ case EXEC_OMP_ASSUME:
case EXEC_OMP_ATOMIC:
case EXEC_OMP_BARRIER:
case EXEC_OMP_CANCEL:
@@ -12960,6 +13222,7 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
&& sym->ts.u.derived
&& !sym->attr.select_type_temporary
&& !UNLIMITED_POLY (sym)
+ && CLASS_DATA (sym)->ts.u.derived
&& !gfc_type_is_extensible (CLASS_DATA (sym)->ts.u.derived))
{
gfc_error ("Type %qs of CLASS variable %qs at %L is not extensible",
@@ -13633,6 +13896,16 @@ check_formal:
}
}
}
+
+ /* F2018:15.4.2.2 requires an explicit interface for procedures with the
+ BIND(C) attribute. */
+ if (sym->attr.is_bind_c && sym->attr.if_source == IFSRC_UNKNOWN)
+ {
+ gfc_error ("Interface of %qs at %L must be explicit",
+ sym->name, &sym->declared_at);
+ return false;
+ }
+
return true;
}
@@ -13713,6 +13986,22 @@ gfc_resolve_finalizers (gfc_symbol* derived, bool *finalizable)
}
arg = dummy_args->sym;
+ if (!arg)
+ {
+ gfc_error ("Argument of FINAL procedure at %L must be of type %qs",
+ &list->proc_sym->declared_at, derived->name);
+ goto error;
+ }
+
+ if (arg->as && arg->as->type == AS_ASSUMED_RANK
+ && ((list != derived->f2k_derived->finalizers) || list->next))
+ {
+ gfc_error ("FINAL procedure at %L with assumed rank argument must "
+ "be the only finalizer with the same kind/type "
+ "(F2018: C790)", &list->where);
+ goto error;
+ }
+
/* This argument must be of our type. */
if (arg->ts.type != BT_DERIVED || arg->ts.u.derived != derived)
{
@@ -13813,7 +14102,8 @@ error:
if (warn_surprising && derived->f2k_derived->finalizers && !seen_scalar)
gfc_warning (OPT_Wsurprising,
"Only array FINAL procedures declared for derived type %qs"
- " defined at %L, suggest also scalar one",
+ " defined at %L, suggest also scalar one unless an assumed"
+ " rank finalizer has been declared",
derived->name, &derived->declared_at);
vtab = gfc_find_derived_vtab (derived);
@@ -14545,7 +14835,6 @@ check_defined_assignments (gfc_symbol *derived)
{
if (!gfc_bt_struct (c->ts.type)
|| c->attr.pointer
- || c->attr.allocatable
|| c->attr.proc_pointer_comp
|| c->attr.class_pointer
|| c->attr.proc_pointer)
@@ -14559,6 +14848,9 @@ check_defined_assignments (gfc_symbol *derived)
return;
}
+ if (c->attr.allocatable)
+ continue;
+
check_defined_assignments (c->ts.u.derived);
if (c->ts.u.derived->attr.defined_assign_comp)
{
@@ -14864,6 +15156,19 @@ resolve_component (gfc_component *c, gfc_symbol *sym)
c->ts.u.cl->length ? &c->ts.u.cl->length->where : &c->loc);
return false;
}
+
+ if (c->ts.u.cl->length && c->ts.u.cl->length->ts.type != BT_INTEGER)
+ {
+ if (!c->ts.u.cl->length->error)
+ {
+ gfc_error ("Character length expression of component %qs at %L "
+ "must be of INTEGER type, found %s",
+ c->name, &c->ts.u.cl->length->where,
+ gfc_basic_typename (c->ts.u.cl->length->ts.type));
+ c->ts.u.cl->length->error = 1;
+ }
+ return false;
+ }
}
if (c->ts.type == BT_CHARACTER && c->ts.deferred
@@ -15220,7 +15525,7 @@ resolve_fl_derived (gfc_symbol *sym)
&& sym->ns->proc_name
&& sym->ns->proc_name->attr.flavor == FL_MODULE
&& sym->attr.access != ACCESS_PRIVATE
- && !(sym->attr.use_assoc || sym->attr.vtype || sym->attr.pdt_template))
+ && !(sym->attr.vtype || sym->attr.pdt_template))
{
gfc_symbol *vtab = gfc_find_derived_vtab (sym);
gfc_set_sym_referenced (vtab);
@@ -15892,8 +16197,8 @@ resolve_symbol (gfc_symbol *sym)
/* First, make sure the variable is declared at the
module-level scope (J3/04-007, Section 15.3). */
- if (sym->ns->proc_name->attr.flavor != FL_MODULE &&
- sym->attr.in_common == 0)
+ if (!(sym->ns->proc_name && sym->ns->proc_name->attr.flavor == FL_MODULE)
+ && !sym->attr.in_common)
{
gfc_error ("Variable %qs at %L cannot be BIND(C) because it "
"is neither a COMMON block nor declared at the "
@@ -16316,6 +16621,15 @@ resolve_symbol (gfc_symbol *sym)
if (sym->param_list)
resolve_pdt (sym);
+
+ if (!sym->attr.referenced
+ && (sym->ts.type == BT_CLASS || sym->ts.type == BT_DERIVED))
+ {
+ gfc_expr *final_expr = gfc_lval_expr_from_sym (sym);
+ if (gfc_is_finalizable (final_expr->ts.u.derived, NULL))
+ gfc_set_sym_referenced (sym);
+ gfc_free_expr (final_expr);
+ }
}
@@ -17211,6 +17525,7 @@ resolve_equivalence (gfc_equiv *eq)
"statement at %L with different type objects";
if ((object ==2
&& last_eq_type == SEQ_MIXED
+ && last_where
&& !gfc_notify_std (GFC_STD_GNU, msg, first_sym->name, last_where))
|| (eq_type == SEQ_MIXED
&& !gfc_notify_std (GFC_STD_GNU, msg, sym->name, &e->where)))
@@ -17220,6 +17535,7 @@ resolve_equivalence (gfc_equiv *eq)
"statement at %L with objects of different type";
if ((object ==2
&& last_eq_type == SEQ_NONDEFAULT
+ && last_where
&& !gfc_notify_std (GFC_STD_GNU, msg, first_sym->name, last_where))
|| (eq_type == SEQ_NONDEFAULT
&& !gfc_notify_std (GFC_STD_GNU, msg, sym->name, &e->where)))
@@ -17389,7 +17705,9 @@ resolve_fntype (gfc_namespace *ns)
}
}
- if (sym->ts.type == BT_CHARACTER)
+ if (sym->ts.type == BT_CHARACTER
+ && sym->ts.u.cl->length
+ && sym->ts.u.cl->length->ts.type == BT_INTEGER)
gfc_traverse_expr (sym->ts.u.cl->length, sym, flag_fn_result_spec, 0);
}
@@ -17651,6 +17969,9 @@ gfc_resolve (gfc_namespace *ns)
component_assignment_level = 0;
resolve_codes (ns);
+ if (ns->omp_assumes)
+ gfc_resolve_omp_assumptions (ns->omp_assumes);
+
gfc_current_ns = old_ns;
cs_base = old_cs_base;
ns->resolved = 1;
diff --git a/gcc/fortran/scanner.cc b/gcc/fortran/scanner.cc
index fa1d9cb..4f45da446 100644
--- a/gcc/fortran/scanner.cc
+++ b/gcc/fortran/scanner.cc
@@ -1,5 +1,5 @@
/* Character scanner.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
diff --git a/gcc/fortran/scanner.h b/gcc/fortran/scanner.h
index 033cada..b57e33b 100644
--- a/gcc/fortran/scanner.h
+++ b/gcc/fortran/scanner.h
@@ -1,5 +1,5 @@
/* Character scanner header.
- Copyright (C) 2013-2022 Free Software Foundation, Inc.
+ Copyright (C) 2013-2023 Free Software Foundation, Inc.
Contributed by Janne Blomqvist
This file is part of GCC.
diff --git a/gcc/fortran/simplify.cc b/gcc/fortran/simplify.cc
index c0fbd0e..ecf0e35 100644
--- a/gcc/fortran/simplify.cc
+++ b/gcc/fortran/simplify.cc
@@ -1,5 +1,5 @@
/* Simplify intrinsic functions at compile-time.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught & Katherine Holcomb
This file is part of GCC.
@@ -720,6 +720,7 @@ simplify_transformation (gfc_expr *array, gfc_expr *dim, gfc_expr *mask,
size_zero = gfc_is_size_zero_array (array);
if (!(is_constant_array_expr (array) || size_zero)
+ || array->shape == NULL
|| !gfc_is_constant_expr (dim))
return NULL;
@@ -3955,6 +3956,9 @@ gfc_simplify_ishftc (gfc_expr *e, gfc_expr *s, gfc_expr *sz)
return NULL;
gfc_extract_int (sz, &ssize);
+
+ if (ssize > isize || ssize <= 0)
+ return &gfc_bad_expr;
}
else
ssize = isize;
@@ -4913,7 +4917,22 @@ gfc_simplify_merge (gfc_expr *tsource, gfc_expr *fsource, gfc_expr *mask)
if (mask->expr_type == EXPR_CONSTANT)
{
- result = gfc_copy_expr (mask->value.logical ? tsource : fsource);
+ /* The standard requires evaluation of all function arguments.
+ Simplify only when the other dropped argument (FSOURCE or TSOURCE)
+ is a constant expression. */
+ if (mask->value.logical)
+ {
+ if (!gfc_is_constant_expr (fsource))
+ return NULL;
+ result = gfc_copy_expr (tsource);
+ }
+ else
+ {
+ if (!gfc_is_constant_expr (tsource))
+ return NULL;
+ result = gfc_copy_expr (fsource);
+ }
+
/* Parenthesis is needed to get lower bounds of 1. */
result = gfc_get_parentheses (result);
gfc_simplify_expr (result, 1);
@@ -6095,7 +6114,7 @@ gfc_simplify_nearest (gfc_expr *x, gfc_expr *s)
kind = gfc_validate_kind (BT_REAL, x->ts.kind, 0);
mpfr_set_emin ((mpfr_exp_t) gfc_real_kinds[kind].min_exponent -
mpfr_get_prec(result->value.real) + 1);
- mpfr_set_emax ((mpfr_exp_t) gfc_real_kinds[kind].max_exponent - 1);
+ mpfr_set_emax ((mpfr_exp_t) gfc_real_kinds[kind].max_exponent);
mpfr_check_range (result->value.real, 0, MPFR_RNDU);
if (mpfr_sgn (s->value.real) > 0)
@@ -8266,7 +8285,7 @@ gfc_simplify_image_index (gfc_expr *coarray, gfc_expr *sub)
if (ref->type == REF_COMPONENT)
as = ref->u.ar.as;
- if (as->type == AS_DEFERRED)
+ if (!as || as->type == AS_DEFERRED)
return NULL;
/* "valid sequence of cosubscripts" are required; thus, return 0 unless
@@ -8458,12 +8477,28 @@ gfc_simplify_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
{
if (mask_ctor->expr->value.logical)
{
- gcc_assert (vector_ctor);
- e = gfc_copy_expr (vector_ctor->expr);
- vector_ctor = gfc_constructor_next (vector_ctor);
+ if (vector_ctor)
+ {
+ e = gfc_copy_expr (vector_ctor->expr);
+ vector_ctor = gfc_constructor_next (vector_ctor);
+ }
+ else
+ {
+ gfc_free_expr (result);
+ return NULL;
+ }
}
else if (field->expr_type == EXPR_ARRAY)
- e = gfc_copy_expr (field_ctor->expr);
+ {
+ if (field_ctor)
+ e = gfc_copy_expr (field_ctor->expr);
+ else
+ {
+ /* Not enough elements in array FIELD. */
+ gfc_free_expr (result);
+ return &gfc_bad_expr;
+ }
+ }
else
e = gfc_copy_expr (field);
diff --git a/gcc/fortran/st.cc b/gcc/fortran/st.cc
index 73f30c2..657bc9d 100644
--- a/gcc/fortran/st.cc
+++ b/gcc/fortran/st.cc
@@ -1,5 +1,5 @@
/* Build executable statement trees.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -214,6 +214,7 @@ gfc_free_statement (gfc_code *p)
case EXEC_OACC_ENTER_DATA:
case EXEC_OACC_EXIT_DATA:
case EXEC_OACC_ROUTINE:
+ case EXEC_OMP_ASSUME:
case EXEC_OMP_ATOMIC:
case EXEC_OMP_CANCEL:
case EXEC_OMP_CANCELLATION_POINT:
@@ -285,7 +286,7 @@ gfc_free_statement (gfc_code *p)
break;
case EXEC_OMP_FLUSH:
- gfc_free_omp_namelist (p->ext.omp_namelist, false);
+ gfc_free_omp_namelist (p->ext.omp_namelist, false, false);
break;
case EXEC_OMP_BARRIER:
diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc
index 7a80dfd0..221165d 100644
--- a/gcc/fortran/symbol.cc
+++ b/gcc/fortran/symbol.cc
@@ -1,5 +1,5 @@
/* Maintain binary trees of symbols.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of GCC.
@@ -1108,6 +1108,12 @@ gfc_add_contiguous (symbol_attribute *attr, const char *name, locus *where)
if (check_used (attr, name, where))
return false;
+ if (attr->contiguous)
+ {
+ duplicate_attr ("CONTIGUOUS", where);
+ return false;
+ }
+
attr->contiguous = 1;
return gfc_check_conflict (attr, name, where);
}
@@ -3755,7 +3761,11 @@ free_old_symbol (gfc_symbol *sym)
if (sym->old_symbol == NULL)
return;
- if (sym->old_symbol->as != sym->as)
+ if (sym->old_symbol->as != NULL
+ && sym->old_symbol->as != sym->as
+ && !(sym->ts.type == BT_CLASS
+ && sym->ts.u.derived->attr.is_class
+ && sym->old_symbol->as == CLASS_DATA (sym)->as))
gfc_free_array_spec (sym->old_symbol->as);
if (sym->old_symbol->value != sym->value)
@@ -4071,7 +4081,13 @@ gfc_free_namespace (gfc_namespace *&ns)
f = f->next;
free (current);
}
-
+ if (ns->omp_assumes)
+ {
+ free (ns->omp_assumes->absent);
+ free (ns->omp_assumes->contains);
+ gfc_free_expr_list (ns->omp_assumes->holds);
+ free (ns->omp_assumes);
+ }
p = ns->contained;
free (ns);
ns = NULL;
@@ -5133,6 +5149,10 @@ gfc_type_compatible (gfc_typespec *ts1, gfc_typespec *ts2)
bool is_union1 = (ts1->type == BT_UNION);
bool is_union2 = (ts2->type == BT_UNION);
+ /* A boz-literal-constant has no type. */
+ if (ts1->type == BT_BOZ || ts2->type == BT_BOZ)
+ return false;
+
if (is_class1
&& ts1->u.derived->components
&& ((ts1->u.derived->attr.is_class
diff --git a/gcc/fortran/target-memory.cc b/gcc/fortran/target-memory.cc
index 7ce7d73..edc30bd 100644
--- a/gcc/fortran/target-memory.cc
+++ b/gcc/fortran/target-memory.cc
@@ -1,5 +1,5 @@
/* Simulate storage of variables into target memory.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
Contributed by Paul Thomas and Brooks Moses
This file is part of GCC.
@@ -416,11 +416,14 @@ gfc_interpret_float (int kind, unsigned char *buffer, size_t buffer_size,
mpfr_t real)
{
gfc_set_model_kind (kind);
- mpfr_init (real);
- gfc_conv_tree_to_mpfr (real,
- native_interpret_expr (gfc_get_real_type (kind),
- buffer, buffer_size));
+ tree source = native_interpret_expr (gfc_get_real_type (kind), buffer,
+ buffer_size);
+ if (!source)
+ return 0;
+
+ mpfr_init (real);
+ gfc_conv_tree_to_mpfr (real, source);
return size_float (kind);
}
diff --git a/gcc/fortran/target-memory.h b/gcc/fortran/target-memory.h
index 7ffdcb2..4c053de 100644
--- a/gcc/fortran/target-memory.h
+++ b/gcc/fortran/target-memory.h
@@ -1,5 +1,5 @@
/* Simulate storage of variables into target memory, header.
- Copyright (C) 2007-2022 Free Software Foundation, Inc.
+ Copyright (C) 2007-2023 Free Software Foundation, Inc.
Contributed by Paul Thomas and Brooks Moses
This file is part of GCC.
diff --git a/gcc/fortran/trans-array.cc b/gcc/fortran/trans-array.cc
index 0513495..41661b4 100644
--- a/gcc/fortran/trans-array.cc
+++ b/gcc/fortran/trans-array.cc
@@ -1,5 +1,5 @@
/* Array translation routines
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -994,9 +994,9 @@ gfc_get_array_span (tree desc, gfc_expr *expr)
if (tmp && TREE_CODE (tmp) == ARRAY_TYPE && TYPE_STRING_FLAG (tmp))
{
gcc_assert (expr->ts.type == BT_CHARACTER);
-
+
tmp = gfc_get_character_len_in_bytes (tmp);
-
+
if (tmp == NULL_TREE || integer_zerop (tmp))
{
tree bs;
@@ -1007,7 +1007,7 @@ gfc_get_array_span (tree desc, gfc_expr *expr)
tmp = fold_build2_loc (input_location, MULT_EXPR,
gfc_array_index_type, tmp, bs);
}
-
+
tmp = (tmp && !integer_zerop (tmp))
? (fold_convert (gfc_array_index_type, tmp)) : (NULL_TREE);
}
@@ -2026,10 +2026,11 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock,
for the dynamic parts must be allocated using realloc. */
static void
-gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
- tree desc, gfc_constructor_base base,
- tree * poffset, tree * offsetvar,
- bool dynamic)
+gfc_trans_array_constructor_value (stmtblock_t * pblock,
+ stmtblock_t * finalblock,
+ tree type, tree desc,
+ gfc_constructor_base base, tree * poffset,
+ tree * offsetvar, bool dynamic)
{
tree tmp;
tree start = NULL_TREE;
@@ -2039,13 +2040,17 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
gfc_se se;
mpz_t size;
gfc_constructor *c;
+ gfc_typespec ts;
+ int ctr = 0;
tree shadow_loopvar = NULL_TREE;
gfc_saved_var saved_loopvar;
+ ts.type = BT_UNKNOWN;
mpz_init (size);
for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c))
{
+ ctr++;
/* If this is an iterator or an array, the offset must be a variable. */
if ((c->iterator || c->expr->rank > 0) && INTEGER_CST_P (*poffset))
gfc_put_offset_into_var (pblock, poffset, offsetvar);
@@ -2091,8 +2096,8 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
if (c->expr->expr_type == EXPR_ARRAY)
{
/* Array constructors can be nested. */
- gfc_trans_array_constructor_value (&body, type, desc,
- c->expr->value.constructor,
+ gfc_trans_array_constructor_value (&body, finalblock, type,
+ desc, c->expr->value.constructor,
poffset, offsetvar, dynamic);
}
else if (c->expr->rank > 0)
@@ -2200,6 +2205,9 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
gfc_add_modify (&body, *offsetvar, *poffset);
*poffset = *offsetvar;
}
+
+ if (!c->iterator)
+ ts = c->expr->ts;
}
/* The frontend should already have done any expansions
@@ -2292,6 +2300,34 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
gfc_restore_sym (c->iterator->var->symtree->n.sym, &saved_loopvar);
}
}
+
+ /* F2008 4.5.6.3 para 5: If an executable construct references a structure
+ constructor or array constructor, the entity created by the constructor is
+ finalized after execution of the innermost executable construct containing
+ the reference. This, in fact, was later deleted by the Combined Techical
+ Corrigenda 1 TO 4 for fortran 2008 (f08/0011).
+
+ Transmit finalization of this constructor through 'finalblock'. */
+ if (!gfc_notification_std (GFC_STD_F2018_DEL) && finalblock != NULL
+ && gfc_may_be_finalized (ts)
+ && ctr > 0 && desc != NULL_TREE
+ && GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (desc)))
+ {
+ symbol_attribute attr;
+ gfc_se fse;
+ gfc_warning (0, "The structure constructor at %C has been"
+ " finalized. This feature was removed by f08/0011."
+ " Use -std=f2018 or -std=gnu to eliminate the"
+ " finalization.");
+ attr.pointer = attr.allocatable = 0;
+ gfc_init_se (&fse, NULL);
+ fse.expr = desc;
+ gfc_finalize_tree_expr (&fse, ts.u.derived, attr, 1);
+ gfc_add_block_to_block (finalblock, &fse.pre);
+ gfc_add_block_to_block (finalblock, &fse.finalblock);
+ gfc_add_block_to_block (finalblock, &fse.post);
+ }
+
mpz_clear (size);
}
@@ -2738,6 +2774,7 @@ trans_array_constructor (gfc_ss * ss, locus * where)
gfc_ss *s;
tree neg_len;
char *msg;
+ stmtblock_t finalblock;
/* Save the old values for nested checking. */
old_first_len = first_len;
@@ -2897,8 +2934,12 @@ trans_array_constructor (gfc_ss * ss, locus * where)
offsetvar = gfc_create_var_np (gfc_array_index_type, "offset");
suppress_warning (offsetvar);
TREE_USED (offsetvar) = 0;
- gfc_trans_array_constructor_value (&outer_loop->pre, type, desc, c,
- &offset, &offsetvar, dynamic);
+
+ gfc_init_block (&finalblock);
+ gfc_trans_array_constructor_value (&outer_loop->pre,
+ expr->must_finalize ? &finalblock : NULL,
+ type, desc, c, &offset, &offsetvar,
+ dynamic);
/* If the array grows dynamically, the upper bound of the loop variable
is determined by the array's final upper bound. */
@@ -2933,6 +2974,15 @@ finish:
first_len = old_first_len;
first_len_val = old_first_len_val;
typespec_chararray_ctor = old_typespec_chararray_ctor;
+
+ /* F2008 4.5.6.3 para 5: If an executable construct references a structure
+ constructor or array constructor, the entity created by the constructor is
+ finalized after execution of the innermost executable construct containing
+ the reference. */
+ if ((expr->ts.type == BT_DERIVED || expr->ts.type == BT_CLASS)
+ && finalblock.head != NULL_TREE)
+ gfc_add_block_to_block (&loop->post, &finalblock);
+
}
@@ -3161,6 +3211,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
gfc_conv_expr (&se, expr);
gfc_add_block_to_block (&outer_loop->pre, &se.pre);
gfc_add_block_to_block (&outer_loop->post, &se.post);
+ gfc_add_block_to_block (&outer_loop->post, &se.finalblock);
ss_info->string_length = se.string_length;
break;
@@ -6454,23 +6505,29 @@ gfc_trans_array_cobounds (tree type, stmtblock_t * pblock,
for (dim = as->rank; dim < as->rank + as->corank; dim++)
{
- /* Evaluate non-constant array bound expressions. */
+ /* Evaluate non-constant array bound expressions.
+ F2008 4.5.6.3 para 6: If a specification expression in a scoping unit
+ references a function, the result is finalized before execution of the
+ executable constructs in the scoping unit.
+ Adding the finalblocks enables this. */
lbound = GFC_TYPE_ARRAY_LBOUND (type, dim);
if (as->lower[dim] && !INTEGER_CST_P (lbound))
- {
- gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, as->lower[dim], gfc_array_index_type);
- gfc_add_block_to_block (pblock, &se.pre);
- gfc_add_modify (pblock, lbound, se.expr);
- }
+ {
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr_type (&se, as->lower[dim], gfc_array_index_type);
+ gfc_add_block_to_block (pblock, &se.pre);
+ gfc_add_block_to_block (pblock, &se.finalblock);
+ gfc_add_modify (pblock, lbound, se.expr);
+ }
ubound = GFC_TYPE_ARRAY_UBOUND (type, dim);
if (as->upper[dim] && !INTEGER_CST_P (ubound))
- {
- gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, as->upper[dim], gfc_array_index_type);
- gfc_add_block_to_block (pblock, &se.pre);
- gfc_add_modify (pblock, ubound, se.expr);
- }
+ {
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr_type (&se, as->upper[dim], gfc_array_index_type);
+ gfc_add_block_to_block (pblock, &se.pre);
+ gfc_add_block_to_block (pblock, &se.finalblock);
+ gfc_add_modify (pblock, ubound, se.expr);
+ }
}
}
@@ -6499,23 +6556,29 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset,
offset = gfc_index_zero_node;
for (dim = 0; dim < as->rank; dim++)
{
- /* Evaluate non-constant array bound expressions. */
+ /* Evaluate non-constant array bound expressions.
+ F2008 4.5.6.3 para 6: If a specification expression in a scoping unit
+ references a function, the result is finalized before execution of the
+ executable constructs in the scoping unit.
+ Adding the finalblocks enables this. */
lbound = GFC_TYPE_ARRAY_LBOUND (type, dim);
if (as->lower[dim] && !INTEGER_CST_P (lbound))
- {
- gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, as->lower[dim], gfc_array_index_type);
- gfc_add_block_to_block (pblock, &se.pre);
- gfc_add_modify (pblock, lbound, se.expr);
- }
+ {
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr_type (&se, as->lower[dim], gfc_array_index_type);
+ gfc_add_block_to_block (pblock, &se.pre);
+ gfc_add_block_to_block (pblock, &se.finalblock);
+ gfc_add_modify (pblock, lbound, se.expr);
+ }
ubound = GFC_TYPE_ARRAY_UBOUND (type, dim);
if (as->upper[dim] && !INTEGER_CST_P (ubound))
- {
- gfc_init_se (&se, NULL);
- gfc_conv_expr_type (&se, as->upper[dim], gfc_array_index_type);
- gfc_add_block_to_block (pblock, &se.pre);
- gfc_add_modify (pblock, ubound, se.expr);
- }
+ {
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr_type (&se, as->upper[dim], gfc_array_index_type);
+ gfc_add_block_to_block (pblock, &se.pre);
+ gfc_add_block_to_block (pblock, &se.finalblock);
+ gfc_add_modify (pblock, ubound, se.expr);
+ }
/* The offset of this dimension. offset = offset - lbound * stride. */
tmp = fold_build2_loc (input_location, MULT_EXPR, gfc_array_index_type,
lbound, size);
@@ -6529,19 +6592,19 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset,
stride = GFC_TYPE_ARRAY_SIZE (type);
if (ubound != NULL_TREE && !(stride && INTEGER_CST_P (stride)))
- {
- /* Calculate stride = size * (ubound + 1 - lbound). */
- tmp = fold_build2_loc (input_location, MINUS_EXPR,
+ {
+ /* Calculate stride = size * (ubound + 1 - lbound). */
+ tmp = fold_build2_loc (input_location, MINUS_EXPR,
gfc_array_index_type,
gfc_index_one_node, lbound);
- tmp = fold_build2_loc (input_location, PLUS_EXPR,
+ tmp = fold_build2_loc (input_location, PLUS_EXPR,
gfc_array_index_type, ubound, tmp);
- tmp = fold_build2_loc (input_location, MULT_EXPR,
+ tmp = fold_build2_loc (input_location, MULT_EXPR,
gfc_array_index_type, size, tmp);
- if (stride)
- gfc_add_modify (pblock, stride, tmp);
- else
- stride = gfc_evaluate_now (tmp, pblock);
+ if (stride)
+ gfc_add_modify (pblock, stride, tmp);
+ else
+ stride = gfc_evaluate_now (tmp, pblock);
/* Make sure that negative size arrays are translated
to being zero size. */
@@ -6551,7 +6614,7 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset,
gfc_array_index_type, tmp,
stride, gfc_index_zero_node);
gfc_add_modify (pblock, stride, tmp);
- }
+ }
size = stride;
}
@@ -6614,7 +6677,6 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym,
type = TREE_TYPE (type);
gcc_assert (!sym->attr.use_assoc);
- gcc_assert (!TREE_STATIC (decl));
gcc_assert (!sym->module);
if (sym->ts.type == BT_CHARACTER
@@ -7532,7 +7594,7 @@ gfc_conv_expr_descriptor (gfc_se *se, gfc_expr *expr)
if (!se->direct_byref)
se->unlimited_polymorphic = UNLIMITED_POLY (expr);
-
+
/* Special case things we know we can pass easily. */
switch (expr->expr_type)
{
@@ -8974,9 +9036,10 @@ enum {DEALLOCATE_ALLOC_COMP = 1, NULLIFY_ALLOC_COMP,
static gfc_actual_arglist *pdt_param_list;
static tree
-structure_alloc_comps (gfc_symbol * der_type, tree decl,
- tree dest, int rank, int purpose, int caf_mode,
- gfc_co_subroutines_args *args)
+structure_alloc_comps (gfc_symbol * der_type, tree decl, tree dest,
+ int rank, int purpose, int caf_mode,
+ gfc_co_subroutines_args *args,
+ bool no_finalization = false)
{
gfc_component *c;
gfc_loopinfo loop;
@@ -9064,11 +9127,12 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
gfc_conv_array_data (dest));
dref = gfc_build_array_ref (tmp, index, NULL);
tmp = structure_alloc_comps (der_type, vref, dref, rank,
- COPY_ALLOC_COMP, caf_mode, args);
+ COPY_ALLOC_COMP, caf_mode, args,
+ no_finalization);
}
else
tmp = structure_alloc_comps (der_type, vref, NULL_TREE, rank, purpose,
- caf_mode, args);
+ caf_mode, args, no_finalization);
gfc_add_expr_to_block (&loopbody, tmp);
@@ -9102,13 +9166,15 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
if (purpose == DEALLOCATE_ALLOC_COMP && der_type->attr.pdt_type)
{
tmp = structure_alloc_comps (der_type, decl, NULL_TREE, rank,
- DEALLOCATE_PDT_COMP, 0, args);
+ DEALLOCATE_PDT_COMP, 0, args,
+ no_finalization);
gfc_add_expr_to_block (&fnblock, tmp);
}
else if (purpose == ALLOCATE_PDT_COMP && der_type->attr.alloc_comp)
{
tmp = structure_alloc_comps (der_type, decl, NULL_TREE, rank,
- NULLIFY_ALLOC_COMP, 0, args);
+ NULLIFY_ALLOC_COMP, 0, args,
+ no_finalization);
gfc_add_expr_to_block (&fnblock, tmp);
}
@@ -9170,7 +9236,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
add_when_allocated
= structure_alloc_comps (CLASS_DATA (c)->ts.u.derived,
comp, NULL_TREE, rank, purpose,
- caf_mode, args);
+ caf_mode, args, no_finalization);
}
else
{
@@ -9178,7 +9244,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
add_when_allocated = structure_alloc_comps (c->ts.u.derived,
comp, NULL_TREE,
rank, purpose,
- caf_mode, args);
+ caf_mode, args,
+ no_finalization);
}
}
@@ -9294,8 +9361,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
continue;
}
- if ((c->ts.type == BT_DERIVED && !c->attr.pointer)
- || (c->ts.type == BT_CLASS && !CLASS_DATA (c)->attr.class_pointer))
+ if (!no_finalization && ((c->ts.type == BT_DERIVED && !c->attr.pointer)
+ || (c->ts.type == BT_CLASS && !CLASS_DATA (c)->attr.class_pointer)))
/* Call the finalizer, which will free the memory and nullify the
pointer of an array. */
deallocate_called = gfc_add_comp_finalizer_call (&tmpblock, comp, c,
@@ -9323,7 +9390,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
add_when_allocated
= structure_alloc_comps (CLASS_DATA (c)->ts.u.derived,
comp, NULL_TREE, rank, purpose,
- caf_mode, args);
+ caf_mode, args, no_finalization);
}
else
{
@@ -9331,7 +9398,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
add_when_allocated = structure_alloc_comps (c->ts.u.derived,
comp, NULL_TREE,
rank, purpose,
- caf_mode, args);
+ caf_mode, args,
+ no_finalization);
}
}
@@ -9629,7 +9697,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
decl, cdecl, NULL_TREE);
rank = c->as ? c->as->rank : 0;
tmp = structure_alloc_comps (c->ts.u.derived, comp, NULL_TREE,
- rank, purpose, caf_mode, args);
+ rank, purpose, caf_mode, args,
+ no_finalization);
gfc_add_expr_to_block (&fnblock, tmp);
}
break;
@@ -9665,7 +9734,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
tmp = structure_alloc_comps (c->ts.u.derived, comp, dcmp,
rank, purpose, caf_mode
| GFC_STRUCTURE_CAF_MODE_IN_COARRAY,
- args);
+ args, no_finalization);
gfc_add_expr_to_block (&fnblock, tmp);
}
}
@@ -9773,7 +9842,8 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
add_when_allocated = structure_alloc_comps (c->ts.u.derived,
comp, dcmp,
rank, purpose,
- caf_mode, args);
+ caf_mode, args,
+ no_finalization);
}
else
add_when_allocated = NULL_TREE;
@@ -10146,7 +10216,8 @@ gfc_nullify_alloc_comp (gfc_symbol * der_type, tree decl, int rank,
{
return structure_alloc_comps (der_type, decl, NULL_TREE, rank,
NULLIFY_ALLOC_COMP,
- GFC_STRUCTURE_CAF_MODE_ENABLE_COARRAY | caf_mode, NULL);
+ GFC_STRUCTURE_CAF_MODE_ENABLE_COARRAY | caf_mode,
+ NULL);
}
@@ -10159,7 +10230,8 @@ gfc_deallocate_alloc_comp (gfc_symbol * der_type, tree decl, int rank,
{
return structure_alloc_comps (der_type, decl, NULL_TREE, rank,
DEALLOCATE_ALLOC_COMP,
- GFC_STRUCTURE_CAF_MODE_ENABLE_COARRAY | caf_mode, NULL);
+ GFC_STRUCTURE_CAF_MODE_ENABLE_COARRAY | caf_mode,
+ NULL);
}
tree
@@ -10197,7 +10269,8 @@ gfc_bcast_alloc_comp (gfc_symbol *derived, gfc_expr *expr, int rank,
tmp = structure_alloc_comps (derived, array, NULL_TREE, rank,
BCAST_ALLOC_COMP,
- GFC_STRUCTURE_CAF_MODE_ENABLE_COARRAY, &args);
+ GFC_STRUCTURE_CAF_MODE_ENABLE_COARRAY,
+ &args);
return tmp;
}
@@ -10207,10 +10280,12 @@ gfc_bcast_alloc_comp (gfc_symbol *derived, gfc_expr *expr, int rank,
status of coarrays. */
tree
-gfc_deallocate_alloc_comp_no_caf (gfc_symbol * der_type, tree decl, int rank)
+gfc_deallocate_alloc_comp_no_caf (gfc_symbol * der_type, tree decl, int rank,
+ bool no_finalization)
{
return structure_alloc_comps (der_type, decl, NULL_TREE, rank,
- DEALLOCATE_ALLOC_COMP, 0, NULL);
+ DEALLOCATE_ALLOC_COMP, 0, NULL,
+ no_finalization);
}
@@ -10218,7 +10293,8 @@ tree
gfc_reassign_alloc_comp_caf (gfc_symbol *der_type, tree decl, tree dest)
{
return structure_alloc_comps (der_type, decl, dest, 0, REASSIGN_CAF_COMP,
- GFC_STRUCTURE_CAF_MODE_ENABLE_COARRAY, NULL);
+ GFC_STRUCTURE_CAF_MODE_ENABLE_COARRAY,
+ NULL);
}
@@ -10235,6 +10311,20 @@ gfc_copy_alloc_comp (gfc_symbol * der_type, tree decl, tree dest, int rank,
/* Recursively traverse an object of derived type, generating code to
+ copy it and its allocatable components, while suppressing any
+ finalization that might occur. This is used in the finalization of
+ function results. */
+
+tree
+gfc_copy_alloc_comp_no_fini (gfc_symbol * der_type, tree decl, tree dest,
+ int rank, int caf_mode)
+{
+ return structure_alloc_comps (der_type, decl, dest, rank, COPY_ALLOC_COMP,
+ caf_mode, NULL, true);
+}
+
+
+/* Recursively traverse an object of derived type, generating code to
copy only its allocatable components. */
tree
@@ -10378,7 +10468,7 @@ gfc_is_reallocatable_lhs (gfc_expr *expr)
/* An allocatable class variable with no reference. */
if (sym->ts.type == BT_CLASS
- && !sym->attr.associate_var
+ && (!sym->attr.associate_var || sym->attr.select_rank_temporary)
&& CLASS_DATA (sym)->attr.allocatable
&& expr->ref
&& ((expr->ref->type == REF_ARRAY && expr->ref->u.ar.type == AR_FULL
@@ -10393,7 +10483,7 @@ gfc_is_reallocatable_lhs (gfc_expr *expr)
/* An allocatable variable. */
if (sym->attr.allocatable
- && !sym->attr.associate_var
+ && (!sym->attr.associate_var || sym->attr.select_rank_temporary)
&& expr->ref
&& expr->ref->type == REF_ARRAY
&& expr->ref->u.ar.type == AR_FULL)
@@ -10527,7 +10617,6 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
tree offset;
tree jump_label1;
tree jump_label2;
- tree neq_size;
tree lbd;
tree class_expr2 = NULL_TREE;
int n;
@@ -10607,6 +10696,11 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
elemsize1 = expr1->ts.u.cl->backend_decl;
else
elemsize1 = lss->info->string_length;
+ tree unit_size = TYPE_SIZE_UNIT (gfc_get_char_type (expr1->ts.kind));
+ elemsize1 = fold_build2_loc (input_location, MULT_EXPR,
+ TREE_TYPE (elemsize1), elemsize1,
+ fold_convert (TREE_TYPE (elemsize1), unit_size));
+
}
else if (expr1->ts.type == BT_CLASS)
{
@@ -10699,19 +10793,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
/* Allocate if data is NULL. */
cond_null = fold_build2_loc (input_location, EQ_EXPR, logical_type_node,
array1, build_int_cst (TREE_TYPE (array1), 0));
-
- if (expr1->ts.type == BT_CHARACTER && expr1->ts.deferred)
- {
- tmp = fold_build2_loc (input_location, NE_EXPR,
- logical_type_node,
- lss->info->string_length,
- rss->info->string_length);
- cond_null = fold_build2_loc (input_location, TRUTH_OR_EXPR,
- logical_type_node, tmp, cond_null);
- cond_null= gfc_evaluate_now (cond_null, &fblock);
- }
- else
- cond_null= gfc_evaluate_now (cond_null, &fblock);
+ cond_null= gfc_evaluate_now (cond_null, &fblock);
tmp = build3_v (COND_EXPR, cond_null,
build1_v (GOTO_EXPR, jump_label1),
@@ -10778,19 +10860,6 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
tmp = build1_v (LABEL_EXPR, jump_label1);
gfc_add_expr_to_block (&fblock, tmp);
- /* If the lhs has not been allocated, its bounds will not have been
- initialized and so its size is set to zero. */
- size1 = gfc_create_var (gfc_array_index_type, NULL);
- gfc_init_block (&alloc_block);
- gfc_add_modify (&alloc_block, size1, gfc_index_zero_node);
- gfc_init_block (&realloc_block);
- gfc_add_modify (&realloc_block, size1,
- gfc_conv_descriptor_size (desc, expr1->rank));
- tmp = build3_v (COND_EXPR, cond_null,
- gfc_finish_block (&alloc_block),
- gfc_finish_block (&realloc_block));
- gfc_add_expr_to_block (&fblock, tmp);
-
/* Get the rhs size and fix it. */
size2 = gfc_index_one_node;
for (n = 0; n < expr2->rank; n++)
@@ -10807,16 +10876,6 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
}
size2 = gfc_evaluate_now (size2, &fblock);
- cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
- size1, size2);
-
- /* If the lhs is deferred length, assume that the element size
- changes and force a reallocation. */
- if (expr1->ts.deferred)
- neq_size = gfc_evaluate_now (logical_true_node, &fblock);
- else
- neq_size = gfc_evaluate_now (cond, &fblock);
-
/* Deallocation of allocatable components will have to occur on
reallocation. Fix the old descriptor now. */
if ((expr1->ts.type == BT_DERIVED)
@@ -11004,7 +11063,7 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
&& expr1->ts.u.derived->attr.alloc_comp)
{
tmp = gfc_deallocate_alloc_comp_no_caf (expr1->ts.u.derived, old_desc,
- expr1->rank);
+ expr1->rank, true);
gfc_add_expr_to_block (&realloc_block, tmp);
}
@@ -11048,20 +11107,6 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
gfc_add_block_to_block (&realloc_block, &caf_se.post);
realloc_expr = gfc_finish_block (&realloc_block);
- /* Reallocate if sizes or dynamic types are different. */
- if (elemsize1)
- {
- tmp = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
- elemsize1, elemsize2);
- tmp = gfc_evaluate_now (tmp, &fblock);
- neq_size = fold_build2_loc (input_location, TRUTH_OR_EXPR,
- logical_type_node, neq_size, tmp);
- }
- tmp = build3_v (COND_EXPR, neq_size, realloc_expr,
- build_empty_stmt (input_location));
-
- realloc_expr = tmp;
-
/* Malloc expression. */
gfc_init_block (&alloc_block);
if (!coarray)
@@ -11125,6 +11170,52 @@ gfc_alloc_allocatable_for_assignment (gfc_loopinfo *loop,
}
+/* Initialize class descriptor's TKR infomation. */
+
+void
+gfc_trans_class_array (gfc_symbol * sym, gfc_wrapped_block * block)
+{
+ tree type, etype;
+ tree tmp;
+ tree descriptor;
+ stmtblock_t init;
+ locus loc;
+ int rank;
+
+ /* Make sure the frontend gets these right. */
+ gcc_assert (sym->ts.type == BT_CLASS && CLASS_DATA (sym)
+ && (CLASS_DATA (sym)->attr.class_pointer
+ || CLASS_DATA (sym)->attr.allocatable));
+
+ gcc_assert (VAR_P (sym->backend_decl)
+ || TREE_CODE (sym->backend_decl) == PARM_DECL);
+
+ if (sym->attr.dummy)
+ return;
+
+ descriptor = gfc_class_data_get (sym->backend_decl);
+ type = TREE_TYPE (descriptor);
+
+ if (type == NULL || !GFC_DESCRIPTOR_TYPE_P (type))
+ return;
+
+ gfc_save_backend_locus (&loc);
+ gfc_set_backend_locus (&sym->declared_at);
+ gfc_init_block (&init);
+
+ rank = CLASS_DATA (sym)->as ? (CLASS_DATA (sym)->as->rank) : (0);
+ gcc_assert (rank>=0);
+ tmp = gfc_conv_descriptor_dtype (descriptor);
+ etype = gfc_get_element_type (type);
+ tmp = fold_build2_loc (input_location, MODIFY_EXPR, TREE_TYPE (tmp), tmp,
+ gfc_get_dtype_rank_type (rank, etype));
+ gfc_add_expr_to_block (&init, tmp);
+
+ gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
+ gfc_restore_backend_locus (&loc);
+}
+
+
/* NULLIFY an allocatable/pointer array on function entry, free it on exit.
Do likewise, recursively if necessary, with the allocatable components of
derived types. This function is also called for assumed-rank arrays, which
@@ -11145,8 +11236,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
sym_has_alloc_comp = (sym->ts.type == BT_DERIVED
|| sym->ts.type == BT_CLASS)
&& sym->ts.u.derived->attr.alloc_comp;
- has_finalizer = sym->ts.type == BT_CLASS || sym->ts.type == BT_DERIVED
- ? gfc_is_finalizable (sym->ts.u.derived, NULL) : false;
+ has_finalizer = gfc_may_be_finalized (sym->ts);
/* Make sure the frontend gets these right. */
gcc_assert (sym->attr.pointer || sym->attr.allocatable || sym_has_alloc_comp
@@ -11269,6 +11359,7 @@ gfc_trans_deferred_array (gfc_symbol * sym, gfc_wrapped_block * block)
else if ((!sym->attr.allocatable || !has_finalizer)
&& sym_has_alloc_comp && !(sym->attr.function || sym->attr.result)
&& !sym->attr.pointer && !sym->attr.save
+ && !(sym->attr.artificial && sym->name[0] == '_')
&& !sym->ns->proc_name->attr.is_main_program)
{
int rank;
diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h
index 04fee61..5408755 100644
--- a/gcc/fortran/trans-array.h
+++ b/gcc/fortran/trans-array.h
@@ -1,5 +1,5 @@
/* Header for array handling functions
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
@@ -56,11 +56,14 @@ tree gfc_nullify_alloc_comp (gfc_symbol *, tree, int, int cm = 0);
tree gfc_deallocate_alloc_comp (gfc_symbol *, tree, int, int cm = 0);
tree gfc_bcast_alloc_comp (gfc_symbol *, gfc_expr *, int, tree,
tree, tree, tree);
-tree gfc_deallocate_alloc_comp_no_caf (gfc_symbol *, tree, int);
+tree gfc_deallocate_alloc_comp_no_caf (gfc_symbol *, tree, int,
+ bool no_finalization = false);
tree gfc_reassign_alloc_comp_caf (gfc_symbol *, tree, tree);
tree gfc_copy_alloc_comp (gfc_symbol *, tree, tree, int, int);
+tree gfc_copy_alloc_comp_no_fini (gfc_symbol *, tree, tree, int, int);
+
tree gfc_copy_only_alloc_comp (gfc_symbol *, tree, tree, int);
tree gfc_allocate_pdt_comp (gfc_symbol *, tree, int, gfc_actual_arglist *);
@@ -69,6 +72,8 @@ tree gfc_check_pdt_dummy (gfc_symbol *, tree, int, gfc_actual_arglist *);
tree gfc_alloc_allocatable_for_assignment (gfc_loopinfo*, gfc_expr*, gfc_expr*);
+/* Add initialization for class descriptors */
+void gfc_trans_class_array (gfc_symbol *, gfc_wrapped_block *);
/* Add initialization for deferred arrays. */
void gfc_trans_deferred_array (gfc_symbol *, gfc_wrapped_block *);
/* Generate an initializer for a static pointer or allocatable array. */
diff --git a/gcc/fortran/trans-common.cc b/gcc/fortran/trans-common.cc
index 7c8cba0..c83b6f9 100644
--- a/gcc/fortran/trans-common.cc
+++ b/gcc/fortran/trans-common.cc
@@ -1,5 +1,5 @@
/* Common block and equivalence list handling
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Canqun Yang <canqun@nudt.edu.cn>
This file is part of GCC.
diff --git a/gcc/fortran/trans-const.cc b/gcc/fortran/trans-const.cc
index 7b18fb4..ce8aac8 100644
--- a/gcc/fortran/trans-const.cc
+++ b/gcc/fortran/trans-const.cc
@@ -1,5 +1,5 @@
/* Translation of constants
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
diff --git a/gcc/fortran/trans-const.h b/gcc/fortran/trans-const.h
index e82f0ce..114e2fa 100644
--- a/gcc/fortran/trans-const.h
+++ b/gcc/fortran/trans-const.h
@@ -1,5 +1,5 @@
/* Header for code constant translation functions
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
diff --git a/gcc/fortran/trans-decl.cc b/gcc/fortran/trans-decl.cc
index 908a4c6..2573788 100644
--- a/gcc/fortran/trans-decl.cc
+++ b/gcc/fortran/trans-decl.cc
@@ -1,5 +1,5 @@
/* Backend function setup
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
@@ -742,6 +742,7 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
/* Keep variables larger than max-stack-var-size off stack. */
if (!(sym->ns->proc_name && sym->ns->proc_name->attr.recursive)
&& !sym->attr.automatic
+ && !sym->attr.associate_var
&& sym->attr.save != SAVE_EXPLICIT
&& sym->attr.save != SAVE_IMPLICIT
&& INTEGER_CST_P (DECL_SIZE_UNIT (decl))
@@ -813,6 +814,10 @@ gfc_finish_var_decl (tree decl, gfc_symbol * sym)
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl)))
set_decl_tls_model (decl, decl_default_tls_model (decl));
+ /* Mark weak variables. */
+ if (sym->attr.ext_attr & (1 << EXT_ATTR_WEAK))
+ declare_weak (decl);
+
gfc_finish_decl_attrs (decl, &sym->attr);
}
@@ -2337,7 +2342,7 @@ module_sym:
}
/* Mark non-returning functions. */
- if (sym->attr.noreturn)
+ if (sym->attr.noreturn || sym->attr.ext_attr & (1 << EXT_ATTR_NORETURN))
TREE_THIS_VOLATILE(fndecl) = 1;
sym->backend_decl = fndecl;
@@ -2481,6 +2486,17 @@ build_function_decl (gfc_symbol * sym, bool global)
TREE_SIDE_EFFECTS (fndecl) = 0;
}
+ /* Mark noinline functions. */
+ if (attr.ext_attr & (1 << EXT_ATTR_NOINLINE))
+ DECL_UNINLINABLE (fndecl) = 1;
+
+ /* Mark noreturn functions. */
+ if (attr.ext_attr & (1 << EXT_ATTR_NORETURN))
+ TREE_THIS_VOLATILE (fndecl) = 1;
+
+ /* Mark weak functions. */
+ if (attr.ext_attr & (1 << EXT_ATTR_WEAK))
+ declare_weak (fndecl);
/* Layout the function declaration and put it in the binding level
of the current function. */
@@ -2507,8 +2523,8 @@ create_function_arglist (gfc_symbol * sym)
{
tree fndecl;
gfc_formal_arglist *f;
- tree typelist, hidden_typelist;
- tree arglist, hidden_arglist;
+ tree typelist, hidden_typelist, optval_typelist;
+ tree arglist, hidden_arglist, optval_arglist;
tree type;
tree parm;
@@ -2518,6 +2534,7 @@ create_function_arglist (gfc_symbol * sym)
the new FUNCTION_DECL node. */
arglist = NULL_TREE;
hidden_arglist = NULL_TREE;
+ optval_arglist = NULL_TREE;
typelist = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
if (sym->attr.entry_master)
@@ -2619,6 +2636,15 @@ create_function_arglist (gfc_symbol * sym)
if (f->sym != NULL) /* Ignore alternate returns. */
hidden_typelist = TREE_CHAIN (hidden_typelist);
+ /* Advance hidden_typelist over optional+value argument presence flags. */
+ optval_typelist = hidden_typelist;
+ for (f = gfc_sym_get_dummy_args (sym); f; f = f->next)
+ if (f->sym != NULL
+ && f->sym->attr.optional && f->sym->attr.value
+ && !f->sym->attr.dimension && f->sym->ts.type != BT_CLASS
+ && !gfc_bt_struct (f->sym->ts.type))
+ hidden_typelist = TREE_CHAIN (hidden_typelist);
+
for (f = gfc_sym_get_dummy_args (sym); f; f = f->next)
{
char name[GFC_MAX_SYMBOL_LEN + 2];
@@ -2698,28 +2724,30 @@ create_function_arglist (gfc_symbol * sym)
type = gfc_sym_type (f->sym);
}
}
- /* For noncharacter scalar intrinsic types, VALUE passes the value,
+ /* For scalar intrinsic types, VALUE passes the value,
hence, the optional status cannot be transferred via a NULL pointer.
Thus, we will use a hidden argument in that case. */
- else if (f->sym->attr.optional && f->sym->attr.value
- && !f->sym->attr.dimension && f->sym->ts.type != BT_CLASS
- && !gfc_bt_struct (f->sym->ts.type))
+ if (f->sym->attr.optional && f->sym->attr.value
+ && !f->sym->attr.dimension && f->sym->ts.type != BT_CLASS
+ && !gfc_bt_struct (f->sym->ts.type))
{
tree tmp;
strcpy (&name[1], f->sym->name);
- name[0] = '_';
+ name[0] = '.';
tmp = build_decl (input_location,
PARM_DECL, get_identifier (name),
boolean_type_node);
- hidden_arglist = chainon (hidden_arglist, tmp);
+ optval_arglist = chainon (optval_arglist, tmp);
DECL_CONTEXT (tmp) = fndecl;
DECL_ARTIFICIAL (tmp) = 1;
DECL_ARG_TYPE (tmp) = boolean_type_node;
TREE_READONLY (tmp) = 1;
gfc_finish_decl (tmp);
- hidden_typelist = TREE_CHAIN (hidden_typelist);
+ /* The presence flag must be boolean. */
+ gcc_assert (TREE_VALUE (optval_typelist) == boolean_type_node);
+ optval_typelist = TREE_CHAIN (optval_typelist);
}
/* For non-constant length array arguments, make sure they use
@@ -2863,6 +2891,9 @@ create_function_arglist (gfc_symbol * sym)
typelist = TREE_CHAIN (typelist);
}
+ /* Add hidden present status for optional+value arguments. */
+ arglist = chainon (arglist, optval_arglist);
+
/* Add the hidden string length parameters, unless the procedure
is bind(C). */
if (!sym->attr.is_bind_c)
@@ -4314,6 +4345,8 @@ init_intent_out_dt (gfc_symbol * proc_sym, gfc_wrapped_block * block)
gfc_formal_arglist *f;
tree tmp;
tree present;
+ gfc_symbol *s;
+ bool dealloc_with_value = false;
gfc_init_block (&init);
for (f = gfc_sym_get_dummy_args (proc_sym); f; f = f->next)
@@ -4321,42 +4354,52 @@ init_intent_out_dt (gfc_symbol * proc_sym, gfc_wrapped_block * block)
&& !f->sym->attr.pointer
&& f->sym->ts.type == BT_DERIVED)
{
+ s = f->sym;
tmp = NULL_TREE;
/* Note: Allocatables are excluded as they are already handled
by the caller. */
if (!f->sym->attr.allocatable
- && gfc_is_finalizable (f->sym->ts.u.derived, NULL))
+ && gfc_is_finalizable (s->ts.u.derived, NULL))
{
stmtblock_t block;
gfc_expr *e;
gfc_init_block (&block);
- f->sym->attr.referenced = 1;
- e = gfc_lval_expr_from_sym (f->sym);
+ s->attr.referenced = 1;
+ e = gfc_lval_expr_from_sym (s);
gfc_add_finalizer_call (&block, e);
gfc_free_expr (e);
tmp = gfc_finish_block (&block);
}
- if (tmp == NULL_TREE && !f->sym->attr.allocatable
- && f->sym->ts.u.derived->attr.alloc_comp && !f->sym->value)
- tmp = gfc_deallocate_alloc_comp (f->sym->ts.u.derived,
- f->sym->backend_decl,
- f->sym->as ? f->sym->as->rank : 0);
+ /* Note: Allocatables are excluded as they are already handled
+ by the caller. */
+ if (tmp == NULL_TREE && !s->attr.allocatable
+ && s->ts.u.derived->attr.alloc_comp)
+ {
+ tmp = gfc_deallocate_alloc_comp (s->ts.u.derived,
+ s->backend_decl,
+ s->as ? s->as->rank : 0);
+ dealloc_with_value = s->value;
+ }
- if (tmp != NULL_TREE && (f->sym->attr.optional
- || f->sym->ns->proc_name->attr.entry_master))
+ if (tmp != NULL_TREE && (s->attr.optional
+ || s->ns->proc_name->attr.entry_master))
{
- present = gfc_conv_expr_present (f->sym);
+ present = gfc_conv_expr_present (s);
tmp = build3_loc (input_location, COND_EXPR, TREE_TYPE (tmp),
present, tmp, build_empty_stmt (input_location));
}
- if (tmp != NULL_TREE)
+ if (tmp != NULL_TREE && !dealloc_with_value)
gfc_add_expr_to_block (&init, tmp);
- else if (f->sym->value && !f->sym->attr.allocatable)
- gfc_init_default_dt (f->sym, &init, true);
+ else if (s->value && !s->attr.allocatable)
+ {
+ gfc_add_expr_to_block (&init, tmp);
+ gfc_init_default_dt (s, &init, false);
+ dealloc_with_value = false;
+ }
}
else if (f->sym && f->sym->attr.intent == INTENT_OUT
&& f->sym->ts.type == BT_CLASS
@@ -4380,10 +4423,8 @@ init_intent_out_dt (gfc_symbol * proc_sym, gfc_wrapped_block * block)
present, tmp,
build_empty_stmt (input_location));
}
-
gfc_add_expr_to_block (&init, tmp);
}
-
gfc_add_init_cleanup (block, gfc_finish_block (&init), NULL_TREE);
}
@@ -4835,7 +4876,7 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
else if ((!sym->attr.dummy || sym->ts.deferred)
&& (sym->ts.type == BT_CLASS
&& CLASS_DATA (sym)->attr.class_pointer))
- continue;
+ gfc_trans_class_array (sym, block);
else if ((!sym->attr.dummy || sym->ts.deferred)
&& (sym->attr.allocatable
|| (sym->attr.pointer && sym->attr.result)
@@ -4919,6 +4960,10 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, gfc_wrapped_block * block)
tmp = NULL_TREE;
}
+ /* Initialize descriptor's TKR information. */
+ if (sym->ts.type == BT_CLASS)
+ gfc_trans_class_array (sym, block);
+
/* Deallocate when leaving the scope. Nullifying is not
needed. */
if (!sym->attr.result && !sym->attr.dummy && !sym->attr.pointer
@@ -5331,7 +5376,11 @@ gfc_trans_use_stmts (gfc_namespace * ns)
/* Sometimes, generic interfaces wind up being over-ruled by a
local symbol (see PR41062). */
if (!st->n.sym->attr.use_assoc)
- continue;
+ {
+ *slot = error_mark_node;
+ entry->decls->clear_slot (slot);
+ continue;
+ }
if (st->n.sym->backend_decl
&& DECL_P (st->n.sym->backend_decl)
@@ -5529,6 +5578,7 @@ generate_coarray_sym_init (gfc_symbol *sym)
if (sym->attr.dummy || sym->attr.allocatable || !sym->attr.codimension
|| sym->attr.use_assoc || !sym->attr.referenced
+ || sym->attr.associate_var
|| sym->attr.select_type_temporary)
return;
@@ -5849,6 +5899,16 @@ generate_local_decl (gfc_symbol * sym)
if (!sym->attr.dummy && !sym->ns->proc_name->attr.entry_master)
generate_dependency_declarations (sym);
+ if (sym->attr.ext_attr & (1 << EXT_ATTR_WEAK))
+ {
+ if (sym->attr.dummy)
+ gfc_error ("Symbol %qs at %L has the WEAK attribute but is a "
+ "dummy argument", sym->name, &sym->declared_at);
+ else
+ gfc_error ("Symbol %qs at %L has the WEAK attribute but is a "
+ "local variable", sym->name, &sym->declared_at);
+ }
+
if (sym->attr.referenced)
gfc_get_symbol_decl (sym);
@@ -7105,9 +7165,6 @@ gfc_conv_cfi_to_gfc (stmtblock_t *init, stmtblock_t *finally,
size_var, LT_EXPR, build_int_cst (TREE_TYPE (idx), 1),
gfc_finish_block (&loop_body));
/* if (cond) { block2 } */
- tmp = fold_build2_loc (input_location, MODIFY_EXPR, void_type_node,
- data, fold_convert (TREE_TYPE (data),
- null_pointer_node));
tmp = build3_v (COND_EXPR, cond_var, gfc_finish_block (&block2),
build_empty_stmt (input_location));
gfc_add_expr_to_block (&block, tmp);
@@ -7377,13 +7434,13 @@ done:
/* Set string length for len=:, only. */
if (sym->ts.type == BT_CHARACTER && !sym->ts.u.cl->length)
{
- tmp = sym->ts.u.cl->backend_decl;
+ tmp2 = gfc_get_cfi_desc_elem_len (cfi);
+ tmp = fold_convert (TREE_TYPE (tmp2), sym->ts.u.cl->backend_decl);
if (sym->ts.kind != 1)
tmp = fold_build2_loc (input_location, MULT_EXPR,
- gfc_array_index_type,
- sym->ts.u.cl->backend_decl, tmp);
- tmp2 = gfc_get_cfi_desc_elem_len (cfi);
- gfc_add_modify (&block, tmp2, fold_convert (TREE_TYPE (tmp2), tmp));
+ TREE_TYPE (tmp2), tmp,
+ build_int_cst (TREE_TYPE (tmp2), sym->ts.kind));
+ gfc_add_modify (&block, tmp2, tmp);
}
if (!sym->attr.dimension)
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 7895d03..d996d29 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -1,5 +1,5 @@
/* Expression translation
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -1178,8 +1178,10 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e, gfc_typespec class_ts,
return;
/* Test for FULL_ARRAY. */
- if (e->rank == 0 && gfc_expr_attr (e).codimension
- && gfc_expr_attr (e).dimension)
+ if (e->rank == 0
+ && ((gfc_expr_attr (e).codimension && gfc_expr_attr (e).dimension)
+ || (class_ts.u.derived->components->as
+ && class_ts.u.derived->components->as->type == AS_ASSUMED_RANK)))
full_array = true;
else
gfc_is_class_array_ref (e, &full_array);
@@ -1227,8 +1229,12 @@ gfc_conv_class_to_class (gfc_se *parmse, gfc_expr *e, gfc_typespec class_ts,
&& e->rank != class_ts.u.derived->components->as->rank)
{
if (e->rank == 0)
- gfc_add_modify (&parmse->post, gfc_class_data_get (parmse->expr),
- gfc_conv_descriptor_data_get (ctree));
+ {
+ tmp = gfc_class_data_get (parmse->expr);
+ gfc_add_modify (&parmse->post, tmp,
+ fold_convert (TREE_TYPE (tmp),
+ gfc_conv_descriptor_data_get (ctree)));
+ }
else
class_array_data_assign (&parmse->post, parmse->expr, ctree, true);
}
@@ -1525,6 +1531,7 @@ gfc_copy_class_to_class (tree from, tree to, tree nelems, bool unlimited)
name = (const char *)(DECL_NAME (to)->identifier.id.str);
from_len = gfc_conv_descriptor_size (from_data, 1);
+ from_len = fold_convert (TREE_TYPE (orig_nelems), from_len);
tmp = fold_build2_loc (input_location, NE_EXPR,
logical_type_node, from_len, orig_nelems);
msg = xasprintf ("Array bound mismatch for dimension %d "
@@ -1904,6 +1911,7 @@ gfc_init_se (gfc_se * se, gfc_se * parent)
{
memset (se, 0, sizeof (gfc_se));
gfc_init_block (&se->pre);
+ gfc_init_block (&se->finalblock);
gfc_init_block (&se->post);
se->parent = parent;
@@ -1979,15 +1987,14 @@ gfc_conv_expr_present (gfc_symbol * sym, bool use_saved_desc)
/* Intrinsic scalars with VALUE attribute which are passed by value
use a hidden argument to denote the present status. */
- if (sym->attr.value && sym->ts.type != BT_CHARACTER
- && sym->ts.type != BT_CLASS && sym->ts.type != BT_DERIVED
- && !sym->attr.dimension)
+ if (sym->attr.value && !sym->attr.dimension
+ && sym->ts.type != BT_CLASS && !gfc_bt_struct (sym->ts.type))
{
char name[GFC_MAX_SYMBOL_LEN + 2];
tree tree_name;
gcc_assert (TREE_CODE (decl) == PARM_DECL);
- name[0] = '_';
+ name[0] = '.';
strcpy (&name[1], sym->name);
tree_name = get_identifier (name);
@@ -5668,6 +5675,9 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
gfc_add_modify (&block, tmp,
build_int_cst (TREE_TYPE (tmp), attr));
+ /* The cfi-base_addr assignment could be skipped for 'pointer, intent(out)'.
+ That is very sensible for undefined pointers, but the C code might assume
+ that the pointer retains the value, in particular, if it was NULL. */
if (e->rank == 0)
{
tmp = gfc_get_cfi_desc_base_addr (cfi);
@@ -5690,6 +5700,9 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym)
gfc_add_modify (&block, tmp2, fold_convert (TREE_TYPE (tmp2), tmp));
}
+ if (fsym->attr.pointer && fsym->attr.intent == INTENT_OUT)
+ goto done;
+
/* When allocatable + intent out, free the cfi descriptor. */
if (fsym->attr.allocatable && fsym->attr.intent == INTENT_OUT)
{
@@ -6018,7 +6031,6 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_charlen cl;
gfc_expr *e;
gfc_symbol *fsym;
- stmtblock_t post;
enum {MISSING = 0, ELEMENTAL, SCALAR, SCALAR_POINTER, ARRAY};
gfc_component *comp = NULL;
int arglen;
@@ -6062,7 +6074,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
else
info = NULL;
+ stmtblock_t post, clobbers;
gfc_init_block (&post);
+ gfc_init_block (&clobbers);
gfc_init_interface_mapping (&mapping);
if (!comp)
{
@@ -6155,11 +6169,21 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
value, pass "0" and a hidden argument gives the optional
status. */
if (fsym && fsym->attr.optional && fsym->attr.value
- && !fsym->attr.dimension && fsym->ts.type != BT_CHARACTER
- && fsym->ts.type != BT_CLASS && fsym->ts.type != BT_DERIVED)
+ && !fsym->attr.dimension && fsym->ts.type != BT_CLASS
+ && !gfc_bt_struct (sym->ts.type))
{
- parmse.expr = fold_convert (gfc_sym_type (fsym),
- integer_zero_node);
+ if (fsym->ts.type == BT_CHARACTER)
+ {
+ /* Pass a NULL pointer for an absent CHARACTER arg
+ and a length of zero. */
+ parmse.expr = null_pointer_node;
+ parmse.string_length
+ = build_int_cst (gfc_charlen_type_node,
+ 0);
+ }
+ else
+ parmse.expr = fold_convert (gfc_sym_type (fsym),
+ integer_zero_node);
vec_safe_push (optionalargs, boolean_false_node);
}
else
@@ -6395,7 +6419,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& e->symtree->n.sym->attr.pointer))
&& fsym && fsym->attr.target)
/* Make sure the function only gets called once. */
- gfc_conv_expr_reference (&parmse, e, false);
+ gfc_conv_expr_reference (&parmse, e);
else if (e->expr_type == EXPR_FUNCTION
&& e->symtree->n.sym->result
&& e->symtree->n.sym->result != e->symtree->n.sym
@@ -6502,22 +6526,55 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
}
else
{
- bool add_clobber;
- add_clobber = fsym && fsym->attr.intent == INTENT_OUT
- && !fsym->attr.allocatable && !fsym->attr.pointer
- && e->symtree && e->symtree->n.sym
- && !e->symtree->n.sym->attr.dimension
- && !e->symtree->n.sym->attr.pointer
- && !e->symtree->n.sym->attr.allocatable
- /* See PR 41453. */
- && !e->symtree->n.sym->attr.dummy
- /* FIXME - PR 87395 and PR 41453 */
- && e->symtree->n.sym->attr.save == SAVE_NONE
- && !e->symtree->n.sym->attr.associate_var
- && e->ts.type != BT_CHARACTER && e->ts.type != BT_DERIVED
- && e->ts.type != BT_CLASS && !sym->attr.elemental;
-
- gfc_conv_expr_reference (&parmse, e, add_clobber);
+ gfc_conv_expr_reference (&parmse, e);
+
+ gfc_symbol *dsym = fsym;
+ gfc_dummy_arg *dummy;
+
+ /* Use associated dummy as fallback for formal
+ argument if there is no explicit interface. */
+ if (dsym == NULL
+ && (dummy = arg->associated_dummy)
+ && dummy->intrinsicness == GFC_NON_INTRINSIC_DUMMY_ARG
+ && dummy->u.non_intrinsic->sym)
+ dsym = dummy->u.non_intrinsic->sym;
+
+ if (dsym
+ && dsym->attr.intent == INTENT_OUT
+ && !dsym->attr.allocatable
+ && !dsym->attr.pointer
+ && e->expr_type == EXPR_VARIABLE
+ && e->ref == NULL
+ && e->symtree
+ && e->symtree->n.sym
+ && !e->symtree->n.sym->attr.dimension
+ && e->ts.type != BT_CHARACTER
+ && e->ts.type != BT_CLASS
+ && (e->ts.type != BT_DERIVED
+ || (dsym->ts.type == BT_DERIVED
+ && e->ts.u.derived == dsym->ts.u.derived
+ /* Types with allocatable components are
+ excluded from clobbering because we need
+ the unclobbered pointers to free the
+ allocatable components in the callee.
+ Same goes for finalizable types or types
+ with finalizable components, we need to
+ pass the unclobbered values to the
+ finalization routines.
+ For parameterized types, it's less clear
+ but they may not have a constant size
+ so better exclude them in any case. */
+ && !e->ts.u.derived->attr.alloc_comp
+ && !e->ts.u.derived->attr.pdt_type
+ && !gfc_is_finalizable (e->ts.u.derived, NULL)))
+ && !sym->attr.elemental)
+ {
+ tree var;
+ var = build_fold_indirect_ref_loc (input_location,
+ parmse.expr);
+ tree clobber = build_clobber (TREE_TYPE (var));
+ gfc_add_modify (&clobbers, var, clobber);
+ }
}
/* Catch base objects that are not variables. */
if (e->ts.type == BT_CLASS
@@ -6526,23 +6583,6 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
base_object = build_fold_indirect_ref_loc (input_location,
parmse.expr);
- /* A class array element needs converting back to be a
- class object, if the formal argument is a class object. */
- if (fsym && fsym->ts.type == BT_CLASS
- && e->ts.type == BT_CLASS
- && ((CLASS_DATA (fsym)->as
- && CLASS_DATA (fsym)->as->type == AS_ASSUMED_RANK)
- || CLASS_DATA (e)->attr.dimension))
- gfc_conv_class_to_class (&parmse, e, fsym->ts, false,
- fsym->attr.intent != INTENT_IN
- && (CLASS_DATA (fsym)->attr.class_pointer
- || CLASS_DATA (fsym)->attr.allocatable),
- fsym->attr.optional
- && e->expr_type == EXPR_VARIABLE
- && e->symtree->n.sym->attr.optional,
- CLASS_DATA (fsym)->attr.class_pointer
- || CLASS_DATA (fsym)->attr.allocatable);
-
/* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
allocated on entry, it must be deallocated. */
if (fsym && fsym->attr.intent == INTENT_OUT
@@ -6603,6 +6643,23 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_add_expr_to_block (&se->pre, tmp);
}
+ /* A class array element needs converting back to be a
+ class object, if the formal argument is a class object. */
+ if (fsym && fsym->ts.type == BT_CLASS
+ && e->ts.type == BT_CLASS
+ && ((CLASS_DATA (fsym)->as
+ && CLASS_DATA (fsym)->as->type == AS_ASSUMED_RANK)
+ || CLASS_DATA (e)->attr.dimension))
+ gfc_conv_class_to_class (&parmse, e, fsym->ts, false,
+ fsym->attr.intent != INTENT_IN
+ && (CLASS_DATA (fsym)->attr.class_pointer
+ || CLASS_DATA (fsym)->attr.allocatable),
+ fsym->attr.optional
+ && e->expr_type == EXPR_VARIABLE
+ && e->symtree->n.sym->attr.optional,
+ CLASS_DATA (fsym)->attr.class_pointer
+ || CLASS_DATA (fsym)->attr.allocatable);
+
if (fsym && (fsym->ts.type == BT_DERIVED
|| fsym->ts.type == BT_ASSUMED)
&& e->ts.type == BT_CLASS
@@ -7018,6 +7075,7 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
gfc_add_block_to_block (&se->pre, &parmse.pre);
gfc_add_block_to_block (&post, &parmse.post);
+ gfc_add_block_to_block (&se->finalblock, &parmse.finalblock);
/* Allocated allocatable components of derived types must be
deallocated for non-variable scalars, array arguments to elemental
@@ -7384,6 +7442,8 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
vec_safe_push (arglist, parmse.expr);
}
+
+ gfc_add_block_to_block (&se->pre, &clobbers);
gfc_finish_interface_mapping (&mapping, &se->pre, &se->post);
if (comp)
@@ -7681,9 +7741,20 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* Allocatable scalar function results must be freed and nullified
after use. This necessitates the creation of a temporary to
hold the result to prevent duplicate calls. */
+ symbol_attribute attr = comp ? comp->attr : sym->attr;
+ bool allocatable = attr.allocatable && !attr.dimension;
+ gfc_symbol *der = comp ?
+ comp->ts.type == BT_DERIVED ? comp->ts.u.derived : NULL
+ :
+ sym->ts.type == BT_DERIVED ? sym->ts.u.derived : NULL;
+ bool finalizable = der != NULL && der->ns->proc_name
+ && gfc_is_finalizable (der, NULL);
+
+ if (!byref && finalizable)
+ gfc_finalize_tree_expr (se, der, attr, expr->rank);
+
if (!byref && sym->ts.type != BT_CHARACTER
- && ((sym->attr.allocatable && !sym->attr.dimension && !comp)
- || (comp && comp->attr.allocatable && !comp->attr.dimension)))
+ && allocatable && !finalizable)
{
tmp = gfc_create_var (TREE_TYPE (se->expr), NULL);
gfc_add_modify (&se->pre, tmp, se->expr);
@@ -7743,6 +7814,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
se->expr = info->descriptor;
/* Bundle in the string length. */
se->string_length = len;
+
+ if (finalizable)
+ gfc_finalize_tree_expr (se, der, attr, expr->rank);
}
else if (ts.type == BT_CHARACTER)
{
@@ -7835,8 +7909,6 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& se->expr && GFC_CLASS_TYPE_P (TREE_TYPE (se->expr))
&& expr->must_finalize)
{
- tree final_fndecl;
- tree is_final;
int n;
if (se->ss && se->ss->loop)
{
@@ -7858,66 +7930,15 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
/* TODO Eliminate the doubling of temporaries. This
one is necessary to ensure no memory leakage. */
se->expr = gfc_evaluate_now (se->expr, &se->pre);
- tmp = gfc_class_data_get (se->expr);
- tmp = gfc_conv_scalar_to_descriptor (se, tmp,
- CLASS_DATA (expr->value.function.esym->result)->attr);
}
- if ((gfc_is_class_array_function (expr)
- || gfc_is_alloc_class_scalar_function (expr))
- && CLASS_DATA (expr->value.function.esym->result)->attr.pointer)
- goto no_finalization;
-
- final_fndecl = gfc_class_vtab_final_get (se->expr);
- is_final = fold_build2_loc (input_location, NE_EXPR,
- logical_type_node,
- final_fndecl,
- fold_convert (TREE_TYPE (final_fndecl),
- null_pointer_node));
- final_fndecl = build_fold_indirect_ref_loc (input_location,
- final_fndecl);
- tmp = build_call_expr_loc (input_location,
- final_fndecl, 3,
- gfc_build_addr_expr (NULL, tmp),
- gfc_class_vtab_size_get (se->expr),
- boolean_false_node);
- tmp = fold_build3_loc (input_location, COND_EXPR,
- void_type_node, is_final, tmp,
- build_empty_stmt (input_location));
-
- if (se->ss && se->ss->loop)
- {
- gfc_prepend_expr_to_block (&se->ss->loop->post, tmp);
- tmp = fold_build2_loc (input_location, NE_EXPR,
- logical_type_node,
- info->data,
- fold_convert (TREE_TYPE (info->data),
- null_pointer_node));
- tmp = fold_build3_loc (input_location, COND_EXPR,
- void_type_node, tmp,
- gfc_call_free (info->data),
- build_empty_stmt (input_location));
- gfc_add_expr_to_block (&se->ss->loop->post, tmp);
- }
- else
- {
- tree classdata;
- gfc_prepend_expr_to_block (&se->post, tmp);
- classdata = gfc_class_data_get (se->expr);
- tmp = fold_build2_loc (input_location, NE_EXPR,
- logical_type_node,
- classdata,
- fold_convert (TREE_TYPE (classdata),
- null_pointer_node));
- tmp = fold_build3_loc (input_location, COND_EXPR,
- void_type_node, tmp,
- gfc_call_free (classdata),
- build_empty_stmt (input_location));
- gfc_add_expr_to_block (&se->post, tmp);
- }
+ /* Finalize the result, if necessary. */
+ attr = CLASS_DATA (expr->value.function.esym->result)->attr;
+ if (!((gfc_is_class_array_function (expr)
+ || gfc_is_alloc_class_scalar_function (expr))
+ && attr.pointer))
+ gfc_finalize_tree_expr (se, NULL, attr, expr->rank);
}
-
-no_finalization:
gfc_add_block_to_block (&se->post, &post);
}
@@ -9429,10 +9450,29 @@ gfc_conv_expr (gfc_se * se, gfc_expr * expr)
case EXPR_STRUCTURE:
gfc_conv_structure (se, expr, 0);
+ /* F2008 4.5.6.3 para 5: If an executable construct references a
+ structure constructor or array constructor, the entity created by
+ the constructor is finalized after execution of the innermost
+ executable construct containing the reference. This, in fact,
+ was later deleted by the Combined Techical Corrigenda 1 TO 4 for
+ fortran 2008 (f08/0011). */
+ if (!gfc_notification_std (GFC_STD_F2018_DEL) && expr->must_finalize
+ && gfc_may_be_finalized (expr->ts))
+ {
+ gfc_warning (0, "The structure constructor at %C has been"
+ " finalized. This feature was removed by f08/0011."
+ " Use -std=f2018 or -std=gnu to eliminate the"
+ " finalization.");
+ symbol_attribute attr;
+ attr.allocatable = attr.pointer = 0;
+ gfc_finalize_tree_expr (se, expr->ts.u.derived, attr, 0);
+ gfc_add_block_to_block (&se->post, &se->finalblock);
+ }
break;
case EXPR_ARRAY:
gfc_conv_array_constructor_expr (se, expr);
+ gfc_add_block_to_block (&se->post, &se->finalblock);
break;
default:
@@ -9484,7 +9524,7 @@ gfc_conv_expr_type (gfc_se * se, gfc_expr * expr, tree type)
values only. */
void
-gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr, bool add_clobber)
+gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
{
gfc_ss *ss;
tree var;
@@ -9524,16 +9564,6 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr, bool add_clobber)
gfc_add_block_to_block (&se->pre, &se->post);
se->expr = var;
}
- else if (add_clobber && expr->ref == NULL)
- {
- tree clobber;
- tree var;
- /* FIXME: This fails if var is passed by reference, see PR
- 41453. */
- var = expr->symtree->n.sym->backend_decl;
- clobber = build_clobber (TREE_TYPE (var));
- gfc_add_modify (&se->pre, var, clobber);
- }
return;
}
@@ -10343,15 +10373,15 @@ gfc_conv_string_parameter (gfc_se * se)
|| TREE_CODE (TREE_TYPE (se->expr)) == INTEGER_TYPE)
&& TYPE_STRING_FLAG (TREE_TYPE (se->expr)))
{
+ type = TREE_TYPE (se->expr);
if (TREE_CODE (se->expr) != INDIRECT_REF)
- {
- type = TREE_TYPE (se->expr);
- se->expr = gfc_build_addr_expr (build_pointer_type (type), se->expr);
- }
+ se->expr = gfc_build_addr_expr (build_pointer_type (type), se->expr);
else
{
- type = gfc_get_character_type_len (gfc_default_character_kind,
- se->string_length);
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ type = TREE_TYPE (type);
+ type = gfc_get_character_type_len_for_eltype (type,
+ se->string_length);
type = build_pointer_type (type);
se->expr = gfc_build_addr_expr (type, se->expr);
}
@@ -10443,7 +10473,8 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
if (dealloc)
{
tmp_var = gfc_evaluate_now (lse->expr, &lse->pre);
- tmp = gfc_deallocate_alloc_comp_no_caf (ts.u.derived, tmp_var, 0);
+ tmp = gfc_deallocate_alloc_comp_no_caf (ts.u.derived, tmp_var,
+ 0, true);
if (deep_copy)
tmp = build3_v (COND_EXPR, cond, build_empty_stmt (input_location),
tmp);
@@ -10451,6 +10482,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
}
gfc_add_block_to_block (&block, &rse->pre);
+ gfc_add_block_to_block (&block, &lse->finalblock);
gfc_add_block_to_block (&block, &lse->pre);
gfc_add_modify (&block, lse->expr,
@@ -10480,8 +10512,9 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
}
else if (gfc_bt_struct (ts.type))
{
- gfc_add_block_to_block (&block, &lse->pre);
gfc_add_block_to_block (&block, &rse->pre);
+ gfc_add_block_to_block (&block, &lse->finalblock);
+ gfc_add_block_to_block (&block, &lse->pre);
tmp = fold_build1_loc (input_location, VIEW_CONVERT_EXPR,
TREE_TYPE (lse->expr), rse->expr);
gfc_add_modify (&block, lse->expr, tmp);
@@ -10491,6 +10524,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
{
gfc_add_block_to_block (&block, &lse->pre);
gfc_add_block_to_block (&block, &rse->pre);
+ gfc_add_block_to_block (&block, &lse->finalblock);
if (!trans_scalar_class_assign (&block, lse, rse))
{
@@ -10821,6 +10855,11 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
gfc_ss *ss = NULL;
gfc_component *comp = NULL;
gfc_loopinfo loop;
+ tree tmp;
+ tree lhs;
+ gfc_se final_se;
+ gfc_symbol *sym = expr1->symtree->n.sym;
+ bool finalizable = gfc_may_be_finalized (expr1->ts);
if (arrayfunc_assign_needs_temporary (expr1, expr2))
return NULL;
@@ -10839,12 +10878,44 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
gfc_start_block (&se.pre);
se.want_pointer = 1;
+ /* First the lhs must be finalized, if necessary. We use a copy of the symbol
+ backend decl, stash the original away for the finalization so that the
+ value used is that before the assignment. This is necessary because
+ evaluation of the rhs expression using direct by reference can change
+ the value. However, the standard mandates that the finalization must occur
+ after evaluation of the rhs. */
+ gfc_init_se (&final_se, NULL);
+
+ if (finalizable)
+ {
+ tmp = sym->backend_decl;
+ lhs = sym->backend_decl;
+ if (TREE_CODE (tmp) == INDIRECT_REF)
+ tmp = TREE_OPERAND (tmp, 0);
+ sym->backend_decl = gfc_create_var (TREE_TYPE (tmp), "lhs");
+ gfc_add_modify (&se.pre, sym->backend_decl, tmp);
+ if (GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (tmp)))
+ {
+ tmp = gfc_copy_alloc_comp (expr1->ts.u.derived, tmp, sym->backend_decl,
+ expr1->rank, 0);
+ gfc_add_expr_to_block (&final_se.pre, tmp);
+ }
+ }
+
+ if (finalizable && gfc_assignment_finalizer_call (&final_se, expr1, false))
+ {
+ gfc_add_block_to_block (&se.pre, &final_se.pre);
+ gfc_add_block_to_block (&se.post, &final_se.finalblock);
+ }
+
+ if (finalizable)
+ sym->backend_decl = lhs;
+
gfc_conv_array_parameter (&se, expr1, false, NULL, NULL, NULL);
if (expr1->ts.type == BT_DERIVED
&& expr1->ts.u.derived->attr.alloc_comp)
{
- tree tmp;
tmp = gfc_deallocate_alloc_comp_no_caf (expr1->ts.u.derived, se.expr,
expr1->rank);
gfc_add_expr_to_block (&se.pre, tmp);
@@ -10854,6 +10925,18 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
se.ss = gfc_walk_expr (expr2);
gcc_assert (se.ss != gfc_ss_terminator);
+ /* Since this is a direct by reference call, references to the lhs can be
+ used for finalization of the function result just as long as the blocks
+ from final_se are added at the right time. */
+ gfc_init_se (&final_se, NULL);
+ if (finalizable && expr2->value.function.esym)
+ {
+ final_se.expr = build_fold_indirect_ref_loc (input_location, se.expr);
+ gfc_finalize_tree_expr (&final_se, expr2->ts.u.derived,
+ expr2->value.function.esym->attr,
+ expr2->rank);
+ }
+
/* Reallocate on assignment needs the loopinfo for extrinsic functions.
This is signalled to gfc_conv_procedure_call by setting is_alloc_lhs.
Clearly, this cannot be done for an allocatable function result, since
@@ -10884,7 +10967,19 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
}
gfc_conv_function_expr (&se, expr2);
+
+ /* Fix the result. */
gfc_add_block_to_block (&se.pre, &se.post);
+ if (finalizable)
+ gfc_add_block_to_block (&se.pre, &final_se.pre);
+
+ /* Do the finalization, including final calls from function arguments. */
+ if (finalizable)
+ {
+ gfc_add_block_to_block (&se.pre, &final_se.post);
+ gfc_add_block_to_block (&se.pre, &se.finalblock);
+ gfc_add_block_to_block (&se.pre, &final_se.finalblock);
+ }
if (ss)
gfc_cleanup_loop (&loop);
@@ -11205,10 +11300,10 @@ alloc_scalar_allocatable_for_assignment (stmtblock_t *block,
if (expr1->ts.type == BT_CHARACTER && expr1->ts.deferred)
{
- /* Use the rhs string length and the lhs element size. */
+ /* Use the rhs string length and the lhs element size. Note that 'size' is
+ used below for the string-length comparison, only. */
size = string_length;
- tmp = TREE_TYPE (gfc_typenode_for_spec (&expr1->ts));
- tmp = TYPE_SIZE_UNIT (tmp);
+ tmp = TYPE_SIZE_UNIT (gfc_get_char_type (expr1->ts.kind));
size_in_bytes = fold_build2_loc (input_location, MULT_EXPR,
TREE_TYPE (tmp), tmp,
fold_convert (TREE_TYPE (tmp), size));
@@ -11407,6 +11502,17 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
{
tree tmp, fcn, stdcopy, to_len, from_len, vptr, old_vptr;
vec<tree, va_gc> *args = NULL;
+ bool final_expr;
+
+ final_expr = gfc_assignment_finalizer_call (lse, lhs, false);
+ if (final_expr)
+ {
+ if (rse->loop)
+ gfc_prepend_expr_to_block (&rse->loop->pre,
+ gfc_finish_block (&lse->finalblock));
+ else
+ gfc_add_block_to_block (block, &lse->finalblock);
+ }
/* Store the old vptr so that dynamic types can be compared for
reallocation to occur or not. */
@@ -11432,8 +11538,9 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
old_vptr = build_int_cst (TREE_TYPE (vptr), 0);
size = gfc_vptr_size_get (vptr);
- class_han = GFC_CLASS_TYPE_P (TREE_TYPE (lse->expr))
- ? gfc_class_data_get (lse->expr) : lse->expr;
+ tmp = lse->expr;
+ class_han = GFC_CLASS_TYPE_P (TREE_TYPE (tmp))
+ ? gfc_class_data_get (tmp) : tmp;
if (!POINTER_TYPE_P (TREE_TYPE (class_han)))
class_han = gfc_build_addr_expr (NULL_TREE, class_han);
@@ -11454,6 +11561,10 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
tmp, re, build_empty_stmt (input_location));
gfc_add_expr_to_block (&re_alloc, re);
+ tree realloc_expr = lhs->ts.type == BT_CLASS ?
+ gfc_finish_block (&re_alloc) :
+ build_empty_stmt (input_location);
+
/* Allocate if _data is NULL, reallocate otherwise. */
tmp = fold_build2_loc (input_location, EQ_EXPR,
logical_type_node, class_han,
@@ -11462,7 +11573,7 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
gfc_unlikely (tmp,
PRED_FORTRAN_FAIL_ALLOC),
gfc_finish_block (&alloc),
- gfc_finish_block (&re_alloc));
+ realloc_expr);
gfc_add_expr_to_block (&lse->pre, tmp);
}
@@ -11535,6 +11646,7 @@ trans_class_assignment (stmtblock_t *block, gfc_expr *lhs, gfc_expr *rhs,
}
}
+
/* Subroutine of gfc_trans_assignment that actually scalarizes the
assignment. EXPR1 is the destination/LHS and EXPR2 is the source/RHS.
init_flag indicates initialization expressions and dealloc that no
@@ -11558,6 +11670,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
tree tmp;
stmtblock_t block;
stmtblock_t body;
+ bool final_expr;
bool l_is_temp;
bool scalar_to_array;
tree string_length;
@@ -11589,15 +11702,29 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
rss = NULL;
- if ((expr1->ts.type == BT_DERIVED)
- && (gfc_is_class_array_function (expr2)
- || gfc_is_alloc_class_scalar_function (expr2)))
- expr2->must_finalize = 1;
+ if (expr2->expr_type != EXPR_VARIABLE
+ && expr2->expr_type != EXPR_CONSTANT
+ && (expr2->ts.type == BT_CLASS || gfc_may_be_finalized (expr2->ts)))
+ {
+ expr2->must_finalize = 1;
+ /* F2008 4.5.6.3 para 5: If an executable construct references a
+ structure constructor or array constructor, the entity created by
+ the constructor is finalized after execution of the innermost
+ executable construct containing the reference.
+ These finalizations were later deleted by the Combined Techical
+ Corrigenda 1 TO 4 for fortran 2008 (f08/0011). */
+ if (gfc_notification_std (GFC_STD_F2018_DEL)
+ && (expr2->expr_type == EXPR_STRUCTURE
+ || expr2->expr_type == EXPR_ARRAY))
+ expr2->must_finalize = 0;
+ }
+
/* Checking whether a class assignment is desired is quite complicated and
needed at two locations, so do it once only before the information is
needed. */
lhs_attr = gfc_expr_attr (expr1);
+
is_poly_assign = (use_vptr_copy || lhs_attr.pointer
|| (lhs_attr.allocatable && !lhs_attr.dimension))
&& (expr1->ts.type == BT_CLASS
@@ -11871,6 +11998,8 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
else
gfc_add_expr_to_block (&loop.post, tmp2);
}
+
+ expr1->must_finalize = 0;
}
else if (flag_coarray == GFC_FCOARRAY_LIB
&& lhs_caf_attr.codimension && rhs_caf_attr.codimension
@@ -11916,6 +12045,27 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
}
}
+ /* Comply with F2018 (7.5.6.3). Make sure that any finalization code is added
+ after evaluation of the rhs and before reallocation. */
+ final_expr = gfc_assignment_finalizer_call (&lse, expr1, init_flag);
+ if (final_expr && !(expr2->expr_type == EXPR_VARIABLE
+ && expr2->symtree->n.sym->attr.artificial))
+ {
+ if (lss == gfc_ss_terminator)
+ {
+ gfc_add_block_to_block (&block, &rse.pre);
+ gfc_add_block_to_block (&block, &lse.finalblock);
+ }
+ else
+ {
+ gfc_add_block_to_block (&body, &rse.pre);
+ gfc_add_block_to_block (&loop.code[expr1->rank - 1],
+ &lse.finalblock);
+ }
+ }
+ else
+ gfc_add_block_to_block (&body, &rse.pre);
+
/* If nothing else works, do it the old fashioned way! */
if (tmp == NULL_TREE)
tmp = gfc_trans_scalar_assign (&lse, &rse, expr1->ts,
@@ -11925,12 +12075,20 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
!(l_is_temp || init_flag) && dealloc,
expr1->symtree->n.sym->attr.codimension);
- /* Add the pre blocks to the body. */
- gfc_add_block_to_block (&body, &rse.pre);
+
+ /* Add the lse pre block to the body */
gfc_add_block_to_block (&body, &lse.pre);
gfc_add_expr_to_block (&body, tmp);
+
/* Add the post blocks to the body. */
- gfc_add_block_to_block (&body, &rse.post);
+ if (!l_is_temp)
+ {
+ gfc_add_block_to_block (&rse.finalblock, &rse.post);
+ gfc_add_block_to_block (&body, &rse.finalblock);
+ }
+ else
+ gfc_add_block_to_block (&body, &rse.post);
+
gfc_add_block_to_block (&body, &lse.post);
if (lss == gfc_ss_terminator)
diff --git a/gcc/fortran/trans-intrinsic.cc b/gcc/fortran/trans-intrinsic.cc
index bb93802..3cce9c0 100644
--- a/gcc/fortran/trans-intrinsic.cc
+++ b/gcc/fortran/trans-intrinsic.cc
@@ -1,5 +1,5 @@
/* Intrinsic translation
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -6638,6 +6638,7 @@ gfc_conv_intrinsic_ibits (gfc_se * se, gfc_expr * expr)
tree type;
tree tmp;
tree mask;
+ tree num_bits, cond;
gfc_conv_intrinsic_function_args (se, expr, args, 3);
type = TREE_TYPE (args[0]);
@@ -6678,8 +6679,17 @@ gfc_conv_intrinsic_ibits (gfc_se * se, gfc_expr * expr)
"in intrinsic IBITS", tmp1, tmp2, nbits);
}
+ /* The Fortran standard allows (shift width) LEN <= BIT_SIZE(I), whereas
+ gcc requires a shift width < BIT_SIZE(I), so we have to catch this
+ special case. See also gfc_conv_intrinsic_ishft (). */
+ num_bits = build_int_cst (TREE_TYPE (args[2]), TYPE_PRECISION (type));
+
mask = build_int_cst (type, -1);
mask = fold_build2_loc (input_location, LSHIFT_EXPR, type, mask, args[2]);
+ cond = fold_build2_loc (input_location, GE_EXPR, logical_type_node, args[2],
+ num_bits);
+ mask = fold_build3_loc (input_location, COND_EXPR, type, cond,
+ build_int_cst (type, 0), mask);
mask = fold_build1_loc (input_location, BIT_NOT_EXPR, type, mask);
tmp = fold_build2_loc (input_location, RSHIFT_EXPR, type, args[0], args[1]);
@@ -7557,6 +7567,9 @@ gfc_conv_intrinsic_merge (gfc_se * se, gfc_expr * expr)
&se->pre);
se->string_length = len;
}
+ tsource = gfc_evaluate_now (tsource, &se->pre);
+ fsource = gfc_evaluate_now (fsource, &se->pre);
+ mask = gfc_evaluate_now (mask, &se->pre);
type = TREE_TYPE (tsource);
se->expr = fold_build3_loc (input_location, COND_EXPR, type, mask, tsource,
fold_convert (type, fsource));
diff --git a/gcc/fortran/trans-io.cc b/gcc/fortran/trans-io.cc
index 9f86815..baeea95 100644
--- a/gcc/fortran/trans-io.cc
+++ b/gcc/fortran/trans-io.cc
@@ -1,5 +1,5 @@
/* IO Code translation/library interface
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
@@ -2690,6 +2690,7 @@ scalarize:
gfc_add_block_to_block (&body, &se.pre);
gfc_add_block_to_block (&body, &se.post);
+ gfc_add_block_to_block (&body, &se.finalblock);
if (se.ss == NULL)
tmp = gfc_finish_block (&body);
diff --git a/gcc/fortran/trans-openmp.cc b/gcc/fortran/trans-openmp.cc
index 8e9d534..84c0184 100644
--- a/gcc/fortran/trans-openmp.cc
+++ b/gcc/fortran/trans-openmp.cc
@@ -1,5 +1,5 @@
/* OpenMP directive translation -- generate GCC trees from gfc_code.
- Copyright (C) 2005-2022 Free Software Foundation, Inc.
+ Copyright (C) 2005-2023 Free Software Foundation, Inc.
Contributed by Jakub Jelinek <jakub@redhat.com>
This file is part of GCC.
@@ -123,7 +123,7 @@ gfc_omp_check_optional_argument (tree decl, bool for_present_check)
char name[GFC_MAX_SYMBOL_LEN + 2];
tree tree_name;
- name[0] = '_';
+ name[0] = '.';
strcpy (&name[1], IDENTIFIER_POINTER (DECL_NAME (decl)));
tree_name = get_identifier (name);
@@ -2494,7 +2494,7 @@ gfc_trans_omp_array_section (stmtblock_t *block, gfc_omp_namelist *n,
= gfc_conv_descriptor_data_get (decl);
/* This purposely does not include GOMP_MAP_ALWAYS_POINTER. The extra
cast prevents gimplify.cc from recognising it as being part of the
- struct – and adding an 'alloc: for the 'desc.data' pointer, which
+ struct - and adding an 'alloc: for the 'desc.data' pointer, which
would break as the 'desc' (the descriptor) is also mapped
(see node4 above). */
if (ptr_kind == GOMP_MAP_ATTACH_DETACH)
@@ -2724,6 +2724,14 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
allocator_ = gfc_evaluate_now (se.expr, block);
OMP_CLAUSE_ALLOCATE_ALLOCATOR (node) = allocator_;
}
+ if (n->u.align)
+ {
+ tree align_;
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr (&se, n->u.align);
+ align_ = gfc_evaluate_now (se.expr, block);
+ OMP_CLAUSE_ALLOCATE_ALIGN (node) = align_;
+ }
omp_clauses = gfc_trans_add_clause (node, omp_clauses);
}
}
@@ -3144,7 +3152,9 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
|| GFC_DECL_CRAY_POINTEE (decl)
|| GFC_DESCRIPTOR_TYPE_P
(TREE_TYPE (TREE_TYPE (decl)))
- || n->sym->ts.type == BT_DERIVED))
+ || (n->sym->ts.type == BT_DERIVED
+ && (n->sym->ts.u.derived->ts.f90_type
+ != BT_VOID))))
{
tree orig_decl = decl;
@@ -3626,7 +3636,10 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
gcc_unreachable ();
}
tree node = build_omp_clause (input_location, clause_code);
- if (n->expr == NULL || n->expr->ref->u.ar.type == AR_FULL)
+ if (n->expr == NULL
+ || (n->expr->ref->type == REF_ARRAY
+ && n->expr->ref->u.ar.type == AR_FULL
+ && n->expr->ref->next == NULL))
{
tree decl = gfc_trans_omp_variable (n->sym, false);
if (gfc_omp_privatize_by_reference (decl))
@@ -3666,13 +3679,13 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp_clauses *clauses,
{
tree ptr;
gfc_init_se (&se, NULL);
- if (n->expr->ref->u.ar.type == AR_ELEMENT)
+ if (n->expr->rank == 0)
{
gfc_conv_expr_reference (&se, n->expr);
ptr = se.expr;
gfc_add_block_to_block (block, &se.pre);
OMP_CLAUSE_SIZE (node)
- = TYPE_SIZE_UNIT (TREE_TYPE (ptr));
+ = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (ptr)));
}
else
{
@@ -4571,6 +4584,44 @@ static tree gfc_trans_omp_sections (gfc_code *, gfc_omp_clauses *);
static tree gfc_trans_omp_workshare (gfc_code *, gfc_omp_clauses *);
static tree
+gfc_trans_omp_assume (gfc_code *code)
+{
+ stmtblock_t block;
+ gfc_init_block (&block);
+ gfc_omp_assumptions *assume = code->ext.omp_clauses->assume;
+ if (assume)
+ for (gfc_expr_list *el = assume->holds; el; el = el->next)
+ {
+ location_t loc = gfc_get_location (&el->expr->where);
+ gfc_se se;
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr (&se, el->expr);
+ tree t;
+ if (se.pre.head == NULL_TREE && se.post.head == NULL_TREE)
+ t = se.expr;
+ else
+ {
+ tree var = create_tmp_var_raw (boolean_type_node);
+ DECL_CONTEXT (var) = current_function_decl;
+ stmtblock_t block2;
+ gfc_init_block (&block2);
+ gfc_add_block_to_block (&block2, &se.pre);
+ gfc_add_modify_loc (loc, &block2, var,
+ fold_convert_loc (loc, boolean_type_node,
+ se.expr));
+ gfc_add_block_to_block (&block2, &se.post);
+ t = gfc_finish_block (&block2);
+ t = build4 (TARGET_EXPR, boolean_type_node, var, t, NULL, NULL);
+ }
+ t = build_call_expr_internal_loc (loc, IFN_ASSUME,
+ void_type_node, 1, t);
+ gfc_add_expr_to_block (&block, t);
+ }
+ gfc_add_expr_to_block (&block, gfc_trans_omp_code (code->block->next, true));
+ return gfc_finish_block (&block);
+}
+
+static tree
gfc_trans_omp_atomic (gfc_code *code)
{
gfc_code *atomic_code = code->block;
@@ -5067,10 +5118,138 @@ gfc_trans_omp_critical (gfc_code *code)
}
typedef struct dovar_init_d {
+ gfc_symbol *sym;
tree var;
tree init;
+ bool non_unit_iter;
} dovar_init;
+static bool
+gfc_nonrect_loop_expr (stmtblock_t *pblock, gfc_se *sep, int loop_n,
+ gfc_code *code, gfc_expr *expr, vec<dovar_init> *inits,
+ int simple, gfc_expr *curr_loop_var)
+{
+ int i;
+ for (i = 0; i < loop_n; i++)
+ {
+ gcc_assert (code->ext.iterator->var->expr_type == EXPR_VARIABLE);
+ if (gfc_find_sym_in_expr (code->ext.iterator->var->symtree->n.sym, expr))
+ break;
+ code = code->block->next;
+ }
+ if (i >= loop_n)
+ return false;
+
+ /* Canonical format: TREE_VEC with [var, multiplier, offset]. */
+ gfc_symbol *var = code->ext.iterator->var->symtree->n.sym;
+
+ tree tree_var = NULL_TREE;
+ tree a1 = integer_one_node;
+ tree a2 = integer_zero_node;
+
+ if (!simple)
+ {
+ /* FIXME: Handle non-unit iter steps, cf. PR fortran/107424. */
+ sorry_at (gfc_get_location (&curr_loop_var->where),
+ "non-rectangular loop nest with step other than constant 1 "
+ "or -1 for %qs", curr_loop_var->symtree->n.sym->name);
+ return false;
+ }
+
+ dovar_init *di;
+ unsigned ix;
+ FOR_EACH_VEC_ELT (*inits, ix, di)
+ if (di->sym == var)
+ {
+ if (!di->non_unit_iter)
+ {
+ tree_var = di->init;
+ gcc_assert (DECL_P (tree_var));
+ break;
+ }
+ else
+ {
+ /* FIXME: Handle non-unit iter steps, cf. PR fortran/107424. */
+ sorry_at (gfc_get_location (&code->loc),
+ "non-rectangular loop nest with step other than constant "
+ "1 or -1 for %qs", var->name);
+ inform (gfc_get_location (&expr->where), "Used here");
+ return false;
+ }
+ }
+ if (tree_var == NULL_TREE)
+ tree_var = var->backend_decl;
+
+ if (expr->expr_type == EXPR_VARIABLE)
+ gcc_assert (expr->symtree->n.sym == var);
+ else if (expr->expr_type != EXPR_OP
+ || (expr->value.op.op != INTRINSIC_TIMES
+ && expr->value.op.op != INTRINSIC_PLUS
+ && expr->value.op.op != INTRINSIC_MINUS))
+ gcc_unreachable ();
+ else
+ {
+ gfc_se se;
+ gfc_expr *et = NULL, *eo = NULL, *e = expr;
+ if (expr->value.op.op != INTRINSIC_TIMES)
+ {
+ if (gfc_find_sym_in_expr (var, expr->value.op.op1))
+ {
+ e = expr->value.op.op1;
+ eo = expr->value.op.op2;
+ }
+ else
+ {
+ eo = expr->value.op.op1;
+ e = expr->value.op.op2;
+ }
+ }
+ if (e->value.op.op == INTRINSIC_TIMES)
+ {
+ if (e->value.op.op1->expr_type == EXPR_VARIABLE
+ && e->value.op.op1->symtree->n.sym == var)
+ et = e->value.op.op2;
+ else
+ {
+ et = e->value.op.op1;
+ gcc_assert (e->value.op.op2->expr_type == EXPR_VARIABLE
+ && e->value.op.op2->symtree->n.sym == var);
+ }
+ }
+ else
+ gcc_assert (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym == var);
+ if (et != NULL)
+ {
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr_val (&se, et);
+ gfc_add_block_to_block (pblock, &se.pre);
+ a1 = se.expr;
+ }
+ if (eo != NULL)
+ {
+ gfc_init_se (&se, NULL);
+ gfc_conv_expr_val (&se, eo);
+ gfc_add_block_to_block (pblock, &se.pre);
+ a2 = se.expr;
+ if (expr->value.op.op == INTRINSIC_MINUS && expr->value.op.op2 == eo)
+ /* outer-var - a2. */
+ a2 = fold_build1 (NEGATE_EXPR, TREE_TYPE (a2), a2);
+ else if (expr->value.op.op == INTRINSIC_MINUS)
+ /* a2 - outer-var. */
+ a1 = fold_build1 (NEGATE_EXPR, TREE_TYPE (a1), a1);
+ }
+ a1 = DECL_P (a1) ? a1 : gfc_evaluate_now (a1, pblock);
+ a2 = DECL_P (a2) ? a2 : gfc_evaluate_now (a2, pblock);
+ }
+
+ gfc_init_se (sep, NULL);
+ sep->expr = make_tree_vec (3);
+ TREE_VEC_ELT (sep->expr, 0) = tree_var;
+ TREE_VEC_ELT (sep->expr, 1) = fold_convert (TREE_TYPE (tree_var), a1);
+ TREE_VEC_ELT (sep->expr, 2) = fold_convert (TREE_TYPE (tree_var), a2);
+
+ return true;
+}
static tree
gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
@@ -5078,7 +5257,7 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
{
gfc_se se;
tree dovar, stmt, from, to, step, type, init, cond, incr, orig_decls;
- tree count = NULL_TREE, cycle_label, tmp, omp_clauses;
+ tree local_dovar = NULL_TREE, cycle_label, tmp, omp_clauses;
stmtblock_t block;
stmtblock_t body;
gfc_omp_clauses *clauses = code->ext.omp_clauses;
@@ -5165,52 +5344,72 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
gfc_init_se (&se, NULL);
gfc_conv_expr_lhs (&se, code->ext.iterator->var);
gfc_add_block_to_block (pblock, &se.pre);
- dovar = se.expr;
+ local_dovar = dovar_decl = dovar = se.expr;
type = TREE_TYPE (dovar);
gcc_assert (TREE_CODE (type) == INTEGER_TYPE);
gfc_init_se (&se, NULL);
- gfc_conv_expr_val (&se, code->ext.iterator->start);
+ gfc_conv_expr_val (&se, code->ext.iterator->step);
gfc_add_block_to_block (pblock, &se.pre);
- from = gfc_evaluate_now (se.expr, pblock);
+ step = gfc_evaluate_now (se.expr, pblock);
- gfc_init_se (&se, NULL);
- gfc_conv_expr_val (&se, code->ext.iterator->end);
- gfc_add_block_to_block (pblock, &se.pre);
- to = gfc_evaluate_now (se.expr, pblock);
+ if (integer_onep (step))
+ simple = 1;
+ else if (tree_int_cst_equal (step, integer_minus_one_node))
+ simple = -1;
gfc_init_se (&se, NULL);
- gfc_conv_expr_val (&se, code->ext.iterator->step);
- gfc_add_block_to_block (pblock, &se.pre);
- step = gfc_evaluate_now (se.expr, pblock);
- dovar_decl = dovar;
+ if (!clauses->non_rectangular
+ || !gfc_nonrect_loop_expr (pblock, &se, i, orig_code->block->next,
+ code->ext.iterator->start, &inits, simple,
+ code->ext.iterator->var))
+ {
+ gfc_conv_expr_val (&se, code->ext.iterator->start);
+ gfc_add_block_to_block (pblock, &se.pre);
+ if (!DECL_P (se.expr))
+ se.expr = gfc_evaluate_now (se.expr, pblock);
+ }
+ from = se.expr;
- /* Special case simple loops. */
- if (VAR_P (dovar))
+ gfc_init_se (&se, NULL);
+ if (!clauses->non_rectangular
+ || !gfc_nonrect_loop_expr (pblock, &se, i, orig_code->block->next,
+ code->ext.iterator->end, &inits, simple,
+ code->ext.iterator->var))
{
- if (integer_onep (step))
- simple = 1;
- else if (tree_int_cst_equal (step, integer_minus_one_node))
- simple = -1;
+ gfc_conv_expr_val (&se, code->ext.iterator->end);
+ gfc_add_block_to_block (pblock, &se.pre);
+ if (!DECL_P (se.expr))
+ se.expr = gfc_evaluate_now (se.expr, pblock);
}
- else
+ to = se.expr;
+
+ if (!DECL_P (dovar))
dovar_decl
= gfc_trans_omp_variable (code->ext.iterator->var->symtree->n.sym,
false);
-
+ if (simple && !DECL_P (dovar))
+ {
+ const char *name = code->ext.iterator->var->symtree->n.sym->name;
+ local_dovar = gfc_create_var (type, name);
+ dovar_init e = {code->ext.iterator->var->symtree->n.sym,
+ dovar, local_dovar, false};
+ inits.safe_push (e);
+ }
/* Loop body. */
if (simple)
{
- TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, dovar, from);
+ TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, local_dovar, from);
/* The condition should not be folded. */
TREE_VEC_ELT (cond, i) = build2_loc (input_location, simple > 0
? LE_EXPR : GE_EXPR,
- logical_type_node, dovar, to);
+ logical_type_node, local_dovar,
+ to);
TREE_VEC_ELT (incr, i) = fold_build2_loc (input_location, PLUS_EXPR,
- type, dovar, step);
+ type, local_dovar, step);
TREE_VEC_ELT (incr, i) = fold_build2_loc (input_location,
MODIFY_EXPR,
- type, dovar,
+ type, local_dovar,
TREE_VEC_ELT (incr, i));
if (orig_decls && !clauses->orderedc)
orig_decls = NULL;
@@ -5231,24 +5430,27 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
tmp = fold_build2_loc (input_location, TRUNC_DIV_EXPR, type, tmp,
step);
tmp = gfc_evaluate_now (tmp, pblock);
- count = gfc_create_var (type, "count");
- TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, count,
+ local_dovar = gfc_create_var (type, "count");
+ TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, local_dovar,
build_int_cst (type, 0));
/* The condition should not be folded. */
TREE_VEC_ELT (cond, i) = build2_loc (input_location, LT_EXPR,
logical_type_node,
- count, tmp);
+ local_dovar, tmp);
TREE_VEC_ELT (incr, i) = fold_build2_loc (input_location, PLUS_EXPR,
- type, count,
+ type, local_dovar,
build_int_cst (type, 1));
TREE_VEC_ELT (incr, i) = fold_build2_loc (input_location,
- MODIFY_EXPR, type, count,
+ MODIFY_EXPR, type,
+ local_dovar,
TREE_VEC_ELT (incr, i));
/* Initialize DOVAR. */
- tmp = fold_build2_loc (input_location, MULT_EXPR, type, count, step);
+ tmp = fold_build2_loc (input_location, MULT_EXPR, type, local_dovar,
+ step);
tmp = fold_build2_loc (input_location, PLUS_EXPR, type, from, tmp);
- dovar_init e = {dovar, tmp};
+ dovar_init e = {code->ext.iterator->var->symtree->n.sym,
+ dovar, tmp, true};
inits.safe_push (e);
if (clauses->orderedc)
{
@@ -5263,7 +5465,7 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
if (dovar_found == 3
&& op == EXEC_OMP_SIMD
&& collapse == 1
- && !simple)
+ && local_dovar != dovar)
{
for (tmp = omp_clauses; tmp; tmp = OMP_CLAUSE_CHAIN (tmp))
if (OMP_CLAUSE_CODE (tmp) == OMP_CLAUSE_LINEAR
@@ -5282,11 +5484,11 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
OMP_CLAUSE_LINEAR_NO_COPYIN (tmp) = 1;
OMP_CLAUSE_DECL (tmp) = dovar_decl;
omp_clauses = gfc_trans_add_clause (tmp, omp_clauses);
+ if (local_dovar != dovar)
+ dovar_found = 3;
}
- if (!simple)
- dovar_found = 3;
}
- else if (!dovar_found && !simple)
+ else if (!dovar_found && local_dovar != dovar)
{
tmp = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE);
OMP_CLAUSE_DECL (tmp) = dovar_decl;
@@ -5297,7 +5499,7 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
tree c = NULL;
tmp = NULL;
- if (!simple)
+ if (local_dovar != dovar)
{
/* If dovar is lastprivate, but different counter is used,
dovar += step needs to be added to
@@ -5307,21 +5509,19 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
if (clauses->orderedc)
{
if (clauses->collapse <= 1 || i >= clauses->collapse)
- tmp = count;
+ tmp = local_dovar;
else
tmp = fold_build2_loc (input_location, PLUS_EXPR,
- type, count, build_one_cst (type));
+ type, local_dovar,
+ build_one_cst (type));
tmp = fold_build2_loc (input_location, MULT_EXPR, type,
tmp, step);
tmp = fold_build2_loc (input_location, PLUS_EXPR, type,
from, tmp);
}
else
- {
- tmp = gfc_evaluate_now (step, pblock);
- tmp = fold_build2_loc (input_location, PLUS_EXPR, type,
- dovar, tmp);
- }
+ tmp = fold_build2_loc (input_location, PLUS_EXPR, type,
+ dovar, step);
tmp = fold_build2_loc (input_location, MODIFY_EXPR, type,
dovar, tmp);
for (c = omp_clauses; c ; c = OMP_CLAUSE_CHAIN (c))
@@ -5356,9 +5556,9 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
break;
}
}
- gcc_assert (simple || c != NULL);
+ gcc_assert (local_dovar == dovar || c != NULL);
}
- if (!simple)
+ if (local_dovar != dovar)
{
if (op != EXEC_OMP_SIMD || dovar_found == 1)
tmp = build_omp_clause (input_location, OMP_CLAUSE_PRIVATE);
@@ -5371,7 +5571,7 @@ gfc_trans_omp_do (gfc_code *code, gfc_exec_op op, stmtblock_t *pblock,
}
else
tmp = build_omp_clause (input_location, OMP_CLAUSE_LASTPRIVATE);
- OMP_CLAUSE_DECL (tmp) = count;
+ OMP_CLAUSE_DECL (tmp) = local_dovar;
omp_clauses = gfc_trans_add_clause (tmp, omp_clauses);
}
@@ -5919,6 +6119,39 @@ gfc_add_clause_implicitly (gfc_omp_clauses *clauses_out,
}
}
+/* Kind of opposite to above, add firstprivate to CLAUSES_OUT if it is mapped
+ in CLAUSES_IN's FIRSTPRIVATE list but not its MAP list. */
+
+static void
+gfc_add_firstprivate_if_unmapped (gfc_omp_clauses *clauses_out,
+ gfc_omp_clauses *clauses_in)
+{
+ gfc_omp_namelist *n = clauses_in->lists[OMP_LIST_FIRSTPRIVATE];
+ gfc_omp_namelist **tail = NULL;
+
+ for (; n != NULL; n = n->next)
+ {
+ gfc_omp_namelist *n2 = clauses_out->lists[OMP_LIST_MAP];
+ for (; n2 != NULL; n2 = n2->next)
+ if (n->sym == n2->sym)
+ break;
+ if (n2 == NULL)
+ {
+ gfc_omp_namelist *dup = gfc_get_omp_namelist ();
+ *dup = *n;
+ dup->next = NULL;
+ if (!tail)
+ {
+ tail = &clauses_out->lists[OMP_LIST_FIRSTPRIVATE];
+ while (*tail && (*tail)->next)
+ tail = &(*tail)->next;
+ }
+ *tail = dup;
+ tail = &(*tail)->next;
+ }
+ }
+}
+
static void
gfc_free_split_omp_clauses (gfc_code *code, gfc_omp_clauses *clausesa)
{
@@ -6123,6 +6356,8 @@ gfc_split_omp_clauses (gfc_code *code,
= code->ext.omp_clauses->lists[OMP_LIST_MAP];
clausesa[GFC_OMP_SPLIT_TARGET].lists[OMP_LIST_IS_DEVICE_PTR]
= code->ext.omp_clauses->lists[OMP_LIST_IS_DEVICE_PTR];
+ clausesa[GFC_OMP_SPLIT_TARGET].lists[OMP_LIST_HAS_DEVICE_ADDR]
+ = code->ext.omp_clauses->lists[OMP_LIST_HAS_DEVICE_ADDR];
clausesa[GFC_OMP_SPLIT_TARGET].device
= code->ext.omp_clauses->device;
clausesa[GFC_OMP_SPLIT_TARGET].thread_limit
@@ -6302,8 +6537,8 @@ gfc_split_omp_clauses (gfc_code *code,
simd and masked/master. Put it on the outermost of those and duplicate
on parallel and teams. */
if (mask & GFC_OMP_MASK_TARGET)
- clausesa[GFC_OMP_SPLIT_TARGET].lists[OMP_LIST_FIRSTPRIVATE]
- = code->ext.omp_clauses->lists[OMP_LIST_FIRSTPRIVATE];
+ gfc_add_firstprivate_if_unmapped (&clausesa[GFC_OMP_SPLIT_TARGET],
+ code->ext.omp_clauses);
if (mask & GFC_OMP_MASK_TEAMS)
clausesa[GFC_OMP_SPLIT_TEAMS].lists[OMP_LIST_FIRSTPRIVATE]
= code->ext.omp_clauses->lists[OMP_LIST_FIRSTPRIVATE];
@@ -7487,6 +7722,8 @@ gfc_trans_omp_directive (gfc_code *code)
{
switch (code->op)
{
+ case EXEC_OMP_ASSUME:
+ return gfc_trans_omp_assume (code);
case EXEC_OMP_ATOMIC:
return gfc_trans_omp_atomic (code);
case EXEC_OMP_BARRIER:
diff --git a/gcc/fortran/trans-stmt.cc b/gcc/fortran/trans-stmt.cc
index fd6d294..f788754 100644
--- a/gcc/fortran/trans-stmt.cc
+++ b/gcc/fortran/trans-stmt.cc
@@ -1,5 +1,5 @@
/* Statement translation -- generate GCC trees from gfc_code.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -264,6 +264,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
if (e->expr_type == EXPR_VARIABLE
&& e->rank && fsym
&& fsym->attr.intent != INTENT_IN
+ && !fsym->attr.value
&& gfc_check_fncall_dependency (e, fsym->attr.intent,
sym, arg0, check_variable))
{
@@ -443,7 +444,8 @@ gfc_trans_call (gfc_code * code, bool dependency_check,
else
gfc_add_expr_to_block (&se.pre, se.expr);
- gfc_add_block_to_block (&se.pre, &se.post);
+ gfc_add_block_to_block (&se.finalblock, &se.post);
+ gfc_add_block_to_block (&se.pre, &se.finalblock);
}
else
@@ -542,6 +544,7 @@ gfc_trans_call (gfc_code * code, bool dependency_check,
gfc_trans_scalarizing_loops (&loop, &body);
gfc_add_block_to_block (&se.pre, &loop.pre);
gfc_add_block_to_block (&se.pre, &loop.post);
+ gfc_add_block_to_block (&se.pre, &loopse.finalblock);
gfc_add_block_to_block (&se.pre, &se.post);
gfc_cleanup_loop (&loop);
}
@@ -2188,6 +2191,7 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
gfc_expr *lhs;
tree res;
gfc_se se;
+ stmtblock_t final_block;
gfc_init_se (&se, NULL);
@@ -2195,6 +2199,15 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
allocation can take place automatically in gfc_trans_assignment.
The frontend prevents them from being either allocated,
deallocated or reallocated. */
+ if (sym->ts.type == BT_DERIVED
+ && sym->ts.u.derived->attr.alloc_comp)
+ {
+ tmp = sym->backend_decl;
+ tmp = gfc_nullify_alloc_comp (sym->ts.u.derived, tmp,
+ sym->attr.dimension ? sym->as->rank : 0);
+ gfc_add_expr_to_block (&se.pre, tmp);
+ }
+
if (sym->attr.allocatable)
{
tmp = sym->backend_decl;
@@ -2205,9 +2218,33 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
}
lhs = gfc_lval_expr_from_sym (sym);
+ lhs->must_finalize = 0;
res = gfc_trans_assignment (lhs, e, false, true);
gfc_add_expr_to_block (&se.pre, res);
+ gfc_init_block (&final_block);
+
+ if (sym->attr.associate_var
+ && sym->ts.type == BT_DERIVED
+ && sym->ts.u.derived->attr.defined_assign_comp
+ && gfc_may_be_finalized (sym->ts)
+ && e->expr_type == EXPR_FUNCTION)
+ {
+ gfc_expr *ef;
+ ef = gfc_lval_expr_from_sym (sym);
+ gfc_add_finalizer_call (&final_block, ef);
+ gfc_free_expr (ef);
+ }
+
+ if (sym->ts.type == BT_DERIVED
+ && sym->ts.u.derived->attr.alloc_comp)
+ {
+ tmp = sym->backend_decl;
+ tmp = gfc_deallocate_alloc_comp (sym->ts.u.derived,
+ tmp, 0);
+ gfc_add_expr_to_block (&final_block, tmp);
+ }
+
tmp = sym->backend_decl;
if (e->expr_type == EXPR_FUNCTION
&& sym->ts.type == BT_DERIVED
@@ -2242,6 +2279,8 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
else
tmp = NULL_TREE;
+ gfc_add_expr_to_block (&final_block, tmp);
+ tmp = gfc_finish_block (&final_block);
res = gfc_finish_block (&se.pre);
gfc_add_init_cleanup (block, res, tmp);
gfc_free_expr (lhs);
@@ -6346,7 +6385,10 @@ gfc_trans_allocate (gfc_code * code)
}
gfc_add_block_to_block (&block, &se.pre);
if (code->expr3->must_finalize)
- gfc_add_block_to_block (&final_block, &se.post);
+ {
+ gfc_add_block_to_block (&final_block, &se.finalblock);
+ gfc_add_block_to_block (&final_block, &se.post);
+ }
else
gfc_add_block_to_block (&post, &se.post);
@@ -7006,8 +7048,13 @@ gfc_trans_allocate (gfc_code * code)
gfc_expr *init_expr = gfc_expr_to_initialize (expr);
gfc_expr *rhs = e3rhs ? e3rhs : gfc_copy_expr (code->expr3);
flag_realloc_lhs = 0;
+
+ /* Set the symbol to be artificial so that the result is not finalized. */
+ init_expr->symtree->n.sym->attr.artificial = 1;
tmp = gfc_trans_assignment (init_expr, rhs, true, false, true,
false);
+ init_expr->symtree->n.sym->attr.artificial = 0;
+
flag_realloc_lhs = realloc_lhs;
/* Free the expression allocated for init_expr. */
gfc_free_expr (init_expr);
diff --git a/gcc/fortran/trans-stmt.h b/gcc/fortran/trans-stmt.h
index 477add4..101a054 100644
--- a/gcc/fortran/trans-stmt.h
+++ b/gcc/fortran/trans-stmt.h
@@ -1,5 +1,5 @@
/* Header for statement translation functions
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
diff --git a/gcc/fortran/trans-types.cc b/gcc/fortran/trans-types.cc
index c062a5b..9c9489a 100644
--- a/gcc/fortran/trans-types.cc
+++ b/gcc/fortran/trans-types.cc
@@ -1,5 +1,5 @@
/* Backend support for Fortran 95 basic types and derived types.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -2314,7 +2314,7 @@ gfc_sym_type (gfc_symbol * sym, bool is_bind_c)
&& sym->ns->proc_name->attr.is_bind_c)
|| (sym->ts.deferred && (!sym->ts.u.cl
|| !sym->ts.u.cl->backend_decl))))
- type = gfc_character1_type_node;
+ type = gfc_get_char_type (sym->ts.kind);
else
type = gfc_typenode_for_spec (&sym->ts, sym->attr.codimension);
@@ -3105,6 +3105,7 @@ gfc_get_function_type (gfc_symbol * sym, gfc_actual_arglist *actual_args,
{
tree type;
vec<tree, va_gc> *typelist = NULL;
+ vec<tree, va_gc> *hidden_typelist = NULL;
gfc_formal_arglist *f;
gfc_symbol *arg;
int alternate_return = 0;
@@ -3222,17 +3223,17 @@ gfc_get_function_type (gfc_symbol * sym, gfc_actual_arglist *actual_args,
so that the value can be returned. */
type = build_pointer_type (gfc_charlen_type_node);
- vec_safe_push (typelist, type);
+ vec_safe_push (hidden_typelist, type);
}
- /* For noncharacter scalar intrinsic types, VALUE passes the value,
+ /* For scalar intrinsic types, VALUE passes the value,
hence, the optional status cannot be transferred via a NULL pointer.
Thus, we will use a hidden argument in that case. */
- else if (arg
- && arg->attr.optional
- && arg->attr.value
- && !arg->attr.dimension
- && arg->ts.type != BT_CLASS
- && !gfc_bt_struct (arg->ts.type))
+ if (arg
+ && arg->attr.optional
+ && arg->attr.value
+ && !arg->attr.dimension
+ && arg->ts.type != BT_CLASS
+ && !gfc_bt_struct (arg->ts.type))
vec_safe_push (typelist, boolean_type_node);
/* Coarrays which are descriptorless or assumed-shape pass with
-fcoarray=lib the token and the offset as hidden arguments. */
@@ -3245,11 +3246,15 @@ gfc_get_function_type (gfc_symbol * sym, gfc_actual_arglist *actual_args,
&& CLASS_DATA (arg)->attr.codimension
&& !CLASS_DATA (arg)->attr.allocatable)))
{
- vec_safe_push (typelist, pvoid_type_node); /* caf_token. */
- vec_safe_push (typelist, gfc_array_index_type); /* caf_offset. */
+ vec_safe_push (hidden_typelist, pvoid_type_node); /* caf_token. */
+ vec_safe_push (hidden_typelist, gfc_array_index_type); /* caf_offset. */
}
}
+ /* Put hidden character length, caf_token, caf_offset at the end. */
+ vec_safe_reserve (typelist, vec_safe_length (hidden_typelist));
+ vec_safe_splice (typelist, hidden_typelist);
+
if (!vec_safe_is_empty (typelist)
|| sym->attr.is_main_program
|| sym->attr.if_source != IFSRC_UNKNOWN)
@@ -3297,7 +3302,9 @@ arg_type_list_done:
type = gfc_sym_type (sym);
if (is_varargs)
- type = build_varargs_function_type_vec (type, typelist);
+ /* This should be represented as an unprototyped type, not a type
+ with (...) prototype. */
+ type = build_function_type (type, NULL_TREE);
else
type = build_function_type_vec (type, typelist);
diff --git a/gcc/fortran/trans-types.h b/gcc/fortran/trans-types.h
index 6a360de..2dc6923 100644
--- a/gcc/fortran/trans-types.h
+++ b/gcc/fortran/trans-types.h
@@ -1,5 +1,5 @@
/* Header for Fortran 95 types backend support.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
diff --git a/gcc/fortran/trans.cc b/gcc/fortran/trans.cc
index 912a206..f7745ad 100644
--- a/gcc/fortran/trans.cc
+++ b/gcc/fortran/trans.cc
@@ -1,5 +1,5 @@
/* Code translation -- generate GCC trees from gfc_code.
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
@@ -1098,7 +1098,7 @@ gfc_build_final_call (gfc_typespec ts, gfc_expr *final_wrapper, gfc_expr *var,
else
{
gfc_conv_expr (&se, var);
- gcc_assert (se.pre.head == NULL_TREE && se.post.head == NULL_TREE);
+// gcc_assert (se.pre.head == NULL_TREE && se.post.head == NULL_TREE);
array = se.expr;
/* No copy back needed, hence set attr's allocatable/pointer
@@ -1276,6 +1276,14 @@ gfc_add_finalizer_call (stmtblock_t *block, gfc_expr *expr2)
if (!expr2 || (expr2->ts.type != BT_DERIVED && expr2->ts.type != BT_CLASS))
return false;
+ /* Finalization of these temporaries is made by explicit calls in
+ resolve.cc(generate_component_assignments). */
+ if (expr2->expr_type == EXPR_VARIABLE
+ && expr2->symtree->n.sym->name[0] == '_'
+ && expr2->ts.type == BT_DERIVED
+ && expr2->ts.u.derived->attr.defined_assign_comp)
+ return false;
+
if (expr2->ts.type == BT_DERIVED)
{
gfc_is_finalizable (expr2->ts.u.derived, &final_expr);
@@ -1370,6 +1378,277 @@ gfc_add_finalizer_call (stmtblock_t *block, gfc_expr *expr2)
}
+ /* F2018 (7.5.6.3): "When an intrinsic assignment statement is executed
+ (10.2.1.3), if the variable is not an unallocated allocatable variable,
+ it is finalized after evaluation of expr and before the definition of
+ the variable. If the variable is an allocated allocatable variable, or
+ has an allocated allocatable subobject, that would be deallocated by
+ intrinsic assignment, the finalization occurs before the deallocation */
+
+bool
+gfc_assignment_finalizer_call (gfc_se *lse, gfc_expr *expr1, bool init_flag)
+{
+ symbol_attribute lhs_attr;
+ tree final_expr;
+ tree ptr;
+ tree cond;
+ gfc_se se;
+ gfc_symbol *sym = expr1->symtree->n.sym;
+ gfc_ref *ref = expr1->ref;
+ stmtblock_t final_block;
+ gfc_init_block (&final_block);
+ gfc_expr *finalize_expr;
+ bool class_array_ref;
+
+ /* We have to exclude vtable procedures (_copy and _final especially), uses
+ of gfc_trans_assignment_1 in initialization and allocation before trying
+ to build a final call. */
+ if (!expr1->must_finalize
+ || sym->attr.artificial
+ || sym->ns->proc_name->attr.artificial
+ || init_flag)
+ return false;
+
+ class_array_ref = ref && ref->type == REF_COMPONENT
+ && !strcmp (ref->u.c.component->name, "_data")
+ && ref->next && ref->next->type == REF_ARRAY
+ && !ref->next->next;
+
+ if (class_array_ref)
+ {
+ finalize_expr = gfc_lval_expr_from_sym (sym);
+ finalize_expr->must_finalize = 1;
+ ref = NULL;
+ }
+ else
+ finalize_expr = gfc_copy_expr (expr1);
+
+ /* F2018 7.5.6.2: Only finalizable entities are finalized. */
+ if (!(expr1->ts.type == BT_DERIVED
+ && gfc_is_finalizable (expr1->ts.u.derived, NULL))
+ && expr1->ts.type != BT_CLASS)
+ return false;
+
+ if (!gfc_may_be_finalized (sym->ts))
+ return false;
+
+ gfc_init_block (&final_block);
+ bool finalizable = gfc_add_finalizer_call (&final_block, finalize_expr);
+ gfc_free_expr (finalize_expr);
+
+ if (!finalizable)
+ return false;
+
+ lhs_attr = gfc_expr_attr (expr1);
+
+ /* Check allocatable/pointer is allocated/associated. */
+ if (lhs_attr.allocatable || lhs_attr.pointer)
+ {
+ if (expr1->ts.type == BT_CLASS)
+ {
+ ptr = gfc_get_class_from_gfc_expr (expr1);
+ gcc_assert (ptr != NULL_TREE);
+ ptr = gfc_class_data_get (ptr);
+ if (lhs_attr.dimension)
+ ptr = gfc_conv_descriptor_data_get (ptr);
+ }
+ else
+ {
+ gfc_init_se (&se, NULL);
+ if (expr1->rank)
+ {
+ gfc_conv_expr_descriptor (&se, expr1);
+ ptr = gfc_conv_descriptor_data_get (se.expr);
+ }
+ else
+ {
+ gfc_conv_expr (&se, expr1);
+ ptr = gfc_build_addr_expr (NULL_TREE, se.expr);
+ }
+ }
+
+ cond = fold_build2_loc (input_location, NE_EXPR, logical_type_node,
+ ptr, build_zero_cst (TREE_TYPE (ptr)));
+ final_expr = build3_loc (input_location, COND_EXPR, void_type_node,
+ cond, gfc_finish_block (&final_block),
+ build_empty_stmt (input_location));
+ }
+ else
+ final_expr = gfc_finish_block (&final_block);
+
+ /* Check optional present. */
+ if (sym->attr.optional)
+ {
+ cond = gfc_conv_expr_present (sym);
+ final_expr = build3_loc (input_location, COND_EXPR, void_type_node,
+ cond, final_expr,
+ build_empty_stmt (input_location));
+ }
+
+ gfc_add_expr_to_block (&lse->finalblock, final_expr);
+
+ return true;
+}
+
+
+/* Finalize a TREE expression using the finalizer wrapper. The result is
+ fixed in order to prevent repeated calls. */
+
+void
+gfc_finalize_tree_expr (gfc_se *se, gfc_symbol *derived,
+ symbol_attribute attr, int rank)
+{
+ tree vptr, final_fndecl, desc, tmp, size, is_final;
+ tree data_ptr, data_null, cond;
+ gfc_symbol *vtab;
+ gfc_se post_se;
+ bool is_class = GFC_CLASS_TYPE_P (TREE_TYPE (se->expr));
+
+ if (attr.pointer)
+ return;
+
+ /* Derived type function results with components that have defined
+ assignements are handled in resolve.cc(generate_component_assignments) */
+ if (derived && (derived->attr.is_c_interop
+ || derived->attr.is_iso_c
+ || derived->attr.is_bind_c
+ || derived->attr.defined_assign_comp))
+ return;
+
+ if (is_class)
+ {
+ if (!VAR_P (se->expr))
+ {
+ desc = gfc_evaluate_now (se->expr, &se->pre);
+ se->expr = desc;
+ }
+ desc = gfc_class_data_get (se->expr);
+ vptr = gfc_class_vptr_get (se->expr);
+ }
+ else if (derived && gfc_is_finalizable (derived, NULL))
+ {
+ if (derived->attr.zero_comp && !rank)
+ {
+ /* Any attempt to assign zero length entities, causes the gimplifier
+ all manner of problems. Instead, a variable is created to act as
+ as the argument for the final call. */
+ desc = gfc_create_var (TREE_TYPE (se->expr), "zero");
+ }
+ else if (se->direct_byref)
+ {
+ desc = gfc_evaluate_now (se->expr, &se->finalblock);
+ if (derived->attr.alloc_comp)
+ {
+ /* Need to copy allocated components and not finalize. */
+ tmp = gfc_copy_alloc_comp_no_fini (derived, se->expr, desc, rank, 0);
+ gfc_add_expr_to_block (&se->finalblock, tmp);
+ }
+ }
+ else
+ {
+ desc = gfc_evaluate_now (se->expr, &se->pre);
+ se->expr = gfc_evaluate_now (desc, &se->pre);
+ if (derived->attr.alloc_comp)
+ {
+ /* Need to copy allocated components and not finalize. */
+ tmp = gfc_copy_alloc_comp_no_fini (derived, se->expr, desc, rank, 0);
+ gfc_add_expr_to_block (&se->pre, tmp);
+ }
+ }
+
+ vtab = gfc_find_derived_vtab (derived);
+ if (vtab->backend_decl == NULL_TREE)
+ vptr = gfc_get_symbol_decl (vtab);
+ else
+ vptr = vtab->backend_decl;
+ vptr = gfc_build_addr_expr (NULL, vptr);
+ }
+ else
+ return;
+
+ size = gfc_vptr_size_get (vptr);
+ final_fndecl = gfc_vptr_final_get (vptr);
+ is_final = fold_build2_loc (input_location, NE_EXPR,
+ logical_type_node,
+ final_fndecl,
+ fold_convert (TREE_TYPE (final_fndecl),
+ null_pointer_node));
+
+ final_fndecl = build_fold_indirect_ref_loc (input_location,
+ final_fndecl);
+ if (!GFC_DESCRIPTOR_TYPE_P (TREE_TYPE (desc)))
+ {
+ if (is_class)
+ desc = gfc_conv_scalar_to_descriptor (se, desc, attr);
+ else
+ {
+ gfc_init_se (&post_se, NULL);
+ desc = gfc_conv_scalar_to_descriptor (&post_se, desc, attr);
+ gfc_add_expr_to_block (&se->pre, gfc_finish_block (&post_se.pre));
+ }
+ }
+
+ if (derived && derived->attr.zero_comp)
+ {
+ /* All the conditions below break down for zero length derived types. */
+ tmp = build_call_expr_loc (input_location, final_fndecl, 3,
+ gfc_build_addr_expr (NULL, desc),
+ size, boolean_false_node);
+ gfc_add_expr_to_block (&se->finalblock, tmp);
+ return;
+ }
+
+ if (!VAR_P (desc))
+ {
+ tmp = gfc_create_var (TREE_TYPE (desc), "res");
+ if (se->direct_byref)
+ gfc_add_modify (&se->finalblock, tmp, desc);
+ else
+ gfc_add_modify (&se->pre, tmp, desc);
+ desc = tmp;
+ }
+
+ data_ptr = gfc_conv_descriptor_data_get (desc);
+ data_null = fold_convert (TREE_TYPE (data_ptr), null_pointer_node);
+ cond = fold_build2_loc (input_location, NE_EXPR,
+ logical_type_node, data_ptr, data_null);
+ is_final = fold_build2_loc (input_location, TRUTH_AND_EXPR,
+ logical_type_node, is_final, cond);
+ tmp = build_call_expr_loc (input_location, final_fndecl, 3,
+ gfc_build_addr_expr (NULL, desc),
+ size, boolean_false_node);
+ tmp = fold_build3_loc (input_location, COND_EXPR,
+ void_type_node, is_final, tmp,
+ build_empty_stmt (input_location));
+
+ if (is_class && se->ss && se->ss->loop)
+ {
+ gfc_add_expr_to_block (&se->loop->post, tmp);
+ tmp = fold_build3_loc (input_location, COND_EXPR,
+ void_type_node, cond,
+ gfc_call_free (data_ptr),
+ build_empty_stmt (input_location));
+ gfc_add_expr_to_block (&se->loop->post, tmp);
+ gfc_add_modify (&se->loop->post, data_ptr, data_null);
+ }
+ else
+ {
+ gfc_add_expr_to_block (&se->finalblock, tmp);
+
+ /* Let the scalarizer take care of freeing of temporary arrays. */
+ if (attr.allocatable && !(se->loop && se->loop->temp_dim))
+ {
+ tmp = fold_build3_loc (input_location, COND_EXPR,
+ void_type_node, cond,
+ gfc_call_free (data_ptr),
+ build_empty_stmt (input_location));
+ gfc_add_expr_to_block (&se->finalblock, tmp);
+ gfc_add_modify (&se->finalblock, data_ptr, data_null);
+ }
+ }
+}
+
+
/* User-deallocate; we emit the code directly from the front-end, and the
logic is the same as the previous library function:
@@ -2174,6 +2453,7 @@ trans_code (gfc_code * code, tree cond)
res = gfc_trans_dt_end (code);
break;
+ case EXEC_OMP_ASSUME:
case EXEC_OMP_ATOMIC:
case EXEC_OMP_BARRIER:
case EXEC_OMP_CANCEL:
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 03d5288..1ad6d94 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -1,5 +1,5 @@
/* Header for code translation functions
- Copyright (C) 2002-2022 Free Software Foundation, Inc.
+ Copyright (C) 2002-2023 Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
@@ -43,6 +43,10 @@ typedef struct gfc_se
stmtblock_t pre;
stmtblock_t post;
+ /* Carries finalization code that is required to be executed execution of the
+ innermost executable construct. */
+ stmtblock_t finalblock;
+
/* the result of the expression */
tree expr;
@@ -55,7 +59,7 @@ typedef struct gfc_se
/* Whether expr is a reference to an unlimited polymorphic object. */
unsigned unlimited_polymorphic:1;
-
+
/* If set gfc_conv_variable will return an expression for the array
descriptor. When set, want_pointer should also be set.
If not set scalarizing variables will be substituted. */
@@ -450,6 +454,8 @@ tree gfc_get_vptr_from_expr (tree);
tree gfc_copy_class_to_class (tree, tree, tree, bool);
bool gfc_add_finalizer_call (stmtblock_t *, gfc_expr *);
bool gfc_add_comp_finalizer_call (stmtblock_t *, tree, gfc_component *, bool);
+void gfc_finalize_tree_expr (gfc_se *, gfc_symbol *, symbol_attribute, int);
+bool gfc_assignment_finalizer_call (gfc_se *, gfc_expr *, bool);
void gfc_conv_derived_to_class (gfc_se *, gfc_expr *, gfc_typespec, tree, bool,
bool, tree *derived_array = NULL);
@@ -499,8 +505,7 @@ tree gfc_build_compare_string (tree, tree, tree, tree, int, enum tree_code);
void gfc_conv_expr (gfc_se * se, gfc_expr * expr);
void gfc_conv_expr_val (gfc_se * se, gfc_expr * expr);
void gfc_conv_expr_lhs (gfc_se * se, gfc_expr * expr);
-void gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr,
- bool add_clobber = false);
+void gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr);
void gfc_conv_expr_type (gfc_se * se, gfc_expr *, tree);
diff --git a/gcc/fortran/trigd_fe.inc b/gcc/fortran/trigd_fe.inc
index fe68a8f..12be1758 100644
--- a/gcc/fortran/trigd_fe.inc
+++ b/gcc/fortran/trigd_fe.inc
@@ -1,7 +1,7 @@
/* Stub for defining degree-valued trigonemetric functions using MPFR.
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Fritz Reese <foreese@gcc.gnu.org>
and Steven G. Kargl <kargl@gcc.gnu.org>
diff --git a/gcc/fortran/types.def b/gcc/fortran/types.def
index cd79ad4..7a465c8 100644
--- a/gcc/fortran/types.def
+++ b/gcc/fortran/types.def
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2022 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2023 Free Software Foundation, Inc.
This file is part of GCC.