re PR target/36336 (ICE push_reload - psuedo reg_equiv_constant)
authorAndy Hutchinson <hutchinsonandy@aim.com>
Sun, 15 Jun 2008 18:24:27 +0000 (18:24 +0000)
committerAndy Hutchinson <hutchinsonandy@gcc.gnu.org>
Sun, 15 Jun 2008 18:24:27 +0000 (18:24 +0000)
PR target/36336
* config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for reg_equiv_constant.

From-SVN: r136818

gcc/ChangeLog
gcc/config/avr/avr.h

index 196c1aef134eac0043a5d5b3b3fe08a09093a0a8..777743ae0ab1cba78cb154ec54e8eae0ba7468ec 100644 (file)
@@ -1,3 +1,9 @@
+2008-06-015  Andy Hutchinson  <hutchinsonandy@aim.com>
+
+       PR target/36336
+       * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for 
+       reg_equiv_constant.
+
 2008-06-15  Maxim Kuvyrkov  <maxim@codesourcery.com>
 
        * config/mips/loongson2ef.md: New file.
index 90e62a30b164d02589b7620296c2e8ba4ee97b58..d915aff10405fea7ab2486b59c3f7948b5096cf5 100644 (file)
@@ -437,6 +437,11 @@ extern int avr_reg_order[];
 }
 
 #define XEXP_(X,Y) (X)
+
+/* LEGITIMIZE_RELOAD_ADDRESS will allow register R26/27 to be used, where it
+   is no worse than normal base pointers R28/29 and R30/31. For example:
+   If base offset is greater than 63 bytes or for R++ or --R addressing.  */
+   
 #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN)    \
 do {                                                                       \
   if (1&&(GET_CODE (X) == POST_INC || GET_CODE (X) == PRE_DEC))            \
@@ -448,6 +453,7 @@ do {                                                                            \
     }                                                                      \
   if (GET_CODE (X) == PLUS                                                 \
       && REG_P (XEXP (X, 0))                                               \
+      && reg_equiv_constant[REGNO (XEXP (X, 0))] == 0                      \
       && GET_CODE (XEXP (X, 1)) == CONST_INT                               \
       && INTVAL (XEXP (X, 1)) >= 1)                                        \
     {                                                                      \