This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Test case for __asm__ problems in i386
- To: law at cygnus dot com
- Subject: Re: Test case for __asm__ problems in i386
- From: Bernd Schmidt <crux at Pool dot Informatik dot RWTH-Aachen dot DE>
- Date: Tue, 19 May 1998 12:12:35 +0200 (MET DST)
- cc: Jim Wilson <wilson at cygnus dot com>, egcs-bugs at cygnus dot com
> > Not OK. His asms have rather obvious overlaps, if you remember to consider
> > the constraints.
> Considering the "r" to overlap with a single register is kind-of bogus.
>
> Do we really expect people to create a class with everything but
> the register they want to use as an explicit clobber? Writing
> asms, particularly on the x86 is hard enough already.
This would basically mean that we'd need one register class per register
to write meaningful assembler statements.
Please note that the following asm statement is provided as an example in
the GCC documentation:
asm volatile ("movc3 %0,%1,%2"
: /* no outputs */
: "g" (from), "g" (to), "g" (count)
: "r0", "r1", "r2", "r3", "r4", "r5");
I'm assuming here that r0..r5 are general registers and matched by the "g"
constraint. So the GCC documentation seems to explicitly allow the test
case which I posted.
> Ie, the clobber says "si" and the constraints for an input or output
> specify a register class that only has "si". Similarly for other
> regs which are in a class by themselves.
_This_ would have been illegal:
asm (" something " : : "S" (xxx) : "esi")
This case was discussed to death on the egcs list and everyone agrees
that you shouldn't write this sort of thing.
Bernd