]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/i386/i386.c (constant_call_address_operand): Accept
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Jan 2001 21:30:22 +0000 (21:30 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 7 Jan 2001 21:30:22 +0000 (21:30 +0000)
(const (plus (symbol_ref) (const_int))).
* config/i386/i386.h (PREDICATE_CODES): Add CONST for
constant_call_address_operand.

* gcc.c-torture/compile/20010107-1.c: New test.

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

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

index 6cb5c6d89e178a53b1325e5f646f8422f3d38450..e060e3ab6434c5f744a84d5badcd8500c89dfe1d 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * config/i386/i386.c (constant_call_address_operand): Accept
+       (const (plus (symbol_ref) (const_int))).
+       * config/i386/i386.h (PREDICATE_CODES): Add CONST for
+       constant_call_address_operand.
+
 2001-01-08  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
 
        * libgcc2.h (W_TYPE_SIZE): Fix case where MIN_UNITS_PER_WORD == 1
index c8a25c4aeed27c4c7ebb3630b1f104e2919670d1..3afc75cd29fb92bb5c7a86a8e4a01046640570d3 100644 (file)
@@ -1109,6 +1109,10 @@ constant_call_address_operand (op, mode)
      rtx op;
      enum machine_mode mode ATTRIBUTE_UNUSED;
 {
+  if (GET_CODE (op) == CONST
+      && GET_CODE (XEXP (op, 0)) == PLUS
+      && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
+    op = XEXP (XEXP (op, 0), 0);
   return GET_CODE (op) == SYMBOL_REF;
 }
 
index 8f219cf32471aae1ffabc64dc94db6fac4b0ce9c..104b3444165985a11702611a040676a5ef5aab4c 100644 (file)
@@ -2830,7 +2830,7 @@ do { long l;                                              \
                       LABEL_REF, SUBREG, REG, MEM}},                   \
   {"pic_symbolic_operand", {CONST}},                                   \
   {"call_insn_operand", {REG, SUBREG, MEM, SYMBOL_REF}},               \
-  {"constant_call_address_operand", {SYMBOL_REF}},                     \
+  {"constant_call_address_operand", {SYMBOL_REF, CONST}},              \
   {"const0_operand", {CONST_INT, CONST_DOUBLE}},                       \
   {"const1_operand", {CONST_INT}},                                     \
   {"const248_operand", {CONST_INT}},                                   \
index 0626643f7e2badad56b326f491911373d33f29a4..0d53b9383be233dbaf26eb7c086bad648ad2ac46 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-07  Jakub Jelinek  <jakub@redhat.com>
+
+       * gcc.c-torture/compile/20010107-1.c: New test.
+
 2001-01-07  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * gcc.c-torture/execute/builtin-noret-1.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20010107-1.c b/gcc/testsuite/gcc.c-torture/compile/20010107-1.c
new file mode 100644 (file)
index 0000000..222def4
--- /dev/null
@@ -0,0 +1,6 @@
+unsigned long x[4];
+
+void foo(void)
+{
+  ((void (*)())(x+2))();
+}