What to do against "X" constraints in asm statements
Jakub Jelinek
jakub@redhat.com
Tue Jan 15 09:17:00 GMT 2002
Hi!
What do you think should be done against crap like:
/* { dg-do compile } */
/* { dg-options "-O2 -funroll-all-loops" } */
typedef union {
float sf[4];
} __attribute__ ((aligned (16))) A;
void foo (const float *x, int length)
{
int i;
for (i = 0; i < length; i += 4)
__asm__ __volatile__ ("xmms %0, %%xmms1" : : "X" (*(A *)(x + i)));
}
This results in internal error in the (likely) case that %0 should expand to
something not representable.
Shouldn't we issue an error if "X" constraint is seen and __asm pattern
wants that operand emitted, or are ICEs allowed if user messes with __asm
improperly?
The only thing where "X" makes sense in __asm is IMHO if the operand is not
referenced in the pattern as in:
__asm ("" : : "X" (foo));
Jakub
More information about the Gcc
mailing list