[LLVMbugs] [Bug 15127] New: jit __builtin_setjmp on X86

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jan 30 14:01:53 PST 2013


             Bug #: 15127
           Summary: jit __builtin_setjmp on X86
           Product: compiler-rt
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: compiler-rt
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: vtjnash at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 9953
  --> http://llvm.org/bugs/attachment.cgi?id=9953
add MBB support to emitDisplacementField and emitMemModRMByte

In attempting to use the llvm.eh.sjlj.setjmp intrinsic in a JIT application on
X86, codegen fails to compile the setjmp instruction. However, llc successfully
handles very similar code in test/CodeGen/X86/sjlj.ll, so I may just be doing
something incorrectly.

The relevant code snippet being compiled is:
  %6 = alloca [5 x i8*]
  %7 = bitcast [5 x i8*]* %6 to i8**
  %8 = call i8* @llvm.frameaddress(i32 0)
  store volatile i8* %8, i8** %7
  %9 = call i8* @llvm.stacksave()
  %10 = getelementptr i8** %7, i32 2
  store volatile i8* %9, i8** %10
  %11 = call i32 @llvm.eh.sjlj.setjmp(i8* bitcast ([5 x i8*]* %6 to i8*))

Which fails with:
llvm-3.2/include/llvm/CodeGen/MachineOperand.h:400: int64_t
llvm::MachineOperand::getImm() const: Assertion `isImm() && "Wrong
MachineOperand accessor"' failed.

This is because the MachineOperand is a BasicBlock (the target location of the
setjmp). The attached patch appears to add the support for this operation (by
adding this case to emitMemModRMByte and emitDisplacementField, and ignoring
the EH_SjLj_Setup instruction in emitInstruction)

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.

More information about the llvm-bugs mailing list