diff options
author | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-29 06:57:42 +0000 |
---|---|---|
committer | krebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-29 06:57:42 +0000 |
commit | fc7c3aae04abcc915f5067fd7e5510ba4b8d6daf (patch) | |
tree | a9b8896101a46f709414a0439dbbf005f2610a95 /gcc/regmove.c | |
parent | f3e0a067b0d9d15951375a256d0a752ab69eef01 (diff) | |
download | gcc-fc7c3aae04abcc915f5067fd7e5510ba4b8d6daf.tar.gz |
2007-03-29 Andreas Krebbel <krebbel1@de.ibm.com>
* regmove.c (optimize_reg_copy_1): Don't perform DEST->SRC repair action if
SRC->DEST replacement failed anyway.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123323 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regmove.c')
-rw-r--r-- | gcc/regmove.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/regmove.c b/gcc/regmove.c index 3c059f44a78..06272e5e770 100644 --- a/gcc/regmove.c +++ b/gcc/regmove.c @@ -471,15 +471,15 @@ optimize_reg_copy_1 (rtx insn, rtx dest, rtx src) if (sregno < FIRST_PSEUDO_REGISTER && reg_mentioned_p (dest, PATTERN (q))) failed = 1; + + /* Attempt to replace all uses. */ + else if (!validate_replace_rtx (src, dest, q)) + failed = 1; - /* Replace all uses and make sure that the register - isn't still present. */ - else if (validate_replace_rtx (src, dest, q) - && (sregno >= FIRST_PSEUDO_REGISTER - || ! reg_overlap_mentioned_p (src, - PATTERN (q)))) - ; - else + /* If this succeeded, but some part of the register + is still present, undo the replacement. */ + else if (sregno < FIRST_PSEUDO_REGISTER + && reg_overlap_mentioned_p (src, PATTERN (q))) { validate_replace_rtx (dest, src, q); failed = 1; |