summaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-12-16 23:16:01 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-12-16 23:16:01 +0000
commita1cf70709f949d0fe3594f4df2b4381211dfeeb1 (patch)
tree3092f4ddd4dd6afdf38355aed15cf21321dbfca1 /gcc/local-alloc.c
parent3f430a71b4dc0ecb276f4e51f9c36a1dfca9a760 (diff)
downloadgcc-a1cf70709f949d0fe3594f4df2b4381211dfeeb1.tar.gz
(optimize_reg_copy_2): Don't attempt optimization if destination
register dies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10780 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 647b2d53304..9d941fef162 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -865,7 +865,7 @@ optimize_reg_copy_1 (insn, dest, src)
In that case, we can replace all uses of DEST, starting with INSN and
ending with the set of SRC to DEST, with SRC. We do not do this
optimization if a CALL_INSN is crossed unless SRC already crosses a
- call.
+ call or if DEST dies before the copy back to SRC.
It is assumed that DEST and SRC are pseudos; it is too complicated to do
this for hard registers since the substitutions we may make might fail. */
@@ -930,6 +930,7 @@ optimize_reg_copy_2 (insn, dest, src)
}
if (reg_set_p (src, p)
+ || find_reg_note (p, REG_DEAD, dest)
|| (GET_CODE (p) == CALL_INSN && reg_n_calls_crossed[sregno] == 0))
break;
}