recog.c (constrain_operands): For a match, require that a non-register matches genera...
authorHans-Peter Nilsson <hp@axis.com>
Sat, 12 Nov 2005 07:12:09 +0000 (07:12 +0000)
committerHans-Peter Nilsson <hp@gcc.gnu.org>
Sat, 12 Nov 2005 07:12:09 +0000 (07:12 +0000)
* recog.c (constrain_operands) <case 'g'>: For a match, require
that a non-register matches general_operand when strict >= 0.

From-SVN: r106821

gcc/ChangeLog
gcc/recog.c

index 285101584b67018e2289b10bfb10e2150a73a2f2..f539184d3b0edc0082e7777bf3a2db72ef768452 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-12  Hans-Peter Nilsson  <hp@axis.com>
+
+       * recog.c (constrain_operands) <case 'g'>: For a match, require
+       that a non-register matches general_operand when strict >= 0.
+
 2005-11-11  Steven Bosscher  <stevenb@suse.de>
 
        * loop-invariant.c (move_loop_invariants): Fix a thinko in the
index 111f9cb62f87d96e321402ce4cba3b6b8a3b8763..16bb280d857cb0cab6b9c69ff08e9d8b3e5b60d3 100644 (file)
@@ -2429,16 +2429,22 @@ constrain_operands (int strict)
                break;
 
                /* No need to check general_operand again;
-                  it was done in insn-recog.c.  */
+                  it was done in insn-recog.c.  Well, except that reload
+                  doesn't check the validity of its replacements, but
+                  that should only matter when there's a bug.  */
              case 'g':
                /* Anything goes unless it is a REG and really has a hard reg
                   but the hard reg is not in the class GENERAL_REGS.  */
-               if (strict < 0
-                   || GENERAL_REGS == ALL_REGS
-                   || !REG_P (op)
-                   || (reload_in_progress
-                       && REGNO (op) >= FIRST_PSEUDO_REGISTER)
-                   || reg_fits_class_p (op, GENERAL_REGS, offset, mode))
+               if (REG_P (op))
+                 {
+                   if (strict < 0
+                       || GENERAL_REGS == ALL_REGS
+                       || (reload_in_progress
+                           && REGNO (op) >= FIRST_PSEUDO_REGISTER)
+                       || reg_fits_class_p (op, GENERAL_REGS, offset, mode))
+                     win = 1;
+                 }
+               else if (strict < 0 || general_operand (op, mode))
                  win = 1;
                break;