diff options
author | Martin Liska <mliska@suse.cz> | 2018-11-05 08:32:48 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2018-11-05 07:32:48 +0000 |
commit | e53f77c666d6806c2e8c288ca1affa1497453e57 (patch) | |
tree | 61dd6f8f15a1f10381470378b055d13766499c3e /gcc | |
parent | 51020b00c72fff04f3acd0cc21a61bedd789f39c (diff) | |
download | gcc-e53f77c666d6806c2e8c288ca1affa1497453e57.zip gcc-e53f77c666d6806c2e8c288ca1affa1497453e57.tar.gz gcc-e53f77c666d6806c2e8c288ca1affa1497453e57.tar.bz2 |
Fix setting of hotness in non-LTO mode (PR gcov-profile/77698).
2018-11-05 Martin Liska <mliska@suse.cz>
PR gcov-profile/77698
* ipa-profile.c (ipa_profile): Adjust hotness threshold
only in LTO mode.
2018-11-05 Martin Liska <mliska@suse.cz>
PR gcov-profile/77698
* gcc.dg/tree-prof/pr77698.c: New test.
From-SVN: r265784
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/ipa-profile.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/tree-prof/pr77698.c | 23 |
4 files changed, 36 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ac121a8..3ef29c5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-11-05 Martin Liska <mliska@suse.cz> + + PR gcov-profile/77698 + * ipa-profile.c (ipa_profile): Adjust hotness threshold + only in LTO mode. + 2018-11-04 Bernd Edlinger <bernd.edlinger@hotmail.de> PR tree-optimization/86572 diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c index c74f4a4..7065af5 100644 --- a/gcc/ipa-profile.c +++ b/gcc/ipa-profile.c @@ -533,11 +533,10 @@ ipa_profile (void) cumulated_size * 100.0 / overall_size); } - if (threshold > get_hot_bb_threshold () - || in_lto_p) + if (in_lto_p) { if (dump_file) - fprintf (dump_file, "Threshold updated.\n"); + fprintf (dump_file, "Setting hotness threshold in LTO mode.\n"); set_hot_bb_threshold (threshold); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a28d9a0..8f5bb2a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-11-05 Martin Liska <mliska@suse.cz> + + PR gcov-profile/77698 + * gcc.dg/tree-prof/pr77698.c: New test. + 2018-11-04 Bernd Edlinger <bernd.edlinger@hotmail.de> PR tree-optimization/86572 diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr77698.c b/gcc/testsuite/gcc.dg/tree-prof/pr77698.c new file mode 100644 index 0000000..201bfc7 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tree-prof/pr77698.c @@ -0,0 +1,23 @@ +/* { dg-options "-O2 -fno-tree-vectorize -funroll-loops --param max-unroll-times=4 -fno-inline -fdump-rtl-alignments" } */ + +volatile long int g; +volatile long int j = 0; + +void foo(long int *a, long int *b, long int n) +{ + long int i; + + for (i = 0; i < n; i++) + a[j] = *b; +} + +long int a, b; +int main() +{ + a = 1; b = 2; + foo(&a, &b, 1000000); + g = a+b; + return 0; +} + +/* { dg-final-use-not-autofdo { scan-rtl-dump-times "internal loop alignment added" 1 "alignments"} } */ |