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

Re: Test case for __asm__ problems in i386


>   > 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


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