https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78529
--- Comment #37 from rguenther at suse dot de <rguenther at suse dot de> --- On Fri, 24 Aug 2018, joey.ye at arm dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78529 > > Joey Ye <joey.ye at arm dot com> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |joey.ye at arm dot com > > --- Comment #36 from Joey Ye <joey.ye at arm dot com> --- > Simply applying __attribute__((noipa)) to memset (and all other C lib > implementations) in chk.c prevents IPA analysis in the local implementation of > memset, thus avoids the issue when it is later replaced by a library copy. > > The workaround does pass this case in my experiment, which can be turn into a > patch after additional work and testing. Is it an acceptable workaround to > upstream? I guess so. As said in comment#33 building the -lib.c part w/o -flto (and optimization) and build it only once would be preferable.