https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81128
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |wrong-code Last reconfirmed| |2017-06-20 Component|c |ipa CC| |marxin at gcc dot gnu.org, | |mliska at suse dot cz Ever confirmed|0 |1 Summary|Function multi-versioning |Function multi-versioning |does not work with -Ofast |does not work with -O Known to fail| |4.8.5, 6.3.1, 7.1.1, 8.0 --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- Confirmed. Even -O1 breaks it, I suppose we somehow inline the resolver improperly which means a bogus cgraph is constructed? GCC 4.8 gets it right at -O1 but fails at -O2, so I guess this never worked correctly. Declaring resolve_do_it_right_at_runtime with __attribute__((noinline,noclone)) doesn't fix this though... main () ends up calling the resolver directly, no ifunc is emitted. I'm not 100% sure this is proper use of attribute ifunc, defering to Martin here.