]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: Fix target/optimize option handling with transiting between O1 to O2
authorAndrew Pinski <quic_apinski@quicinc.com>
Thu, 25 Jul 2024 16:37:49 +0000 (09:37 -0700)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 28 Jul 2024 17:06:00 +0000 (19:06 +0200)
commite93bb5da972050c78ac3b945c7ee9d548f064ef9
treeb97bd2bdf924160ce02c1b9411acdfb812c0fcac
parent65936041dbffdc735bed4dbf831462ff3922d28f
aarch64: Fix target/optimize option handling with transiting between O1 to O2

The problem here is the aarch64 backend enables -mearly-ra at -O2 and above but
it is not marked as an Optimization in the .opt file so enabling it sometimes
reset the target options when going from -O1 to -O2 for the first time.

Build and tested for aarch64-linux-gnu with no regressions.

PR target/116065

gcc/ChangeLog:

* config/aarch64/aarch64.opt (mearly-ra=): Mark as Optimization rather
than Save.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/sve/target_optimization-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/config/aarch64/aarch64.opt
gcc/testsuite/gcc.target/aarch64/sve/target_optimization-1.c [new file with mode: 0644]