This is the mail archive of the gcc@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]

AW: basic asm and memory clobbers - Proposed solution


Hi,


I just found this in the docs:

The compiler copies the assembler instructions in a basic @code{asm}
verbatim to the assembly language output file, without
processing dialects or any of the @samp{%} operators that are available with
extended @code{asm}. This results in minor differences between basic
@code{asm} strings and extended @code{asm} templates. For example, to refer to
registers you might use @samp{%eax} in basic @code{asm} and
@samp{%%eax} in extended @code{asm}.


So it might be good to warn about % in asm statements too, because changing
anything on the asm syntax can be is quite dangerous.


And I wonder what the exact equivalence of asm("") is
in extended asm ("":::) or asm volatile ("":::) ?


Well, I start to think that Jeff is right, and we should treat a asm ("") as if it
were asm volatile ("" ::: ) but if the asm ("nonempty with optional %") we should
treat it as asm volatile ("nonempty with optional %%" ::: "memory").

Our docs should say that explicitly, and the implementation should follow that
direction.


Bernd.

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