aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1995-03-29 14:38:28 -0800
committerJim Wilson <wilson@gcc.gnu.org>1995-03-29 14:38:28 -0800
commitc9a1bf2ec2a08709e499876d8614c40dc48b234b (patch)
treefe94c6fa26e0a7cef4232b509c874fd9d9d62c8c /gcc
parentce79abf32c694488933ef4594f8adfe6317236d7 (diff)
downloadgcc-c9a1bf2ec2a08709e499876d8614c40dc48b234b.zip
gcc-c9a1bf2ec2a08709e499876d8614c40dc48b234b.tar.gz
gcc-c9a1bf2ec2a08709e499876d8614c40dc48b234b.tar.bz2
(mark_referenced_resources): Make setjmp use all registers.
From-SVN: r9248
Diffstat (limited to 'gcc')
-rw-r--r--gcc/reorg.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 7c5e3c8..4c36d33 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -379,11 +379,13 @@ mark_referenced_resources (x, res, include_delayed_effects)
rtx insn = PREV_INSN (x);
rtx sequence = 0;
int seq_size = 0;
+ rtx next = NEXT_INSN (x);
int i;
/* If we are part of a delay slot sequence, point at the SEQUENCE. */
if (NEXT_INSN (insn) != x)
{
+ next = NEXT_INSN (NEXT_INSN (insn));
sequence = PATTERN (NEXT_INSN (insn));
seq_size = XVECLEN (sequence, 0);
if (GET_CODE (sequence) != SEQUENCE)
@@ -404,6 +406,18 @@ mark_referenced_resources (x, res, include_delayed_effects)
if (global_regs[i])
SET_HARD_REG_BIT (res->regs, i);
+ /* Check for a NOTE_INSN_SETJMP. If it exists, then we must
+ assume that this call can need any register.
+
+ This is done to be more conservative about how we handle setjmp.
+ We assume that they both use and set all registers. Using all
+ registers ensures that a register will not be considered dead
+ just because it crosses a setjmp call. A register should be
+ considered dead only if the setjmp call returns non-zero. */
+ if (next && GET_CODE (next) == NOTE
+ && NOTE_LINE_NUMBER (next) == NOTE_INSN_SETJMP)
+ SET_HARD_REG_SET (res->regs);
+
{
rtx link;