Open Quuxplusone opened 12 years ago
Attachment is missing.
This is another case where "m" constraints referring to alloca objects get their own register instead of using the stack/frame pointer.
Attached z.o.ll
(23682 bytes, application/octet-stream): .ll file
Attached y.ll
(1110 bytes, application/octet-stream): further reduced testcase
(In reply to comment #3)
> This is another case where "m" constraints referring to alloca objects get
> their own register instead of using the stack/frame pointer.
Err, no, I'm pretty sure the issue is that there's an inline asm which requires
7 registers in a function using stack realignment (which means there are only 6
registers available).
> Err, no, I'm pretty sure the issue is that there's an inline asm which
requires
> 7 registers in a function using stack realignment (which means there are only
6
> registers available).
Interesting, bugpoint changes it from one to the other.
r144962 added a workaround for AddressSanitizer.
I had to extend the workaround (r147953).
Before that revision codegen fails even if -faddress-sanitizer does not cause
stack realignment.
% cat bug11395.c
void foo_386(int *a, const int *b,
unsigned int f, int d,
int h, int *c, int *e, int *g)
{
__asm__ volatile(
"int3"
: "+r"(a),
"+r"(b),
"+r"(c),
"+m"(h)
: "m"( d), "m"(g),
"m"(e) , "m"(f)
: "eax", "edx", "esi", "ecx"
);
}
clang -m32 -O1 -c -faddress-sanitizer -fno-omit-frame-pointer bug11395.c
bug11395.c:6:7: error: ran out of registers during register allocation
"int3"
^
1 error generated.
(In reply to comment #8)
> clang -m32 -O1 -c -faddress-sanitizer -fno-omit-frame-pointer bug11395.c
> bug11395.c:6:7: error: ran out of registers during register allocation
> "int3"
> ^
The given example doesn't compile even without -faddress-sanitizer: it requires
7 registers, and there are only 6 registers available.
Hm. It compiles fine for me w/o -faddress-sanitizer.
But it indeed fails with -mstackrealign:
clang -m32 bug11395.c -c -mstackrealign
bug11395.c:6:7: error: ran out of registers during register allocation
That's because the realignment will need another register.
z.o.ll
(23682 bytes, application/octet-stream)y.ll
(1110 bytes, application/octet-stream)