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

Richard Biener richard.guenther@gmail.com
Mon Jan 30 15:14:00 GMT 2017


On Mon, Jan 30, 2017 at 4:09 PM, Martin Liška <mliska@suse.cz> wrote:
> 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?

I guess yes...

> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?

Ok.

Thanks,
Richard.

> Martin



More information about the Gcc-patches mailing list