aboutsummaryrefslogtreecommitdiff
path: root/gcc/lower-subreg.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/lower-subreg.c')
-rw-r--r--gcc/lower-subreg.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/lower-subreg.c b/gcc/lower-subreg.c
index b8e2eb6..e5e76b0 100644
--- a/gcc/lower-subreg.c
+++ b/gcc/lower-subreg.c
@@ -586,7 +586,7 @@ move_libcall_note (rtx old_start, rtx new_start)
static void
remove_retval_note (rtx insn1)
{
- rtx note0, insn0, note1, insn;
+ rtx note0, insn0, note1, insn, next;
note1 = find_reg_note (insn1, REG_RETVAL, NULL);
if (note1 == NULL_RTX)
@@ -598,8 +598,9 @@ remove_retval_note (rtx insn1)
remove_note (insn0, note0);
remove_note (insn1, note1);
- for (insn = insn0; insn != insn1; insn = NEXT_INSN (insn))
+ for (insn = insn0; (insn != insn1) && insn; insn = next)
{
+ next = NEXT_INSN (insn);
while (1)
{
rtx note;
@@ -1254,9 +1255,9 @@ decompose_multiword_subregs (void)
FOR_EACH_BB (bb)
{
- rtx insn;
+ rtx insn, next;
- FOR_BB_INSNS (bb, insn)
+ FOR_BB_INSNS_SAFE (bb, insn, next)
{
rtx next, pat;