Fix stdarg-3 regression on xstormy16 port
authorJeff Law <law@redhat.com>
Fri, 3 Apr 2020 23:47:18 +0000 (17:47 -0600)
committerJeff Law <law@redhat.com>
Fri, 3 Apr 2020 23:47:18 +0000 (17:47 -0600)
PR rtl-optimization/92264
* config/stormy16/stormy16.c (xstormy16_preferred_reload_class): Handle
reloading of auto-increment addressing modes.

gcc/ChangeLog
gcc/config/stormy16/stormy16.c

index 6317e385cac4b933b59972e018b256e97cfbc16a..25d1c5d1c381dbfb4f6f637c04d7708d65734096 100644 (file)
@@ -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
index 55fe82954c136831bcc527e756dd43b22915ae62..2141531e262845065e1bf676e753365750af4582 100644 (file)
@@ -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;