http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56099
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Component|c |tree-optimization Resolution| |INVALID --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-01-24 18:45:19 UTC --- You want: __attribute__((noinline, noclone)) static int func_ni() { asm(""); return 1; } ---- CUT ---- So the function is not considered pure/const and does not get cloned either.