Commit f88b0a82 by Richard Kenner

(mark_referenced_resources, mark_set_resources): Change from USE and

CLOBBER insns to using CALL_INSN_FUNCTION_USAGE.

From-SVN: r7247
parent e3c69b8a
...@@ -403,25 +403,27 @@ mark_referenced_resources (x, res, include_delayed_effects) ...@@ -403,25 +403,27 @@ mark_referenced_resources (x, res, include_delayed_effects)
if (global_regs[i]) if (global_regs[i])
SET_HARD_REG_BIT (res->regs, i); SET_HARD_REG_BIT (res->regs, i);
/* Skip any labels between the CALL_INSN and possible USE insns. */ {
while (GET_CODE (insn) == CODE_LABEL) rtx link;
insn = PREV_INSN (insn);
for (link = CALL_INSN_FUNCTION_USAGE (insn);
for ( ; (insn && GET_CODE (insn) == INSN link;
&& GET_CODE (PATTERN (insn)) == USE); link = XEXP (link, 1))
insn = PREV_INSN (insn)) if (GET_CODE (XEXP (link, 0)) == USE)
{ {
for (i = 1; i < seq_size; i++) for (i = 1; i < seq_size; i++)
{ {
rtx slot_pat = PATTERN (XVECEXP (sequence, 0, i)); rtx slot_pat = PATTERN (XVECEXP (sequence, 0, i));
if (GET_CODE (slot_pat) == SET if (GET_CODE (slot_pat) == SET
&& rtx_equal_p (SET_DEST (slot_pat), && rtx_equal_p (SET_DEST (slot_pat),
XEXP (PATTERN (insn), 0))) SET_DEST (XEXP (link, 0)))
break; break;
} }
if (i >= seq_size) if (i >= seq_size)
mark_referenced_resources (XEXP (PATTERN (insn), 0), res, 0); mark_referenced_resources (SET_DEST (XEXP (link, 0)),
} res, 0);
}
}
} }
/* ... fall through to other INSN processing ... */ /* ... fall through to other INSN processing ... */
...@@ -525,14 +527,13 @@ mark_set_resources (x, res, in_dest, include_delayed_effects) ...@@ -525,14 +527,13 @@ mark_set_resources (x, res, in_dest, include_delayed_effects)
if (NEXT_INSN (prev) != x) if (NEXT_INSN (prev) != x)
next = NEXT_INSN (NEXT_INSN (prev)); next = NEXT_INSN (NEXT_INSN (prev));
/* Skip any possible labels between the CALL_INSN and CLOBBERs. */ { rtx link;
while (GET_CODE (next) == CODE_LABEL) for (link = CALL_INSN_FUNCTION_USAGE (insn);
next = NEXT_INSN (next); link;
link = XEXP (link, 1))
for (; (next && GET_CODE (next) == INSN if (GET_CODE (XEXP (link, 0)) == CLOBBER)
&& GET_CODE (PATTERN (next)) == CLOBBER); mark_set_resources (SET_DEST (XEXP (link, 0)), res, 1, 0);
next = NEXT_INSN (next)) }
mark_set_resources (XEXP (PATTERN (next), 0), res, 1, 0);
/* Check for a NOTE_INSN_SETJMP. If it exists, then we must /* Check for a NOTE_INSN_SETJMP. If it exists, then we must
assume that this call can clobber any register. */ assume that this call can clobber any register. */
......
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