aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index e9fd22c1e6e..ff4ac8cfd8b 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -1591,7 +1591,7 @@ propagate_one_insn (struct propagate_block_info *pbi, rtx insn)
pbi->cc0_live = 0;
if (libcall_is_dead)
- prev = propagate_block_delete_libcall ( insn, note);
+ prev = propagate_block_delete_libcall (insn, note);
else
{
@@ -2271,7 +2271,7 @@ libcall_dead_p (struct propagate_block_info *pbi, rtx note, rtx insn)
{
rtx r = SET_SRC (x);
- if (GET_CODE (r) == REG)
+ if (GET_CODE (r) == REG || GET_CODE (r) == SUBREG)
{
rtx call = XEXP (note, 0);
rtx call_pat;
@@ -2305,10 +2305,20 @@ libcall_dead_p (struct propagate_block_info *pbi, rtx note, rtx insn)
call_pat = XVECEXP (call_pat, 0, i);
}
- return insn_dead_p (pbi, call_pat, 1, REG_NOTES (call));
+ if (! insn_dead_p (pbi, call_pat, 1, REG_NOTES (call)))
+ return 0;
+
+ while ((insn = PREV_INSN (insn)) != call)
+ {
+ if (! INSN_P (insn))
+ continue;
+ if (! insn_dead_p (pbi, PATTERN (insn), 0, REG_NOTES (insn)))
+ return 0;
+ }
+ return 1;
}
}
- return 1;
+ return 0;
}
/* Return 1 if register REGNO was used before it was set, i.e. if it is