-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.O-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: Windows
Description
If you compile a program with -Z no-landing-pads
plus -C lto
it is intended that all landing pads are removed. This does not happen on MSVC, however! A simple fn main() {}
compiled with LTO will still have a bunch of invoke
instructions lying around, even though they only call nounwind
functions.
I believe this is due to this check. Our personality functions, __C_specific_handler
and _except_handler3
, can receive control flow from normal faults, so LLVM won't optimize away the invoke
instructions.
Seems like we should use __CxxFrameHandler3
(the C++ personality function) if we can (or emulate it).
Metadata
Metadata
Assignees
Labels
A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.O-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: Windows