aboutsummaryrefslogtreecommitdiff
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-01-24 09:54:25 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2005-01-24 09:54:25 +0100
commitb77302be88147ea826ab87d7d31e810fa68f4279 (patch)
tree0acef8526681eeb1372d896c1eb2e4f5656de04d /gcc/flow.c
parent11c56af5905097e03289cdf395db4fb0eb78d61c (diff)
downloadgcc-b77302be88147ea826ab87d7d31e810fa68f4279.zip
gcc-b77302be88147ea826ab87d7d31e810fa68f4279.tar.gz
gcc-b77302be88147ea826ab87d7d31e810fa68f4279.tar.bz2
re PR middle-end/19551 (pure (complex types) function call removed as dead (LAPACK routine claic1.f bug))
* flow.c (propagate_one_insn): Formatting. PR middle-end/19551 * flow.c (libcall_dead_p): Be more conservative if unsure. If there are any instructions between insn and call, see if they are all dead before saying the libcall is dead. * gcc.c-torture/execute/20050121-1.c: New test. * gcc.dg/20050121-2.c: New test. From-SVN: r94145
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 36232e9..0aa23c0 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -1581,7 +1581,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
{
@@ -2284,7 +2284,7 @@ libcall_dead_p (struct propagate_block_info *pbi, rtx note, rtx insn)
{
rtx r = SET_SRC (x);
- if (REG_P (r))
+ if (REG_P (r) || GET_CODE (r) == SUBREG)
{
rtx call = XEXP (note, 0);
rtx call_pat;
@@ -2318,10 +2318,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;
}
/* 1 if register REGNO was alive at a place where `setjmp' was called