]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: target/113934 - Use LRA per default.
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 27 Jun 2025 13:44:40 +0000 (15:44 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Fri, 27 Jun 2025 13:45:58 +0000 (15:45 +0200)
Now that the patches for PR120424 are upstream, the last known bug
associated with avr+lra has been fixed: PR118591.  So we can pull the
switch that turns on LRA per default.

This patch only sets -mlra per default.  It doesn't do any Reload related
cleanup or removal from the avr backend, hence -mno-lra still works.

The only new problem is that gcc.dg/torture/pr64088.c fails with LRA
but not with Reload.  Though that test case is awkward since it is UB
but expects the compiler to behave in a specific way which avr-gcc
doesn't do: PR116780.

This patch also avoids a relative recent ICE that breaks building libgcc:
R24:DI is allowed per hard_regno_mode_ok, but R26:SI is disallowed
for Reload for old reasons.  Outcome is that a split2 pattern for
R24:DI = zero_extend:DI (R22:SI) runs into an ICE.

AVR-LibC builds fine with this patch.
The AVR-LibC testsuite passes without errors.

gcc/
PR target/113934
* config/avr/avr.opt (-mlra): Turn on per default.

gcc/config/avr/avr.opt

index fcd2bf68f2a8686b38e1b386b5f319ac304fc9b9..988311927bda24aa75f371aeba97db9f9338d01d 100644 (file)
@@ -19,8 +19,8 @@
 ; <http://www.gnu.org/licenses/>.
 
 mlra
-Target Var(avropt_lra_p) UInteger Init(0) Optimization Undocumented
-Usa LRA for reload instead of the old reload framework.  This option is experimental, and it may be removed in future versions of the compiler.
+Target Var(avropt_lra_p) UInteger Init(1) Optimization Undocumented
+Usa LRA for reload instead of the old reload framework.  This option is experimental, on per default, and it may be removed in future versions of the compiler.
 
 mcall-prologues
 Target Mask(CALL_PROLOGUES) Optimization