-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Open
Labels
clang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.miscompilation
Description
Clang relies on llvm.frameaddress(0)
returning RBP, which isn't the case on X64 Windows (see X86IselLowering::LowerFRAMEADDR
).
NOTE: I'm not sure whether this is a Clang implementation issue or if one could interpret it as LLVM making a bad assumption during codegen. I marked it as the former but this is up for debate and I'm starting to lean towards the latter.
Repro:
void *buf[5];
void foo() {
__builtin_longjmp(buf, 1);
}
int main() {
if (!__builtin_setjmp(buf)) {
foo();
}
}
Relevant assembly:
lea rax, [rbp - 128]
mov qword ptr [rip + buf], rax
Metadata
Metadata
Assignees
Labels
clang:codegenIR generation bugs: mangling, exceptions, etc.IR generation bugs: mangling, exceptions, etc.miscompilation