flags.h (flag_rerun_loop_opt): Declare.
authorJim Wilson <wilson@cygnus.com>
Sun, 9 Nov 1997 08:35:46 +0000 (08:35 +0000)
committerJeff Law <law@gcc.gnu.org>
Sun, 9 Nov 1997 08:35:46 +0000 (01:35 -0700)
        * flags.h (flag_rerun_loop_opt): Declare.
        * loop.c (invariant_p, case LABEL_REF): Check flag_rerun_loop_opt.
        * toplev.c (flag_rerum_loop_opt): Delete static.

From-SVN: r16389

gcc/ChangeLog
gcc/flags.h
gcc/loop.c
gcc/toplev.c

index 5db233fcf596ca2bcabb68c9ce13d76252c8cbfd..aaaa939c8210903b4dc74b2220db331fc1156407 100644 (file)
@@ -1,3 +1,9 @@
+Sun Nov  9 01:37:11 1997  Jim Wilson  (wilson@cygnus.com)
+
+       * flags.h (flag_rerun_loop_opt): Declare.
+       * loop.c (invariant_p, case LABEL_REF): Check flag_rerun_loop_opt.
+       * toplev.c (flag_rerum_loop_opt): Delete static.
+
 Sat Nov  8 18:20:21 1997  J"orn Rennecke <amylaar@cygnus.co.uk>
 
        * sh.h (ENABLE_REGMOVE_PASS): Define.
index 5b3c7639e06489c4f7b9bd0edc6552fe1da8df3a..ba057204dede483656eeeb5295fb2bb532ee5b32 100644 (file)
@@ -275,6 +275,10 @@ extern int flag_volatile_global;
 
 extern int flag_fast_math;
 
+/* Nonzero means to run loop optimizations twice.  */
+
+extern int flag_rerun_loop_opt;
+
 /* Nonzero means make functions that look like good inline candidates
    go inline.  */
 
index 70f15513cc9345b6442f72713e0d9cf656545637..e43d58518d167aae9648ea46cb1b0e49d540915a 100644 (file)
@@ -2847,7 +2847,12 @@ invariant_p (x)
 
         We don't know the loop bounds here though, so just fail for all
         labels.  */
-      if (flag_unroll_loops)
+      /* ??? This is also necessary if flag_rerun_loop_opt is true, because in
+        this case we may be doing loop unrolling the second time we run loop,
+        and hence the first loop run also needs this check.  There is no way
+        to check here whether the second run will actually do loop unrolling
+        though, as that info is in a local var in rest_of_compilation.  */
+      if (flag_unroll_loops || flag_rerun_loop_opt)
        return 0;
       else
        return 1;
index 956d78e09be6217ea8c829af1d23c1656014e07e..aeffbb3a85c83bfb2466fa75b4994c9dea5bc3fe 100644 (file)
@@ -508,7 +508,7 @@ static int flag_rerun_cse_after_loop;
 
 /* Nonzero means to run loop optimizations twice.  */
 
-static int flag_rerun_loop_opt;
+int flag_rerun_loop_opt;
 
 /* Nonzero for -finline-functions: ok to inline functions that look like
    good inline candidates.  */