aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-05-20 04:34:02 +0000
committerRichard Stallman <rms@gnu.org>1993-05-20 04:34:02 +0000
commit6ad216adda81c7bab0d9f4cd4887178f892ef8a1 (patch)
tree460fd96d0ccc005d463c9e083abfd1fc9324d095
parentdca821e1a9a0d5ed3a44fd6a1e15f7cb08833e58 (diff)
downloadgcc-6ad216adda81c7bab0d9f4cd4887178f892ef8a1.zip
gcc-6ad216adda81c7bab0d9f4cd4887178f892ef8a1.tar.gz
gcc-6ad216adda81c7bab0d9f4cd4887178f892ef8a1.tar.bz2
(scan_loop): Treat pseudo duplicated for exit tests just
like we treat user vars in seeing if we can move a SET. From-SVN: r4514
-rw-r--r--gcc/loop.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/loop.c b/gcc/loop.c
index 7c72e8c..357eee6 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -682,13 +682,16 @@ scan_loop (loop_start, end, nregs)
;
/* In order to move a register, we need to have one of three cases:
(1) it is used only in the same basic block as the set
- (2) it is not a user variable.
+ (2) it is not a user variable and it is not used in the
+ exit test (this can cause the variable to be used
+ before it is set just like a user-variable).
(3) the set is guaranteed to be executed once the loop starts,
and the reg is not used until after that. */
else if (! ((! maybe_never
&& ! loop_reg_used_before_p (set, p, loop_start,
scan_start, end))
- || ! REG_USERVAR_P (SET_DEST (PATTERN (p)))
+ || (! REG_USERVAR_P (SET_DEST (PATTERN (p)))
+ && ! REG_LOOP_TEST_P (SET_DEST (PATTERN (p))))
|| reg_in_basic_block_p (p, SET_DEST (PATTERN (p)))))
;
else if ((tem = invariant_p (src))