+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.
+
Mon Oct 14 20:33:12 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386.md (movv2di_internal): New pattern.
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: