From: Jakub Jelinek Date: Mon, 24 Jan 2005 09:10:53 +0000 (+0100) Subject: re PR middle-end/19551 (pure (complex types) function call removed as dead (LAPACK... X-Git-Tag: releases/gcc-3.4.4~277 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=edc4d558097add5c6b28f54deb04394c1fb1a957;p=thirdparty%2Fgcc.git 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. From-SVN: r94149 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d5b90bc76211..2053b9b87204 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2005-01-24 Jakub Jelinek + + * 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. + 2005-01-22 Ralf Corsepius PR target/19548 diff --git a/gcc/flow.c b/gcc/flow.c index 94a27c36f457..fed908dc451f 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 { @@ -2268,7 +2268,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; @@ -2302,10 +2302,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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc4e1108dbde..2076e09b26a9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-01-24 Jakub Jelinek + + PR middle-end/19551 + * gcc.c-torture/execute/20050121-1.c: New test. + 2005-01-24 David Billinghurst (David.Billinghurst@riotinto.com) PR other/16403