Sorry, I see you did say I should run the gcc tests. I apologize for forgetting this. I’ll work on getting them to run here.
Chris et. all,
I have a fix for the assertion failure in the enclosed llvmmultalt8.patch file. I didn’t realize the input constraints could have different numbers of alternatives from the outputs, which now makes sense. The pr20314-2.c file now compiles on my 64-bit Linux box. However, it still has a problem on 32-bit Windows and 32-bit Linux:
fatal error: error in backend: Ran out of registers during register allocation!
Please check your inline asm statement for invalid constraints:
INLINEASM es:, 0, 10, %reg16396, 10, %reg16397, 10, %reg16398, 10, %reg16399, 10, %reg16400, 10, %reg16401,10, %reg16402, 10, %reg16403, 10, %reg16404, 10, %reg16405, 10, %reg16406, 10, %reg16407, 2147483657, %EAX, 2147549193, %ECX, 2147614729, %EDX, 2147680265, %ESI, 2147745801, %EDI, 2147811337, %EBX, 2147876873, %EBP, 2147942409, %reg16403, 2148007945, %reg16404, 2148073481, %reg16405, 2148139017, %reg16406, 2148204553, %reg16407, 14, %EFLAGS<earlyclobber,imp-def>, <>; GR32:%reg16396,16397,16398,16399,16400,16401,16402,16403,16404,16405,16406,16407,16403,16404,16405,16406,16407
For the code:
int a, b, c, d, e, f, g, h, i, j, k, l;
asm volatile (""
: [a] “+r” (a), [b] “+r” (b), [c] “+r” (c), [d] “+r” (d),
[e] “+r” (e), [f] “+r” (f), [g] “+r” (g), [h] “+r” (h),
[i] “+r” (i), [j] “+r” (j), [k] “+r” (k), [l] “+r” (l));
This confused me since it doesn’t use multiple-alternative constraints, meaning it should fall back to the original logic. I’m thinking this problem probably isn’t related to my code. To try to confirm this, I built an LLVM tree I had checked out on August 24 (rev 111968) and I see the same error.
If you agree, I’ll go ahead and check in my patches, and file a bug on the above error.
The llvmmultalt8.patch and the clangmultalt8.patch files have a little extra stuff I had just added previous to this, namely adding partial support for the E, F, and p constraint characters I saw from the GCC docs, and which should be benign.
Sorry for the hassle.
llvmmultalt8.patch (3.15 KB)
clangmultalt8.patch (555 Bytes)