MS/CW-style inline assembly for GCC

Geert Bosch bosch@gnat.com
Tue May 4 19:38:00 GMT 2004


On May 4, 2004, at 14:38, Richard Henderson wrote:
> That's what happens with gcc asms, yes.  It was much less clear
> what to do about msvc asms, mostly due to lack of registers, the
> pressure added by x86 elf -fpic code, and (perhaps unreasonable)
> customer expectation that it "just work".
>
> I presume you're also parsing the asm opcode to know what register
> class is needed at a particular point?

I think that is the major improvement that could be made
to GCC asms. Based on the assembly, the compiler determines
required constraints. If the constraints cannot be determined
or cannot be satisfied, the compiler should give a diagnostic.

This is not trivial of course, but I think the compiler could in
the majority of situations determine the constraints more
accurately than GCC users can. Over 90% of the GCC asms I see
have wrong constraints.

   -Geert



More information about the Gcc mailing list