OSDN Git Service

PR target/36336
authorhutchinsonandy <hutchinsonandy@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 Jun 2008 18:24:27 +0000 (18:24 +0000)
committerhutchinsonandy <hutchinsonandy@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 15 Jun 2008 18:24:27 +0000 (18:24 +0000)
* config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for reg_equiv_constant.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136818 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 196c1ae..777743a 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 90e62a3..d915aff 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)                                        \
     {                                                                      \