diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-27 00:28:20 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-09-27 00:28:20 +0000 |
commit | 7c1224f0b7a15fb6d85b949357f1cf32996ebac3 (patch) | |
tree | 9147409c450eebfa8fb9dcf10bc9017909163274 | |
parent | 8192d06df3c7f976b50899a36c7c64963102810d (diff) | |
download | gcc-7c1224f0b7a15fb6d85b949357f1cf32996ebac3.tar.gz |
* emit-rtl.c (active_insn_p): Consider a clobber of the
function return value to be active even after reload.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57561 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/emit-rtl.c | 33 |
2 files changed, 33 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2458c15c5ae..5638d5db783 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2002-09-26 Richard Henderson <rth@redhat.com> + + * emit-rtl.c (active_insn_p): Consider a clobber of the + function return value to be active even after reload. + 2002-09-27 Alan Modra <amodra@bigpond.net.au> * doloop.c (doloop_modify_runtime <biv skips initial incr>): Adjust diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index a5a776041aa..ccd6cbad0aa 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -3022,11 +3022,34 @@ int active_insn_p (insn) rtx insn; { - return (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN - || (GET_CODE (insn) == INSN - && (! reload_completed - || (GET_CODE (PATTERN (insn)) != USE - && GET_CODE (PATTERN (insn)) != CLOBBER)))); + if (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN) + return true; + if (GET_CODE (insn) == INSN) + { + if (reload_completed) + { + rtx pat = PATTERN (insn); + + /* After reload, remaining USE insns are noops. */ + if (GET_CODE (pat) == USE) + return false; + + if (GET_CODE (pat) == CLOBBER) + { + /* ??? Don't skip past the clobber of the return register. + If we eliminate it, we risk a variety of life analysis + problems on broken code. */ + if (GET_CODE (XEXP (pat, 0)) == REG + && REG_FUNCTION_VALUE_P (XEXP (pat, 0))) + return true; + + /* Otherwise, clobbers don't do anything either. */ + return false; + } + } + return true; + } + return false; } rtx |