diff options
author | Martin Liska <mliska@suse.cz> | 2016-08-09 22:57:14 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2016-08-09 20:57:14 +0000 |
commit | dcb1e1379ea52c33e5025d6e5842c43888888afa (patch) | |
tree | 187f4b8334dcc9b7d561d703c32cb57e5646f3a5 /gcc/testsuite/gcc.dg | |
parent | 54b367dbd22e07e734a8632484e763bea16ced87 (diff) | |
download | gcc-dcb1e1379ea52c33e5025d6e5842c43888888afa.zip gcc-dcb1e1379ea52c33e5025d6e5842c43888888afa.tar.gz gcc-dcb1e1379ea52c33e5025d6e5842c43888888afa.tar.bz2 |
Fix POW2 histogram
* gcc.dg/tree-prof/val-prof-8.c: New test.
* value-prof.c (dump_histogram_value): Swap pow2 and non-pow2
values.
* libgcov-profiler.c (__gcov_pow2_profiler): Consider 0 as not
power of two.
From-SVN: r239304
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/val-prof-8.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-prof/val-prof-8.c b/gcc/testsuite/gcc.dg/tree-prof/val-prof-8.c new file mode 100644 index 0000000..2c505e3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/val-prof-8.c @@ -0,0 +1,19 @@ +/* { dg-options "-O0 -fdump-ipa-profile" } */ + +int +main (int argc, char **argv) +{ + unsigned u = (argc - 1); + int counter = 0; + + for (unsigned i = 0; i < 100; i++) + { + unsigned x = i < 10 ? 16 : 15; + counter += u % x; + } + + return counter; +} + +/* autofdo does not do value profiling so far */ +/* { dg-final-use-not-autofdo { scan-ipa-dump "Pow2 counter pow2:10 nonpow2:90." "profile" } } */ |