Open Quuxplusone opened 13 years ago
Attached wmasm.c
(7099 bytes, text/plain): Problematic inline assembly from WindowMaker
The inlineasm instruction is using 5 virtual registers on top of the 5 clobbered registers. There is nothing the register allocator can do about that, x86 only has 6 available registers.
Those virtual registers are GEPs of stack objects. They should have been folded into the inlineasm addressing mode by isel.
BTW, the asm is modifying the stack pointer before using the "m" constraints. What could possibly go wrong!
The problem is that they're all memory constraints. Theoretically it should work since they'll just be memory operands. There are other, similar, bugs to this.
Still reproducable on trunk.
FWIW if they rewrote the code to be multiple inline asms instead of a single large one it would probably work.
Still fails on trunk:
[~]> clang -c -m32 wmasm.c
wmasm.c:35:10: error: inline assembly requires more registers than available
"pushl %%ebx \n\t"
^
wmasm.c:35:10: error: inline assembly requires more registers than available
wmasm.c:35:10: error: inline assembly requires more registers than available
wmasm.c:35:10: error: inline assembly requires more registers than available
wmasm.c:35:10: error: inline assembly requires more registers than available
wmasm.c:35:10: error: inline assembly requires more registers than available
wmasm.c:35:10: error: inline assembly requires more registers than available
7 errors generated.
wmasm.c
(7099 bytes, text/plain)