Compiling the following functions with gcc-4.{1,2,3} results in an ICE. gcc-3.4.4 does not ICE: #include <emmintrin.h> static inline __m128i my_asm(__m128i a, __m128i b) { __m128i result; asm("pshufb\t%1,%0" : "=x"(result) : "X"(b), "0"(a)); return result; } __m128i foo(__m128i src) { return my_asm(src, _mm_set1_epi32(1)); } If the inline asm is called directly (not through an inline function) or if the "X" constraint changes to "mx" everything works fine.
"X" constraint means anything matches. Now why we are ICEing is a bit weird.
(In reply to comment #1) > "X" constraint means anything matches. Now why we are ICEing is a bit weird. I started using it because "g" doesn't seem to allow xmm references. Fortunately, "xm" seems to have the desired effect.
(In reply to comment #1) > "X" constraint means anything matches. Now why we are ICEing is a bit weird We hit: /* We have patterns that allow zero sets of memory, for instance. In 64-bit mode, we should probably support all 8-byte vectors, since we can in fact encode that into an immediate. */ if (GET_CODE (x) == CONST_VECTOR) { gcc_assert (x == CONST0_RTX (GET_MODE (x))); x = const0_rtx; } It is true that a message would be nice there, but it is also true that X is an invalid constraint for most (all?) of the instructions.