summaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-09-01 16:20:32 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-09-01 16:20:32 -0700
commite26a82e41e15d154c070a49bc4afae630eeeae1f (patch)
tree89803a1860f9e3acc2fcf4ca180e7e563fa5d2d1 /gcc/jump.c
parent549a367ad6bf68e95e6c08fe9fb49a29a4e92177 (diff)
downloadgcc-e26a82e41e15d154c070a49bc4afae630eeeae1f.tar.gz
(jump_optimize): When optimize conditional jump around
unconditional jump, handle case where prev_label can be zero. From-SVN: r5246
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index 4025d8bbb21..229cd8602a2 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1642,7 +1642,8 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
rtx prev_uses = prev_nonnote_insn (reallabelprev);
rtx prev_label = JUMP_LABEL (insn);
- ++LABEL_NUSES (prev_label);
+ if (prev_label)
+ ++LABEL_NUSES (prev_label);
if (invert_jump (insn, JUMP_LABEL (reallabelprev)))
{
@@ -1671,7 +1672,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
/* We can now safely delete the label if it is unreferenced
since the delete_insn above has deleted the BARRIER. */
- if (--LABEL_NUSES (prev_label) == 0)
+ if (prev_label && --LABEL_NUSES (prev_label) == 0)
delete_insn (prev_label);
continue;
}