From: Richard Kenner Date: Fri, 6 May 1994 21:52:34 +0000 (-0400) Subject: (mark_referenced_resources, mark_set_resources): Change from USE and X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f88b0a82c36eefd3b89399ce2b8f8ce1968da8c5;p=gcc.git (mark_referenced_resources, mark_set_resources): Change from USE and CLOBBER insns to using CALL_INSN_FUNCTION_USAGE. From-SVN: r7247 --- diff --git a/gcc/reorg.c b/gcc/reorg.c index b44bcfcde72..d537839493b 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -403,25 +403,27 @@ mark_referenced_resources (x, res, include_delayed_effects) if (global_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) - insn = PREV_INSN (insn); - - for ( ; (insn && GET_CODE (insn) == INSN - && GET_CODE (PATTERN (insn)) == USE); - insn = PREV_INSN (insn)) - { - for (i = 1; i < seq_size; i++) - { - rtx slot_pat = PATTERN (XVECEXP (sequence, 0, i)); - if (GET_CODE (slot_pat) == SET - && rtx_equal_p (SET_DEST (slot_pat), - XEXP (PATTERN (insn), 0))) - break; - } - if (i >= seq_size) - mark_referenced_resources (XEXP (PATTERN (insn), 0), res, 0); - } + { + rtx link; + + for (link = CALL_INSN_FUNCTION_USAGE (insn); + link; + link = XEXP (link, 1)) + if (GET_CODE (XEXP (link, 0)) == USE) + { + for (i = 1; i < seq_size; i++) + { + rtx slot_pat = PATTERN (XVECEXP (sequence, 0, i)); + if (GET_CODE (slot_pat) == SET + && rtx_equal_p (SET_DEST (slot_pat), + SET_DEST (XEXP (link, 0))) + break; + } + if (i >= seq_size) + mark_referenced_resources (SET_DEST (XEXP (link, 0)), + res, 0); + } + } } /* ... fall through to other INSN processing ... */ @@ -525,14 +527,13 @@ mark_set_resources (x, res, in_dest, include_delayed_effects) if (NEXT_INSN (prev) != x) next = NEXT_INSN (NEXT_INSN (prev)); - /* Skip any possible labels between the CALL_INSN and CLOBBERs. */ - while (GET_CODE (next) == CODE_LABEL) - next = NEXT_INSN (next); - - for (; (next && GET_CODE (next) == INSN - && GET_CODE (PATTERN (next)) == CLOBBER); - next = NEXT_INSN (next)) - mark_set_resources (XEXP (PATTERN (next), 0), res, 1, 0); + { rtx link; + for (link = CALL_INSN_FUNCTION_USAGE (insn); + link; + link = XEXP (link, 1)) + if (GET_CODE (XEXP (link, 0)) == CLOBBER) + mark_set_resources (SET_DEST (XEXP (link, 0)), res, 1, 0); + } /* Check for a NOTE_INSN_SETJMP. If it exists, then we must assume that this call can clobber any register. */