This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] rebuild frequency after vrp


This patch rebuilds frequency after vrp.

Bootstrapped and testing on-going. OK for trunk if test pass?

Thanks,
Dehao

gcc/ChangeLog:
2014-06-02  Dehao Chen  <dehao@google.com>

        PR tree-optimization/61384
        * tree-vrp.c (execute_vrp): rebuild frequency after vrp.

gcc/testsuite/ChangeLog:
2014-06-02  Dehao Chen  <dehao@google.com>

        PR tree-optimization/61384
        * gcc.dg/pr61384.c: New testcase.

Index: gcc/testsuite/gcc.dg/pr61384.c
===================================================================
--- gcc/testsuite/gcc.dg/pr61384.c (revision 0)
+++ gcc/testsuite/gcc.dg/pr61384.c (revision 0)
@@ -0,0 +1,32 @@
+/* PR tree-optimization/61384 */
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int a, b, d, e, g, h;
+static int c = 1, f[5];
+
+int
+fn1 (int p1, int p2)
+{
+  return p1 && p2 && p2;
+}
+
+void
+fn2 ()
+{
+  for (d = 0; d < 1; d++)
+    {
+      g = f[0];
+      e = 0;
+      h = fn1 (1, (a && c) ^ b);
+    }
+  for (; e < 5; e++)
+    f[e] = 1;
+}
+
+int
+main ()
+{
+  fn2 ();
+  return 0;
+}

Index: gcc/tree-vrp.c
===================================================================
--- gcc/tree-vrp.c (revision 211137)
+++ gcc/tree-vrp.c (working copy)
@@ -9794,7 +9794,7 @@ execute_vrp (void)

   scev_finalize ();
   loop_optimizer_finalize ();
-  return 0;
+  return TODO_rebuild_frequencies;
 }

 namespace {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]