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: need volatile for asm?


On 16/02/2011 11:59, Andi Hellmund wrote:
 > Would this be portable check, guaranteeing that compilation on other
 > machine with other gcc version will not do opposite ?

You are right, this is definitely NOT portable

And anyway, why not always putting it to volatile ? Once you started
embedding asm code, I guess you had a good reason for it to appear in
the output code...

Good point.



There are certainly times when you want to use embedded assembly, but don't always want it to appear on the output code - then gcc's ability to optimise and rearrange inline assembly is very nice. But this isn't one of the cases :-)





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