aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/i386
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-19 22:33:36 +0000
committerRichard Stallman <rms@gnu.org>1993-06-19 22:33:36 +0000
commit4f2c8ebb159ca57bbea0bc9ec26d0e4621c72d80 (patch)
tree7d953c1c97ce6357d7e525d64fdf191dca470b53 /gcc/config/i386
parent0eb60d83ecf95ac183f3a475099a38419eb5b1dd (diff)
downloadgcc-4f2c8ebb159ca57bbea0bc9ec26d0e4621c72d80.zip
gcc-4f2c8ebb159ca57bbea0bc9ec26d0e4621c72d80.tar.gz
gcc-4f2c8ebb159ca57bbea0bc9ec26d0e4621c72d80.tar.bz2
(call_insn_operand): Require constant address be a general_operand.
(expander_call_insn_operand): New fn (what call_insn_operand was). From-SVN: r4701
Diffstat (limited to 'gcc/config/i386')
-rw-r--r--gcc/config/i386/i386.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 7aecf5c..d0b1196 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -526,6 +526,26 @@ call_insn_operand (op, mode)
enum machine_mode mode;
{
if (GET_CODE (op) == MEM
+ && ((CONSTANT_ADDRESS_P (XEXP (op, 0))
+ /* This makes a difference for PIC. */
+ && general_operand (XEXP (op, 0), Pmode))
+ || (GET_CODE (XEXP (op, 0)) == REG
+ && XEXP (op, 0) != arg_pointer_rtx
+ && !(REGNO (XEXP (op, 0)) >= FIRST_PSEUDO_REGISTER
+ && REGNO (XEXP (op, 0)) <= LAST_VIRTUAL_REGISTER))))
+ return 1;
+ return 0;
+}
+
+/* Like call_insn_operand but allow (mem (symbol_ref ...))
+ even if pic. */
+
+int
+expander_call_insn_operand (op, mode)
+ rtx op;
+ enum machine_mode mode;
+{
+ if (GET_CODE (op) == MEM
&& (CONSTANT_ADDRESS_P (XEXP (op, 0))
|| (GET_CODE (XEXP (op, 0)) == REG
&& XEXP (op, 0) != arg_pointer_rtx