loop.c (move_movables): Corrected threshold calculation for moved_once registers.
authorHerman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
Mon, 5 Oct 1998 20:48:22 +0000 (22:48 +0200)
committerJeff Law <law@gcc.gnu.org>
Mon, 5 Oct 1998 20:48:22 +0000 (14:48 -0600)
        * loop.c (move_movables): Corrected threshold calculation for
        moved_once registers.

From-SVN: r22847

gcc/ChangeLog
gcc/loop.c

index f42f2f97c00a934da478882febe2062d81d6f29c..df60f90982b01b9d6a1542ea1a6dced0bc63d609 100644 (file)
@@ -1,3 +1,8 @@
+1998-10-05 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+       * loop.c (move_movables): Corrected threshold calculation for
+       moved_once registers.
+
 Mon Oct  5 21:18:45 1998  Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
 
        * loop.c (combine_givs_p): Fix test for identical givs.
index 97744573c60f570e888914c185f825d35e4c8fa5..bf59f7233e28ef51e54fcf1839c6e1453872db5b 100644 (file)
@@ -1839,13 +1839,8 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
          if (loop_dump_stream)
            fprintf (loop_dump_stream, "savings %d ", savings);
 
-         if (moved_once[regno])
-           {
-             insn_count *= 2;
-
-             if (loop_dump_stream)
-               fprintf (loop_dump_stream, "halved since already moved ");
-           }
+         if (moved_once[regno] && loop_dump_stream)
+           fprintf (loop_dump_stream, "halved since already moved ");
 
          /* An insn MUST be moved if we already moved something else
             which is safe only if this one is moved too: that is,
@@ -1862,7 +1857,8 @@ move_movables (movables, threshold, insn_count, loop_start, end, nregs)
 
          if (already_moved[regno]
              || flag_move_all_movables
-             || (threshold * savings * m->lifetime) >= insn_count
+             || (threshold * savings * m->lifetime) >=
+                (moved_once[regno] ? insn_count * 2 : insn_count)
              || (m->forces && m->forces->done
                  && VARRAY_INT (n_times_used, m->forces->regno) == 1))
            {