[PATCH, i386]: Commited: fix PR target/30413: %z produces ICE for char operands

Jan Hubicka hubicka@ucw.cz
Sun Jan 14 17:43:00 GMT 2007


> Jan Hubicka wrote:
> 
> >>Attached patch fixes PR target/30413. The problem was, that 
> >>print_operand() doesn't print 'b' for operands of size 1 for %zN 
> >>directive.
> >>   
> >>
> >I wonder if it ever makes sense to use 'z' in the byte operand size.
> >(unless I am mistaken, there are no i387 instructions with 8 bit
> >operand)
> > 
> >
> In case of i387 fild/fistp instruction, following code will produce 
> invalid asm:
> 
> void test(char *a)
> {
>  asm volatile ("fild%z0 %0" : : "m"(*a));
> }
> 
> and produced asm code will be rejected by gas:
> Error: suffix or operands invalid for `fild'

Yep, I've misread description of 'z' to be i386 related (other problem
is that we don't seem to have any user visible documentation of those
letters).  I agree that for "print the opcode suffix for the size of the
current operand." printing out 'b' makes sense.

We still should not ICE on operands of sizes we don't have suffixes for
(TImode and such).

Honza
> 
> However, gcc _did_ produce what was requested by user. Compiler is not 
> able to check asm templates, and it should not care even for the 
> templates like "asm volatile ("foo%z0ar %0" : : "m"(*a));". This invalid 
> instruction will be rejected by gas, not by gcc.
> 
> Uros.



More information about the Gcc-patches mailing list