]> git.ipfire.org Git - thirdparty/gcc.git/commit
middle-end/60779 - LTO vs. -fcx-fortran-rules and -fcx-limited-range
authorRichard Biener <rguenther@suse.de>
Tue, 18 Feb 2025 11:52:34 +0000 (12:52 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 28 Apr 2025 09:27:30 +0000 (11:27 +0200)
commite543eaa671d40868575385360d13ef37d87fb2a0
tree78afec66caafc33c46cfece4339599d9a704ca50
parentb30424f43522171e8ffe587e0df0ce3627c88f6c
middle-end/60779 - LTO vs. -fcx-fortran-rules and -fcx-limited-range

The following changes how flag_complex_method is managed towards
being able to record that in the optimization set so we can stream
and restore it per function.  Currently -fcx-fortran-rules and
-fcx-limited-range are separate recorded options but saving/restoring
does not restore flag_complex_method which is later used in the
middle-end.

The solution is to make -fcx-fortran-rules and -fcx-limited-range
aliases of a new -fcx-method= switch that represents flag_complex_method
directly so we can save and restore it.

PR middle-end/60779
* common.opt (fcx-method=): New, map to flag_complex_method.
(Enum complex_method): New.
(fcx-limited-range): Alias to -fcx-method=limited-range.
(fcx-fortran-rules): Alias to -fcx-medhot=fortran.
* ipa-inline-transform.cc (inline_call): Check flag_complex_method.
* ipa-inline.cc (can_inline_edge_by_limits_p): Likewise.
* opts.cc (finish_options): Adjust.
(set_fast_math_flags): Likewise.
* doc/invoke.texi (fcx-method=): Document.

* gcc.dg/lto/pr60779_0.c: New testcase.
* gcc.dg/lto/pr60779_1.c: Likewise.
gcc/common.opt
gcc/doc/invoke.texi
gcc/ipa-inline-transform.cc
gcc/ipa-inline.cc
gcc/opts.cc
gcc/testsuite/gcc.dg/lto/pr60779_0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/lto/pr60779_1.c [new file with mode: 0644]