aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1998-10-19 12:20:32 +0000
committerJeff Law <law@gcc.gnu.org>1998-10-19 06:20:32 -0600
commite1f7435e415108d10eb601d21b5785bbbc838e54 (patch)
treeb1a9832b2f3894b411416df36de55cfcff6ee8e0 /gcc
parent38bf4c6fcdb82bd51a0293d6c64695499083aefb (diff)
downloadgcc-e1f7435e415108d10eb601d21b5785bbbc838e54.zip
gcc-e1f7435e415108d10eb601d21b5785bbbc838e54.tar.gz
gcc-e1f7435e415108d10eb601d21b5785bbbc838e54.tar.bz2
loop.c (scan_loop): Be more selective about what invariants are moved out of a loop.
* loop.c (scan_loop): Be more selective about what invariants are moved out of a loop. From-SVN: r23178
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/loop.c21
2 files changed, 11 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6acdbae..5d3a4cb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Mon Oct 19 11:40:56 1998 Jeffrey A Law (law@cygnus.com)
+
+ * loop.c (scan_loop): Be more selective about what invariants are
+ moved out of a loop.
+
Mon Oct 19 10:46:58 PDT 1998 Jeff Law (law@cygnus.com)
* version.c: Bump for snapshot.
diff --git a/gcc/loop.c b/gcc/loop.c
index 7929920..749a2ac 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -837,13 +837,7 @@ scan_loop (loop_start, end, unroll_p, bct_p)
We don't know its life-span, so we can't compute the benefit. */
if (REGNO (SET_DEST (set)) >= max_reg_before_loop)
;
- else if (/* The set is a user-variable or it is used in
- the exit test (this can cause the variable to be
- used before it is set just like a
- user-variable)... */
- (REG_USERVAR_P (SET_DEST (set))
- || REG_LOOP_TEST_P (SET_DEST (set)))
- /* And the set is not guaranteed to be executed one
+ else if (/* The set is not guaranteed to be executed one
the loop starts, or the value before the set is
needed before the set occurs... */
&& (maybe_never
@@ -854,14 +848,11 @@ scan_loop (loop_start, end, unroll_p, bct_p)
something after this point in the loop might
depend on its value before the set). */
&& !reg_in_basic_block_p (p, SET_DEST (set)))
- /* It is unsafe to move the set. The fact that these
- three conditions are considered in conjunction means
- that we are assuming various conditions, such as:
-
- o It's OK to move a set of a variable which was not
- created by the user and is not used in an exit test
- even if that point in the set would not be reached
- during execution of the loop. */
+ /* It is unsafe to move the set.
+
+ This code used to consider it OK to move a set of a variable
+ which was not created by the user and not used in an exit test.
+ That behavior is incorrect and was removed. */
;
else if ((tem = invariant_p (src))
&& (dependencies == 0