aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-09-15 23:05:28 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-09-15 23:05:28 -0700
commit33fe78517fb405739fdd5ae4491aa93dd3656bd3 (patch)
treeff607d934212591193db48f5185f961cc2e91fe8 /gcc
parentcc3cdac3bbb122bd647b0d9521a9b8b93218fc21 (diff)
downloadgcc-33fe78517fb405739fdd5ae4491aa93dd3656bd3.zip
gcc-33fe78517fb405739fdd5ae4491aa93dd3656bd3.tar.gz
gcc-33fe78517fb405739fdd5ae4491aa93dd3656bd3.tar.bz2
(mark_set_resources): For CALL_INSN...
(mark_set_resources): For CALL_INSN, if followed by a NOTE_INSN_SETJMP note, then assume that all registers are clobbered. Handle case where CALL_INSN is in a sequence. From-SVN: r5334
Diffstat (limited to 'gcc')
-rw-r--r--gcc/reorg.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 9806216..ba3ef38 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -506,12 +506,18 @@ mark_set_resources (x, res, in_dest, include_delayed_effects)
if (include_delayed_effects)
{
rtx next = NEXT_INSN (x);
+ rtx prev = PREV_INSN (x);
res->cc = res->memory = 1;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (call_used_regs[i] || global_regs[i])
SET_HARD_REG_BIT (res->regs, i);
+ /* If X is part of a delay slot sequence, then NEXT should be
+ the first insn after the sequence. */
+ 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);
@@ -520,6 +526,12 @@ mark_set_resources (x, res, in_dest, include_delayed_effects)
&& GET_CODE (PATTERN (next)) == CLOBBER);
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
+ assume that this call can clobber any register. */
+ if (next && GET_CODE (next) == NOTE
+ && NOTE_LINE_NUMBER (next) == NOTE_INSN_SETJMP)
+ SET_HARD_REG_SET (res->regs);
}
/* ... and also what it's RTL says it modifies, if anything. */