From eaf19aba9dd54803ac02782fc2c1945a6971e38f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sun, 7 Jan 2001 22:30:22 +0100 Subject: [PATCH] i386.c (constant_call_address_operand): Accept (const (plus (symbol_ref) (const_int))). * 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. * gcc.c-torture/compile/20010107-1.c: New test. From-SVN: r38783 --- gcc/ChangeLog | 7 +++++++ gcc/config/i386/i386.c | 4 ++++ gcc/config/i386/i386.h | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.c-torture/compile/20010107-1.c | 6 ++++++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/20010107-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6cb5c6d89e1..e060e3ab643 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2001-01-07 Jakub Jelinek + + * 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 * libgcc2.h (W_TYPE_SIZE): Fix case where MIN_UNITS_PER_WORD == 1 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index c8a25c4aeed..3afc75cd29f 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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; } diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 8f219cf3247..104b3444165 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -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}}, \ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0626643f7e2..0d53b9383be 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-01-07 Jakub Jelinek + + * gcc.c-torture/compile/20010107-1.c: New test. + 2001-01-07 Joseph S. Myers * 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 index 00000000000..222def4d9ef --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20010107-1.c @@ -0,0 +1,6 @@ +unsigned long x[4]; + +void foo(void) +{ + ((void (*)())(x+2))(); +} -- 2.30.2