* recog.c (constrain_operands): Prefer exact match over reloadable
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Nov 2002 17:05:08 +0000 (17:05 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Nov 2002 17:05:08 +0000 (17:05 +0000)
EXTRA_MEMORY_CONSTRAINT or EXTRA_ADDRESS_CONSTRAINT.

* reload.c (find_reloads): Always reload EXTRA_ADDRESS_CONSTRAINT
operands in Pmode.

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

gcc/ChangeLog
gcc/recog.c
gcc/reload.c

index 189c310..327e475 100644 (file)
@@ -1,3 +1,11 @@
+2002-11-20  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * recog.c (constrain_operands): Prefer exact match over reloadable
+       EXTRA_MEMORY_CONSTRAINT or EXTRA_ADDRESS_CONSTRAINT.
+
+       * reload.c (find_reloads): Always reload EXTRA_ADDRESS_CONSTRAINT
+       operands in Pmode.
+
 2002-11-20  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR c/8518
index 649f366..d1db9c4 100644 (file)
@@ -2628,23 +2628,23 @@ constrain_operands (strict)
 
                  if (EXTRA_MEMORY_CONSTRAINT (c))
                    {
-                     /* Every memory operand can be reloaded to fit,
-                        so copy the condition from the 'm' case.  */
-                     if (GET_CODE (op) == MEM
-                         /* Before reload, accept what reload can turn into mem.  */
-                         || (strict < 0 && CONSTANT_P (op))
-                         /* During reload, accept a pseudo  */
-                         || (reload_in_progress && GET_CODE (op) == REG
-                             && REGNO (op) >= FIRST_PSEUDO_REGISTER))
+                     /* Every memory operand can be reloaded to fit.  */
+                     if (strict < 0 && GET_CODE (op) == MEM)
+                       win = 1;
+       
+                     /* Before reload, accept what reload can turn into mem.  */
+                     if (strict < 0 && CONSTANT_P (op))
+                       win = 1;
+
+                     /* During reload, accept a pseudo  */
+                     if (reload_in_progress && GET_CODE (op) == REG
+                         && REGNO (op) >= FIRST_PSEUDO_REGISTER)
                        win = 1;
                    }
                  if (EXTRA_ADDRESS_CONSTRAINT (c))
                    {
-                     /* Every address operand can be reloaded to fit,
-                        so copy the condition from the 'p' case.  */
-                     if (strict <= 0
-                         || (strict_memory_address_p (recog_data.operand_mode[opno],
-                                                      op)))
+                     /* Every address operand can be reloaded to fit.  */
+                     if (strict < 0)
                        win = 1;
                    }
 #endif
index 2b11988..56fcf46 100644 (file)
@@ -3283,6 +3283,10 @@ find_reloads (insn, replace, ind_levels, live_known, reload_reg_p)
                           the address into a base register.  */
                        this_alternative[i] = (int) MODE_BASE_REG_CLASS (VOIDmode);
                        badop = 0;
+
+                       /* Address constraints are reloaded in Pmode, no matter
+                          what mode is given in the machine description.  */
+                       operand_mode[i] = Pmode;
                        break;
                      }