]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
loop.c (check_final_value): Use v->always_executed instead of v->always_computable.
authorEric Botcazou <ebotcazou@multimania.com>
Sat, 15 Jun 2002 01:10:49 +0000 (01:10 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 15 Jun 2002 01:10:49 +0000 (18:10 -0700)
* loop.c (check_final_value): Use v->always_executed
instead of v->always_computable.
* unroll.c (final_giv_value): Don't calculate the final
value as a function of the biv if the giv is not computed
for every loop iteration.

From-SVN: r54634

gcc/ChangeLog
gcc/loop.c
gcc/unroll.c

index 2bb93edc14c3ada987b72f6841137341182e11b9..07c1bae0470a5ff254b4c57ac30ba101b218ca1b 100644 (file)
@@ -1,3 +1,11 @@
+2002-06-14  Eric Botcazou  <ebotcazou@multimania.com>
+
+       * loop.c (check_final_value): Use v->always_executed
+       instead of v->always_computable.
+       * unroll.c (final_giv_value): Don't calculate the final
+       value as a function of the biv if the giv is not computed
+       for every loop iteration.
+
 2002-06-14  Eric Botcazou  <ebotcazou@multimania.com>
  
        * loop.c (for_each_insn_in_loop): Fix formatting and comments.
index d3b62af6ceb1ace315cb4f5ab83b9dfd409cbba5..dc64b5c889aee274ba2c7d1a8d7b195299161225 100644 (file)
@@ -5943,7 +5943,8 @@ check_final_value (loop, v)
 #endif
 
   if ((final_value = final_giv_value (loop, v))
-      && (v->always_computable || last_use_this_basic_block (v->dest_reg, v->insn)))
+      && (v->always_executed
+         || last_use_this_basic_block (v->dest_reg, v->insn)))
     {
       int biv_increment_seen = 0, before_giv_insn = 0;
       rtx p = v->insn;
index 3b81d223ac76909dc5d252d1bab6131cabbcddde..a795dcbc202c313e2f73765276fd42a36412256b 100644 (file)
@@ -3249,7 +3249,8 @@ final_giv_value (loop, v)
 
   /* Try to calculate the final value as a function of the biv it depends
      upon.  The only exit from the loop must be the fall through at the bottom
-     (otherwise it may not have its final value when the loop exits).  */
+     and the insn that sets the giv must be executed on every iteration
+     (otherwise the giv may not have its final value when the loop exits).  */
 
   /* ??? Can calculate the final giv value by subtracting off the
      extra biv increments times the giv's mult_val.  The loop must have
@@ -3257,7 +3258,8 @@ final_giv_value (loop, v)
      to be known.  */
 
   if (n_iterations != 0
-      && ! loop->exit_count)
+      && ! loop->exit_count
+      && v->always_executed)
     {
       /* ?? It is tempting to use the biv's value here since these insns will
         be put after the loop, and hence the biv will have its final value