diff options
| author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-26 20:29:55 +0000 |
|---|---|---|
| committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-06-26 20:29:55 +0000 |
| commit | b685e98d5ece5b46bca890899a57ae0b0f05dc2d (patch) | |
| tree | 1d11b2360b2b29aca14ff5f4bcb0b30e7377ab5f | |
| parent | 328637e8abd66c81b1bcfac25673112fc08f5968 (diff) | |
| download | ppe42-gcc-b685e98d5ece5b46bca890899a57ae0b0f05dc2d.tar.gz ppe42-gcc-b685e98d5ece5b46bca890899a57ae0b0f05dc2d.zip | |
* flow.c (propagate_one_insn): Preserve live-at-end registers
across tail calls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@68544 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/flow.c | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 735494437d4..274e7a531ab 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-06-26 Richard Henderson <rth@redhat.com> + + * flow.c (propagate_one_insn): Preserve live-at-end registers + across tail calls. + 2003-06-26 J"orn Rennecke <joern.rennecke@superh.com> * reload.c (can_reload_into): New function. diff --git a/gcc/flow.c b/gcc/flow.c index b08a6e8e331..58859405aab 100644 --- a/gcc/flow.c +++ b/gcc/flow.c @@ -1770,8 +1770,10 @@ propagate_one_insn (pbi, insn) if (GET_CODE (insn) == CALL_INSN) { - int i; + regset live_at_end; + bool sibcall_p; rtx note, cond; + int i; cond = NULL_RTX; if (GET_CODE (PATTERN (insn)) == COND_EXEC) @@ -1796,9 +1798,14 @@ propagate_one_insn (pbi, insn) mark_set_1 (pbi, CLOBBER, XEXP (XEXP (note, 0), 0), cond, insn, pbi->flags); - /* Calls change all call-used and global registers. */ + /* Calls change all call-used and global registers; sibcalls do not + clobber anything that must be preserved at end-of-function. */ + + sibcall_p = SIBLING_CALL_P (insn); + live_at_end = EXIT_BLOCK_PTR->global_live_at_start; for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) - if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i)) + if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i) + && ! (sibcall_p && REGNO_REG_SET_P (live_at_end, i))) { /* We do not want REG_UNUSED notes for these registers. */ mark_set_1 (pbi, CLOBBER, regno_reg_rtx[i], cond, insn, |

