]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
AVR: ad target/113934 - Add option -mlra to enable LRA.
authorGeorg-Johann Lay <avr@gjlay.de>
Sat, 10 Aug 2024 08:05:55 +0000 (10:05 +0200)
committerGeorg-Johann Lay <avr@gjlay.de>
Sat, 10 Aug 2024 08:18:11 +0000 (10:18 +0200)
PR target/113934
gcc/
* config/avr/avr.opt (-mlra): New target option.
* config/avr/avr.cc (avr_use_lra_p): New function.
(TARGET_LRA_P): Use it.
(avr_hard_regno_mode_ok) [lra]: Don't disallow 4-byte modes for X.

gcc/config/avr/avr.cc
gcc/config/avr/avr.opt

index 5cfd67a8e7424e904267da5be28e7ab13316b0a7..27df4bc4146867cade91532dd13907fb3418a081 100644 (file)
@@ -14180,7 +14180,9 @@ avr_hard_regno_mode_ok (unsigned int regno, machine_mode mode)
        address registers is extreme stress test for reload.  */
 
   if (GET_MODE_SIZE (mode) >= 4
-      && regno >= REG_X)
+      && regno >= REG_X
+      // This problem only concerned the old reload.
+      && ! avr_lra_p)
     return false;
 
   /* All modes larger than 8 bits should start in an even register.  */
@@ -16682,6 +16684,15 @@ avr_float_lib_compare_returns_bool (machine_mode mode, enum rtx_code)
   return false;
 }
 
+
+/* Implement `TARGET_LRA_P'.  */
+
+static bool
+avr_use_lra_p ()
+{
+  return avr_lra_p;
+}
+
 \f
 
 /* Initialize the GCC target structure.  */
@@ -16824,7 +16835,7 @@ avr_float_lib_compare_returns_bool (machine_mode mode, enum rtx_code)
 #define TARGET_CONVERT_TO_TYPE avr_convert_to_type
 
 #undef TARGET_LRA_P
-#define TARGET_LRA_P hook_bool_void_false
+#define TARGET_LRA_P avr_use_lra_p
 
 #undef  TARGET_ADDR_SPACE_SUBSET_P
 #define TARGET_ADDR_SPACE_SUBSET_P avr_addr_space_subset_p
index c3ca8379ee3a4ef3dc670dfec6b3a7619d53275f..947489eddf0841da5553383094f3238b3cc9d772 100644 (file)
 ; along with GCC; see the file COPYING3.  If not see
 ; <http://www.gnu.org/licenses/>.
 
+mlra
+Target Var(avr_lra_p) UInteger Init(0) Optimization
+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.
+
 mcall-prologues
 Target Mask(CALL_PROLOGUES) Optimization
 Optimization. Use subroutines for function prologues and epilogues.