Skip to content

inlining unwind breaks eh intrinsics #2521

@llvmbot

Description

@llvmbot
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillainvalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions