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

Martin Liška mliska@suse.cz
Mon Jan 30 15:09:00 GMT 2017


Hello.

During investigation of another issue, I accidentally came a profile inconsistency
mentioned in the PR. Problem is that flag_ipa_bit_cp is enabled in use stage of PGO
and not in instrumentation stage. That causes ccp1 to find nonzero bits and that leads
to a CFG changes as a condition can be folded away.

Solution is to enable the same flag in generate phase. However I've got one more question:
In -fprofile-generate we have 2 more functions available in symtab:

_GLOBAL__sub_I_00100_0_c ()
{
  <bb 2> [0.00%]:
  __gcov_init (&*.LPBX0);
  return;

}

_GLOBAL__sub_D_00100_1_c ()
{
  <bb 2> [0.00%]:
  __gcov_exit ();
  return;

}

I'm wondering whether it can potentially influence early inlining decision?

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-profile-corruption-with-O1-PR-gcov-profile-79259.patch
Type: text/x-patch
Size: 1684 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20170130/aae17e68/attachment.bin>


More information about the Gcc-patches mailing list