aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/predict-7.c
diff options
context:
space:
mode:
authorDehao Chen <dehao@google.com>2012-07-31 15:09:02 +0000
committerDehao Chen <dehao@gcc.gnu.org>2012-07-31 15:09:02 +0000
commitaa36f90b55f5f77036c6032f7f4de39fc88690c2 (patch)
tree0c14fd58169a249767c04ab5d10c6a26707fae72 /gcc/testsuite/gcc.dg/predict-7.c
parent86d4e13f065e69c61a7d40403431a604e9528864 (diff)
downloadgcc-aa36f90b55f5f77036c6032f7f4de39fc88690c2.zip
gcc-aa36f90b55f5f77036c6032f7f4de39fc88690c2.tar.gz
gcc-aa36f90b55f5f77036c6032f7f4de39fc88690c2.tar.bz2
predict.c (tree_estimate_probability_driver): Normalize the loop when initializing the loop optimizer.
2012-07-31 Dehao Chen <dehao@google.com> * predict.c (tree_estimate_probability_driver): Normalize the loop when initializing the loop optimizer. From-SVN: r190015
Diffstat (limited to 'gcc/testsuite/gcc.dg/predict-7.c')
-rw-r--r--gcc/testsuite/gcc.dg/predict-7.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/predict-7.c b/gcc/testsuite/gcc.dg/predict-7.c
new file mode 100644
index 0000000..2c1c36f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/predict-7.c
@@ -0,0 +1,17 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+
+extern int global;
+
+int bar (int);
+
+void foo (int base)
+{
+ int i;
+ while (global < 10)
+ for (i = base; i < 10; i++)
+ bar (i);
+}
+
+/* { dg-final { scan-tree-dump-times "loop branch heuristics" 0 "profile_estimate"} } */
+/* { dg-final { cleanup-tree-dump "profile_estimate" } } */