Re: Local variables reordering and 'asm volatile("" ::: "memory");'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 08, 2019 at 11:48:22PM +0300, Alexander Monakov wrote:
> (in general empty volatile asms with non-empty constraints is a nice tool for
> limiting what the compiler may do)

Yup.  But if you want to save yourself some headaches don't do an empty
template.  Inline asm with an empty template does not end up in the
resulting output file at all.  For "empty" asm that does in fact have
operands you can write e.g.

  asm("# %0" :: "g"(x));

which also nicely shows you where that input lives.  This isn't fully
portable (the comment character is different for different assembler
dialects).  You can just write a single space character in the template
if all you want is for the asm to show up in the assembler output.


Segher



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux