]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2013-11-21 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Nov 2013 09:15:38 +0000 (09:15 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Nov 2013 09:15:38 +0000 (09:15 +0000)
* tree-ssa-loop-ch.c (copy_loop_headers): Decrement
nb_iterations_upper_bound by one.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205198 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-ssa-loop-ch.c

index 1cfbefef29d45c8a5c3ad3abc01685203bff1d72..1ececafc8273a0acf25707d87d692fe7199e6abf 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-21  Richard Biener  <rguenther@suse.de>
+
+       * tree-ssa-loop-ch.c (copy_loop_headers): Decrement
+       nb_iterations_upper_bound by one.
+
 2013-11-21  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/59058
index df45c286790e35692ece6fb3874fe35e887601b2..ccaa9c8987e33f77607a9d586b665c8b6b9a6b6e 100644 (file)
@@ -243,6 +243,16 @@ copy_loop_headers (void)
         are not now, since there was the loop exit condition.  */
       split_edge (loop_preheader_edge (loop));
       split_edge (loop_latch_edge (loop));
+
+      /* We peeled off one iteration of the loop thus we can lower
+        the maximum number of iterations if we have a previously
+        recorded value for that.  */
+      double_int max;
+      if (get_max_loop_iterations (loop, &max))
+       {
+         max -= double_int_one;
+         loop->nb_iterations_upper_bound = max;
+       }
     }
 
   update_ssa (TODO_update_ssa);