https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116065
--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:8a5f528fba788f2af40a15a999bb63a2a0f6f455 commit r15-2344-g8a5f528fba788f2af40a15a999bb63a2a0f6f455 Author: Andrew Pinski <quic_apin...@quicinc.com> Date: Thu Jul 25 09:37:49 2024 -0700 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_apin...@quicinc.com>