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
This commit is contained in:
Martin Liska 2018-11-05 08:32:48 +01:00 committed by Martin Liska
parent 51020b00c7
commit e53f77c666
4 changed files with 36 additions and 3 deletions

View file

@ -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

View file

@ -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);
}
}

View file

@ -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

View file

@ -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"} } */