aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg-Johann Lay <avr@gjlay.de>2024-08-10 10:05:55 +0200
committerGeorg-Johann Lay <avr@gjlay.de>2024-08-10 10:18:11 +0200
commit09a87ea666b28845a702d28cec6fee945b422dcd (patch)
tree0b14e85f026e00c215baab3e17d7464dc3cf6b63
parent8cc67b520968ca9a13fd96896522aa66e39a99e2 (diff)
downloadgcc-09a87ea666b28845a702d28cec6fee945b422dcd.zip
gcc-09a87ea666b28845a702d28cec6fee945b422dcd.tar.gz
gcc-09a87ea666b28845a702d28cec6fee945b422dcd.tar.bz2
AVR: ad target/113934 - Add option -mlra to enable LRA.
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.
-rw-r--r--gcc/config/avr/avr.cc15
-rw-r--r--gcc/config/avr/avr.opt4
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/config/avr/avr.cc b/gcc/config/avr/avr.cc
index 5cfd67a..27df4bc 100644
--- a/gcc/config/avr/avr.cc
+++ b/gcc/config/avr/avr.cc
@@ -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;
+}
+
/* 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
diff --git a/gcc/config/avr/avr.opt b/gcc/config/avr/avr.opt
index c3ca837..947489e 100644
--- a/gcc/config/avr/avr.opt
+++ b/gcc/config/avr/avr.opt
@@ -18,6 +18,10 @@
; 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.