This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: asm volatile("":::"memory) uncertainty.


On 16/05/16 04:51, Tom Udale wrote:
> My main fear is that the optimizer will look at the empty assembly "" 
> block and say "wait a minute, nothing is happening in there, how can it 
> possibly jump"?

It won't: GCC does not inspect asms to see if they do anything.
Besides, if you are really worried about that you can put a "do
nothing" comment into the asm.

I think your reasoning about asm goto is sound.  The only real
problem you'll have is that GCC will to remove statements which it
knows have no side effects.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]