-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Description
| Bugzilla Link | 2149 |
| Resolution | INVALID |
| Resolved on | Apr 24, 2010 07:06 |
| Version | 2.2 |
| OS | Linux |
| Reporter | LLVM Bugzilla Contributor |
| CC | @jayfoad |
Extended Description
The comment at the top of HandleInlinedInvoke() in lib/Transforms/Utils/InlineFunction.cpp says:
/// HandleInlinedInvoke - If we inlined an invoke site, we need to convert calls
/// in the body of the inlined function into invokes and turn unwind
/// instructions into branches to the invoke unwind dest.
I don't think it's safe to inline an unwind instruction and turn it into a branch to the invoke unwind destination, because any calls to llvm.eh.exception and llvm.eh.selector at the destination won't work.
(I'm assuming that the code generator implements these eh intrinsics by getting the exception pointer and exception selector from well-known native registers which are set up as part of the stack unwinding process. If you branch directly to the invoke unwind destination then these registers won't be set up.)
My suggested solution is not to inline any function containing an unwind instruction.