unroll.c (find_splittable_givs): Only share if two givs have the same add and multipl...
authorJohn F. Carr <jfc@mit.edu>
Sat, 23 Aug 1997 23:25:05 +0000 (23:25 +0000)
committerJeff Law <law@gcc.gnu.org>
Sat, 23 Aug 1997 23:25:05 +0000 (17:25 -0600)
        * unroll.c (find_splittable_givs): Only share if two givs have the
        same add and multiply values.
Fixes some testsuite failures on the x86.

From-SVN: r14908

gcc/ChangeLog
gcc/unroll.c

index 4ec6a68100e348c95f644fad1589deb33ad43a6d..483e9dbcfb1bf47ab6198e0e21b2ff1785737d16 100644 (file)
@@ -1,3 +1,8 @@
+Sat Aug 23 18:19:40 1997  John F. Carr  <jfc@mit.edu>
+
+       * unroll.c (find_splittable_givs): Only share if two givs have the
+       same add and multiply values.
+
 Sat Aug 23 14:36:27 1997  Jim Wilson  <wilson@cygnus.com>
 
        * m68k/next.h (GO_IF_INDEXABLE_BASE): Fix typo in undef.
index f1864d398b4410dc17fbdf89c6cd7be248e393b3..2fb1f9a8415890d84c8f529f68acf1b6f8ada9ee 100644 (file)
@@ -2849,7 +2849,14 @@ find_splittable_givs (bl, unroll_type, loop_start, loop_end, increment,
              else if (unroll_type != UNROLL_COMPLETELY
                       && v->giv_type == DEST_ADDR
                       && v->same && v->same->giv_type == DEST_ADDR
-                      && v->same->unrolled)
+                      && v->same->unrolled
+                      /* combine_givs_p may return true for some cases
+                         where the add and mult values are not equal.
+                         To share a register here, the values must be
+                         equal.  */
+                      && rtx_equal_p (v->same->mult_val, v->mult_val)
+                      && rtx_equal_p (v->same->add_val, v->add_val))
+
                {
                  v->dest_reg = v->same->dest_reg;
                  v->shared = 1;