http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56099
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-01-24 19:22:43 UTC --- (In reply to comment #4) > You are saying I also need to place some __asm__ into this noinline function? > Doesn't this look like working around some bugs in gcc? User doesn't need to > know how gcc is doing this inside, weather it is cloning something or treats > it > as pure or not. noinline means do-not-inline, no matter what is inside. No it is not working around a bug in GCC. You wrote the function with no side effects so GCC decided to remove the call to the function as it has no side effects. The inline-asm causes GCC to see there are side effects in the function which are unknown to GCC and does nothing to it. > > I originally asked for a simple basic thing, and so many gcc guts got exposed > by this.