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: How to avoid code elimination


On Sun, 2017-11-26 at 12:08 +0100, phi gcc wrote:
> .
> .
> if(cond)
> { e=e;
> }
> .
> ....
> 
> I tried to compile with -O0 but to no joy gcc always remove my 'NOP'
> intruction knowing better than me what I could do with it.
> 
> Is there any other idioms I should use, may be an asm("nop") or the
> like I guess ?

Try declaring e "volatile".

Cheers,
Oleg


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