https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120881
--- Comment #11 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to cuilili from comment #10) > (In reply to Sam James from comment #9) > > Thanks both. > > > > H.J.'s is slightly less pessimising because it'll only affect functions > > where we actually emit a call, but I don't think it really matters here, and > > matching the general shrinkwrap logic seems better in case that was added > > for other reasons. > > > > So either WFM. > > I actually have the same concern, it's a bit strange that enabling -fprofile > or -fg would cause execution time changes. > > H.J. Can we insert mcount after NOTE_INSN_FUNCTION_BEG just like -mfentry? > You can try it with the testcase here.