diff options
| author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-24 08:54:25 +0000 |
|---|---|---|
| committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-01-24 08:54:25 +0000 |
| commit | d7795efce29a8010afc6c71a9f8cbdf35ee48d59 (patch) | |
| tree | 0acef8526681eeb1372d896c1eb2e4f5656de04d /gcc/flow.c | |
| parent | 89d22fcbc075c21316b955348586343b26bae7cf (diff) | |
| download | ppe42-gcc-d7795efce29a8010afc6c71a9f8cbdf35ee48d59.tar.gz ppe42-gcc-d7795efce29a8010afc6c71a9f8cbdf35ee48d59.zip | |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/flow.c')
| -rw-r--r-- | gcc/flow.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/flow.c b/gcc/flow.c index 36232e914cd..0aa23c03d22 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 |

