This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
What to do against "X" constraints in asm statements
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 15 Jan 2002 16:42:53 +0100
- Subject: What to do against "X" constraints in asm statements
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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