http://llvm.org/bugs/show_bug.cgi?id=13515

             Bug #: 13515
           Summary: JIT::runFunction() creates stubs with internal linkage
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Target-Independent JIT
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


JIT::runFunction() creates stubs with internal linkage:

"
  // First, create the function.
  FunctionType *STy=FunctionType::get(RetTy, false);
  Function *Stub = Function::Create(STy, Function::InternalLinkage, "",
                                    F->getParent());
"

However, this is not fine when the executed function calls certain module
passes, like the inliner. The inliner removes all unreachable internal
functions, and therefore the stub function will be deleted before it returns,
thus leading to crashes.

I can see two solutions:
 - create stubs with external linkage
 - add the stubs to @llvm.compiler.used

Probably the 2nd solution is overkill, and I can't see any real drawback of
solution 1).

MCJIT doesn't implement a fallback mechanism for the fast-path yet, so it
doesn't suffer from this bug.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to