This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] rebuild frequency after vrp
- From: Dehao Chen <dehao at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <richard dot guenther at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Mon, 2 Jun 2014 08:43:47 -0700
- Subject: [PATCH] rebuild frequency after vrp
- Authentication-results: sourceware.org; auth=none
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 {