Commit 28d52ffb by Richard Henderson Committed by Richard Henderson

i386.c (call_insn_operand): Reject const_int.

        * i386.c (call_insn_operand): Reject const_int.
        (expander_call_insn_operand): Use call_insn_operand.

From-SVN: r29385
parent 06b8b730
Mon Sep 13 15:21:46 1999 Richard Henderson <rth@cygnus.com>
* i386.c (call_insn_operand): Reject const_int.
(expander_call_insn_operand): Use call_insn_operand.
Mon Sep 13 17:44:28 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Mon Sep 13 17:44:28 1999 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.c (getrusage): Wrap prototype arguments in PROTO(). * gcc.c (getrusage): Wrap prototype arguments in PROTO().
......
...@@ -931,10 +931,9 @@ pic_symbolic_operand (op, mode) ...@@ -931,10 +931,9 @@ pic_symbolic_operand (op, mode)
return 0; return 0;
} }
/* Test for a valid operand for a call instruction. /* Test for a valid operand for a call instruction. Don't allow the
Don't allow the arg pointer register or virtual regs arg pointer register or virtual regs since they may decay into
since they may change into reg + const, which the patterns reg + const, which the patterns can't handle. */
can't handle yet. */
int int
call_insn_operand (op, mode) call_insn_operand (op, mode)
...@@ -953,36 +952,27 @@ call_insn_operand (op, mode) ...@@ -953,36 +952,27 @@ call_insn_operand (op, mode)
&& REGNO (op) <= LAST_VIRTUAL_REGISTER))) && REGNO (op) <= LAST_VIRTUAL_REGISTER)))
return 0; return 0;
/* Disallow `call 1234'. Due to varying assembler lameness this
gets either rejected or translated to `call .+1234'. */
if (GET_CODE (op) == CONST_INT)
return 0;
/* Otherwise we can allow any general_operand in the address. */ /* Otherwise we can allow any general_operand in the address. */
return general_operand (op, Pmode); return general_operand (op, Pmode);
} }
/* Like call_insn_operand but allow (mem (symbol_ref ...)) /* Like call_insn_operand but allow (mem (symbol_ref ...)) even if pic. */
even if pic. */
int int
expander_call_insn_operand (op, mode) expander_call_insn_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED; enum machine_mode mode;
{ {
if (GET_CODE (op) != MEM) if (GET_CODE (op) == MEM
return 0; && GET_CODE (XEXP (op, 0)) == SYMBOL_REF)
op = XEXP (op, 0);
/* Direct symbol references. */
if (CONSTANT_ADDRESS_P (op))
return 1; return 1;
/* Disallow indirect through a virtual register. This leads to return call_insn_operand (op, mode);
compiler aborts when trying to eliminate them. */
if (GET_CODE (op) == REG
&& (op == arg_pointer_rtx
|| (REGNO (op) >= FIRST_PSEUDO_REGISTER
&& REGNO (op) <= LAST_VIRTUAL_REGISTER)))
return 0;
/* Otherwise we can allow any general_operand in the address. */
return general_operand (op, mode);
} }
int int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment