OSDN Git Service

* config/mips/mips.h (PREDICATE_CODES): Add ADDRESSOF for predicates
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Jan 2003 09:43:23 +0000 (09:43 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Jan 2003 09:43:23 +0000 (09:43 +0000)
that match register_operands.
* config/mips/mips.c (reg_or_0_operand, true_reg_or_0_operand): Make
register_operand the default case.

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

gcc/ChangeLog
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20030109-1.c [new file with mode: 0644]

index cc6771b..7e02d6a 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-09  Richard Sandiford  <rsandifo@redhat.com>
+
+       * config/mips/mips.h (PREDICATE_CODES): Add ADDRESSOF for predicates
+       that match register_operands.
+       * config/mips/mips.c (reg_or_0_operand, true_reg_or_0_operand): Make
+       register_operand the default case.
+
 2003-01-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        PR c/8032
index 52b9415..5c0b78a 100644 (file)
@@ -780,15 +780,9 @@ reg_or_0_operand (op, mode)
        return 0;
       return op == CONST0_RTX (mode);
 
-    case REG:
-    case SUBREG:
-      return register_operand (op, mode);
-
     default:
-      break;
+      return register_operand (op, mode);
     }
-
-  return 0;
 }
 
 /* Return truth value of whether OP is a register or the constant 0,
@@ -807,15 +801,9 @@ true_reg_or_0_operand (op, mode)
     case CONST_DOUBLE:
       return op == CONST0_RTX (mode);
 
-    case REG:
-    case SUBREG:
-      return register_operand (op, mode);
-
     default:
-      break;
+      return register_operand (op, mode);
     }
-
-  return 0;
 }
 
 /* Return truth value if a CONST_DOUBLE is ok to be a legitimate constant.  */
index 5dee179..864be70 100644 (file)
@@ -3786,11 +3786,13 @@ typedef struct mips_args {
    macro are thoses used in the most insn patterns.  */
 
 #define PREDICATE_CODES                                                        \
-  {"uns_arith_operand",                { REG, CONST_INT, SUBREG }},            \
-  {"arith_operand",            { REG, CONST_INT, SUBREG }},            \
-  {"arith32_operand",          { REG, CONST_INT, SUBREG }},            \
-  {"reg_or_0_operand",         { REG, CONST_INT, CONST_DOUBLE, SUBREG }}, \
-  {"true_reg_or_0_operand",    { REG, CONST_INT, CONST_DOUBLE, SUBREG }}, \
+  {"uns_arith_operand",                { REG, CONST_INT, SUBREG, ADDRESSOF }}, \
+  {"arith_operand",            { REG, CONST_INT, SUBREG, ADDRESSOF }}, \
+  {"arith32_operand",          { REG, CONST_INT, SUBREG, ADDRESSOF }}, \
+  {"reg_or_0_operand",         { REG, CONST_INT, CONST_DOUBLE, SUBREG, \
+                                 ADDRESSOF }},                         \
+  {"true_reg_or_0_operand",    { REG, CONST_INT, CONST_DOUBLE, SUBREG, \
+                                 ADDRESSOF }},                         \
   {"small_int",                        { CONST_INT }},                         \
   {"large_int",                        { CONST_INT }},                         \
   {"mips_const_double_ok",     { CONST_DOUBLE }},                      \
@@ -3804,20 +3806,21 @@ typedef struct mips_args {
   {"call_insn_operand",                { CONST_INT, CONST, SYMBOL_REF, REG}},  \
   {"move_operand",             { CONST_INT, CONST_DOUBLE, CONST,       \
                                  SYMBOL_REF, LABEL_REF, SUBREG,        \
-                                 REG, MEM}},                           \
+                                 REG, MEM, ADDRESSOF }},               \
   {"movdi_operand",            { CONST_INT, CONST_DOUBLE, CONST,       \
-                                 SYMBOL_REF, LABEL_REF, SUBREG, REG,   \
-                                 MEM, SIGN_EXTEND }},                  \
-  {"se_register_operand",      { SUBREG, REG, SIGN_EXTEND }},          \
-  {"se_reg_or_0_operand",      { REG, CONST_INT, CONST_DOUBLE, SUBREG, \
+                                 SYMBOL_REF, LABEL_REF, SUBREG,        \
+                                 REG, MEM, ADDRESSOF, SIGN_EXTEND }},  \
+  {"se_register_operand",      { SUBREG, REG, ADDRESSOF,               \
                                  SIGN_EXTEND }},                       \
+  {"se_reg_or_0_operand",      { REG, CONST_INT, CONST_DOUBLE, SUBREG, \
+                                 ADDRESSOF, SIGN_EXTEND }},            \
   {"se_uns_arith_operand",     { REG, CONST_INT, SUBREG,               \
-                                 SIGN_EXTEND }},                       \
+                                 ADDRESSOF, SIGN_EXTEND }},            \
   {"se_arith_operand",         { REG, CONST_INT, SUBREG,               \
-                                 SIGN_EXTEND }},                       \
+                                 ADDRESSOF, SIGN_EXTEND }},            \
   {"se_nonmemory_operand",     { CONST_INT, CONST_DOUBLE, CONST,       \
                                  SYMBOL_REF, LABEL_REF, SUBREG,        \
-                                 REG, SIGN_EXTEND }},                  \
+                                 REG, ADDRESSOF, SIGN_EXTEND }},       \
   {"consttable_operand",       { LABEL_REF, SYMBOL_REF, CONST_INT,     \
                                  CONST_DOUBLE, CONST }},               \
   {"fcc_register_operand",     { REG, SUBREG }},                       \
index 2582c71..f5d0134 100644 (file)
@@ -1,3 +1,7 @@
+2003-01-09  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gcc.c-torture/compile/20030109-1.c: New test.
+
 2003-01-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
 
        * gcc.c-torture/execute/20030109-1.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030109-1.c b/gcc/testsuite/gcc.c-torture/compile/20030109-1.c
new file mode 100644 (file)
index 0000000..4df7d18
--- /dev/null
@@ -0,0 +1,6 @@
+void foo ()
+{
+  int x1, x2, x3;
+
+  bar (&x2 - &x1, &x3 - &x2);
+}