Fix profile corruption with -O1 (PR gcov-profile/79259)

2017-01-30  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/79259
	* opts.c (common_handle_option): Enable flag_ipa_bit_cp w/
	-fprofile-generate.
2017-01-30  Martin Liska  <mliska@suse.cz>

	PR gcov-profile/79259
	* g++.dg/tree-prof/pr79259.C: New test.

From-SVN: r245031
This commit is contained in:
Martin Liska 2017-01-30 16:35:57 +01:00 committed by Martin Liska
parent 8fd23c8e9f
commit 37731134c7
4 changed files with 33 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-01-30 Martin Liska <mliska@suse.cz>
PR gcov-profile/79259
* opts.c (common_handle_option): Enable flag_ipa_bit_cp w/
-fprofile-generate.
2017-01-30 Martin Liska <mliska@suse.cz>
PR bootstrap/78985

View File

@ -2150,6 +2150,8 @@ common_handle_option (struct gcc_options *opts,
opts->x_flag_profile_values = value;
if (!opts_set->x_flag_inline_functions)
opts->x_flag_inline_functions = value;
if (!opts_set->x_flag_ipa_bit_cp)
opts->x_flag_ipa_bit_cp = value;
/* FIXME: Instrumentation we insert makes ipa-reference bitmaps
quadratic. Disable the pass until better memory representation
is done. */

View File

@ -1,3 +1,8 @@
2017-01-30 Martin Liska <mliska@suse.cz>
PR gcov-profile/79259
* g++.dg/tree-prof/pr79259.C: New test.
2017-01-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/79276

View File

@ -0,0 +1,20 @@
/* { dg-options "-O1" } */
inline bool
a (int b)
{
return (b & 5) != b;
}
int c;
int
fn2 ()
{
if (a (c == 0))
return 0;
}
int main()
{
fn2();
}