loop.c (combine_movables): Earlier insns don't match later ones.
authorDoug Evans <dje@seba.cygnus.com>
Wed, 27 Aug 1997 16:43:23 +0000 (16:43 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 27 Aug 1997 16:43:23 +0000 (10:43 -0600)
        * loop.c (combine_movables): Earlier insns don't match later ones.
Brought over from the fsf.

From-SVN: r14966

gcc/ChangeLog
gcc/loop.c

index 0483a4f8e25607b56742a0bcebec7d3d67c8cce9..473e0e2d4104ae7bf3f3a6da6be9dc3109d70f23 100644 (file)
@@ -1,3 +1,7 @@
+Wed Aug 27 01:56:18 1997  Doug Evans  <dje@seba.cygnus.com>
+
+       * loop.c (combine_movables): Earlier insns don't match later ones.
+
 Wed Aug 27 01:24:25 1997  H.J. Lu   (hjl@gnu.ai.mit.edu)
 
        * config/linux.h (CC1_SPEC): Define it only if not defined.
index f924e2a741691d07f06f2b3ae65b07bea160d441..5e0d1d1dac6c20f7c533f19f194db9c9d111dde9 100644 (file)
@@ -1342,7 +1342,9 @@ combine_movables (movables, nregs)
        bzero (matched_regs, nregs);
        matched_regs[regno] = 1;
 
-       for (m1 = movables; m1; m1 = m1->next)
+       /* We want later insns to match the first one.  Don't make the first
+          one match any later ones.  So start this loop at m->next.  */
+       for (m1 = m->next; m1; m1 = m1->next)
          if (m != m1 && m1->match == 0 && n_times_used[m1->regno] == 1
              /* A reg used outside the loop mustn't be eliminated.  */
              && !m1->global