loop.c (force_movables): Transitively increase the priorities of all insns forces...
authorUlrich Weigand <uweigand@de.ibm.com>
Fri, 6 Feb 2004 20:10:35 +0000 (20:10 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Fri, 6 Feb 2004 20:10:35 +0000 (20:10 +0000)
* loop.c (force_movables): Transitively increase the priorities of
all insns forces by an insn, not just the first one.

From-SVN: r77419

gcc/ChangeLog
gcc/loop.c

index 35aab6c99f59837f82ba8f8f6b4ba3b4b0856f0f..68530418c5d58dc6437d556ec1ed2aaf7de8885f 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-06  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * loop.c (force_movables): Transitively increase the priorities of
+       all insns forces by an insn, not just the first one.
+
 2004-02-06  Josef Zlomek  <zlomekj@suse.cz>
             Daniel Berlin <dberlin@dberlin.org>
 
index 55c9834b2885c787c1f563f655a625d1db80d2da..911d561fd6b9662408b70a8f031e90a3484e4e8d 100644 (file)
@@ -1469,12 +1469,18 @@ force_movables (struct loop_movables *movables)
          m = 0;
 
        /* Increase the priority of the moving the first insn
-          since it permits the second to be moved as well.  */
+          since it permits the second to be moved as well.
+          Likewise for insns already forced by the first insn.  */
        if (m != 0)
          {
+           struct movable *m2;
+
            m->forces = m1;
-           m1->lifetime += m->lifetime;
-           m1->savings += m->savings;
+           for (m2 = m1; m2; m2 = m2->forces)
+             {
+               m2->lifetime += m->lifetime;
+               m2->savings += m->savings;
+             }
          }
       }
 }