summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-28 18:03:56 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-28 18:03:56 +0000
commit421e19dde5ca91eb54aee9f8d15546a7c37c84a9 (patch)
treedd229dc2bdb52fc7314fe74408a642d2f50015b1 /gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c
parentbb3d0c3095a1485769ed129a6167f185afb64bee (diff)
downloadgcc-421e19dde5ca91eb54aee9f8d15546a7c37c84a9.tar.gz
* tree-ssa-threadupdate.c: (create_edge_and_update_destination_phis):
Update profile. * value-prof.c (tree_divmod_fixed_value_transform): Be more verbose in debug output. (tree_mod_subtract): Fix profile updating code. (tree_divmod_values_to_profile): Do not produce useless value profilers for divisions. * tree-prof.exp: Fix comment. * value-prof-1.c: New. * value-prof-2.c: New. * value-prof-3.c: New. * value-prof-4.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100298 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c
new file mode 100644
index 00000000000..4fff1123beb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c
@@ -0,0 +1,30 @@
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-tree-tree_profile" } */
+unsigned int a[1000];
+unsigned int b = 999;
+unsigned int c = 1002;
+unsigned int d = 1003;
+main ()
+{
+ int i;
+ unsigned int n;
+ for (i = 0; i < 1000; i++)
+ {
+ a[i]=1000+i;
+ }
+ for (i = 0; i < 1000; i++)
+ {
+ if (i % 2)
+ n = b;
+ else if (i % 3)
+ n = c;
+ else
+ n = d;
+ a[i] %= n;
+ }
+ return 0;
+}
+/* { dg-final-use { scan-tree-dump "Mod subtract transformation on insn" "tree_profile"} } */
+/* This is part of code checking that n is greater than the divisor so we are sure that it
+ didn't get optimized out. */
+/* { dg-final-use { scan-tree-dump "if \\(n \\>" "optimized"} } */
+/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */