[gcc/devel/ranger] Fix stdarg-3 regression on xstormy16 port

Aldy Hernandez aldyh@gcc.gnu.org
Wed Jun 17 20:10:42 GMT 2020


https://gcc.gnu.org/g:7f26e60c2600f0a676fc9370390ebf0a3c78f31c

commit 7f26e60c2600f0a676fc9370390ebf0a3c78f31c
Author: Jeff Law <law@redhat.com>
Date:   Fri Apr 3 17:47:18 2020 -0600

    Fix stdarg-3 regression on xstormy16 port
    
            PR rtl-optimization/92264
            * config/stormy16/stormy16.c (xstormy16_preferred_reload_class): Handle
            reloading of auto-increment addressing modes.

Diff:
---
 gcc/ChangeLog                  |  6 ++++++
 gcc/config/stormy16/stormy16.c | 12 +++++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6317e385cac..25d1c5d1c38 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2020-04-03  Jeff Law  <law@redhat.com>
+
+	PR rtl-optimization/92264
+	* config/stormy16/stormy16.c (xstormy16_preferred_reload_class): Handle
+	reloading of auto-increment addressing modes.
+
 2020-04-03  H.J. Lu  <hongjiu.lu@intel.com>
 
 	PR target/94467
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 55fe82954c1..2141531e262 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -497,7 +497,17 @@ xstormy16_secondary_reload_class (enum reg_class rclass,
 static reg_class_t
 xstormy16_preferred_reload_class (rtx x, reg_class_t rclass)
 {
-  if (rclass == GENERAL_REGS && MEM_P (x))
+  /* Only the first eight registers can be moved to/from memory.
+     So those prefer EIGHT_REGS.
+
+     Similarly reloading an auto-increment address is going to
+     require loads and stores, so we must use EIGHT_REGS for those
+     too.  */
+  if (rclass == GENERAL_REGS
+      && (MEM_P (x)
+	  || GET_CODE (x) == POST_INC
+	  || GET_CODE (x) == PRE_DEC
+	  || GET_CODE (x) == PRE_MODIFY))
     return EIGHT_REGS;
 
   return rclass;


More information about the Gcc-cvs mailing list