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

Uros Bizjak ubizjak@gmail.com
Sun Jan 14 17:27: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'

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