re PR rtl-optimization/7409 (loop optimization)
PR opt/7409 * loop.c (loop_regs_scan): Mark registers used for function argument passing as MAY_NOT_OPTIMIZE. From-SVN: r58160
This commit is contained in:
parent
3665e8a7ea
commit
6b4f2a99b7
|
@ -1,3 +1,9 @@
|
|||
2002-10-15 Ulrich Weigand <uweigand@de.ibm.com>
|
||||
|
||||
PR opt/7409
|
||||
* loop.c (loop_regs_scan): Mark registers used for function
|
||||
argument passing as MAY_NOT_OPTIMIZE.
|
||||
|
||||
2002-10-14 Neil Booth <neil@daikokuya.co.uk>
|
||||
|
||||
PR preprocessor/7862
|
||||
|
|
19
gcc/loop.c
19
gcc/loop.c
|
@ -9560,6 +9560,25 @@ loop_regs_scan (loop, extra_size)
|
|||
|
||||
if (GET_CODE (insn) == CODE_LABEL || GET_CODE (insn) == JUMP_INSN)
|
||||
memset (last_set, 0, regs->num * sizeof (rtx));
|
||||
|
||||
/* Invalidate all registers used for function argument passing.
|
||||
We check rtx_varies_p for the same reason as below, to allow
|
||||
optimizing PIC calculations. */
|
||||
if (GET_CODE (insn) == CALL_INSN)
|
||||
{
|
||||
rtx link;
|
||||
for (link = CALL_INSN_FUNCTION_USAGE (insn);
|
||||
link;
|
||||
link = XEXP (link, 1))
|
||||
{
|
||||
rtx op, reg;
|
||||
|
||||
if (GET_CODE (op = XEXP (link, 0)) == USE
|
||||
&& GET_CODE (reg = XEXP (op, 0)) == REG
|
||||
&& rtx_varies_p (reg, 1))
|
||||
regs->array[REGNO (reg)].may_not_optimize = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Invalidate all hard registers clobbered by calls. With one exception:
|
||||
|
|
Loading…
Reference in New Issue