summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-prof
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-01 09:51:17 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-01 09:51:17 +0000
commit2ca9602aef62b968ae1b74dac3a6701800a8347f (patch)
tree52b69359b3f87422c526ceaffce8a62c3eb41364 /gcc/testsuite/gcc.dg/tree-prof
parent51b60a116d61e22b503d1d0061ab5046bccaa9b2 (diff)
downloadgcc-2ca9602aef62b968ae1b74dac3a6701800a8347f.tar.gz
* profile.c (compute_value_histograms): Fix thinko.
* value-prof.c: Include toplev.h (check_counter): New function. (tree_divmod_fixed_value_transform, tree_mod_pow2_value_transform, tree_mod_subtract_transform): Add sanity check. * val-prof-5.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102629 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-prof')
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c
new file mode 100644
index 00000000000..41a43c3a965
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c
@@ -0,0 +1,17 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
+int a[1000];
+int b=997;
+main()
+{
+ int i;
+ for (i = 0; i < 1000; i++)
+ if (a[i])
+ a[i]/=b;
+ else
+ a[i]/=b;
+ return 0;
+}
+/* { dg-final-use { scan-tree-dump "Div.mod by constant b..=997 transformation on insn" "tree_profile"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
+/* { dg-final-use { cleanup-tree-dump "optimized" } } */
+/* { dg-final-use { cleanup-tree-dump "tree_profile" } } */