This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

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


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.


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