diff options
author | Mikael Morin <mikael@gcc.gnu.org> | 2024-09-21 18:33:11 +0200 |
---|---|---|
committer | Mikael Morin <mikael@gcc.gnu.org> | 2024-09-21 18:33:11 +0200 |
commit | d6cb7794dcd7d97b77283fbbe0026e63521d2375 (patch) | |
tree | 6f17987ebb9d8af71991c6ac8bb0a9a12561fc3e /gcc/ChangeLog | |
parent | 3c01ddc4ff0fdbaf32c22aed1c04d1d587821d91 (diff) | |
download | gcc-d6cb7794dcd7d97b77283fbbe0026e63521d2375.zip gcc-d6cb7794dcd7d97b77283fbbe0026e63521d2375.tar.gz gcc-d6cb7794dcd7d97b77283fbbe0026e63521d2375.tar.bz2 |
fortran: Add -finline-intrinsics flag for MINLOC/MAXLOC [PR90608]
Introduce the -finline-intrinsics flag to control from the command line
whether to generate either inline code or calls to the functions from the
library, for the MINLOC and MAXLOC intrinsics.
The flag allows to specify inlining either independently for each intrinsic
(either MINLOC or MAXLOC), or all together. For each intrinsic, a default
value is set if none was set. The default value depends on the optimization
setting: inlining is avoided if not optimizing or if optimizing for size;
otherwise inlining is preferred.
There is no direct support for this behaviour provided by the .opt options
framework. It is obtained by defining three different variants of the flag
(finline-intrinsics, fno-inline-intrinsics, finline-intrinsics=) all using
the same underlying option variable. Each enum value (corresponding to an
intrinsic function) uses two identical bits, and the variable is initialized
with alternated bits, so that we can tell whether the value was set or not
by checking whether the two bits have different values.
PR fortran/90608
gcc/ChangeLog:
* flag-types.h (enum gfc_inlineable_intrinsics): New type.
gcc/fortran/ChangeLog:
* invoke.texi(finline-intrinsics): Document new flag.
* lang.opt (finline-intrinsics, finline-intrinsics=,
fno-inline-intrinsics): New flags.
* options.cc (gfc_post_options): If the option variable controlling
the inlining of MAXLOC (respectively MINLOC) has not been set, set
it or clear it depending on the optimization option variables.
* trans-intrinsic.cc (gfc_inline_intrinsic_function_p): Return false
if inlining for the intrinsic is disabled according to the option
variable.
gcc/testsuite/ChangeLog:
* gfortran.dg/minmaxloc_18.f90: New test.
* gfortran.dg/minmaxloc_18a.f90: New test.
* gfortran.dg/minmaxloc_18b.f90: New test.
* gfortran.dg/minmaxloc_18c.f90: New test.
* gfortran.dg/minmaxloc_18d.f90: New test.
Diffstat (limited to 'gcc/ChangeLog')
0 files changed, 0 insertions, 0 deletions