[LLVMbugs] [Bug 7653] New: segfault in llvm::TargetLowering::LowerAsmOperandForConstraint

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 15 07:49:06 PDT 2010


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

           Summary: segfault in
                    llvm::TargetLowering::LowerAsmOperandForConstraint
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


This is a recent regression: it worked not long ago.

$ llc asm.ll
...
llvm::TargetLowering::LowerAsmOperandForConstraint(llvm::SDValue, char,
std::vector<llvm::SDValue, std::allocator<llvm::SDValue> >&,
llvm::SelectionDAG&) const + 277
4  llc       0x00000000007a6982
llvm::X86TargetLowering::LowerAsmOperandForConstraint(llvm::SDValue, char,
std::vector<llvm::SDValue, std::allocator<llvm::SDValue> >&,
llvm::SelectionDAG&) const + 114
...


The problem is that C is null but is dereferenced at line 2479:

2475          if (ConstraintLetter != 'n') {
2476            int64_t Offs = GA->getOffset();
2477            if (C) Offs += C->getZExtValue();
2478            Ops.push_back(DAG.getTargetGlobalAddress(GA->getGlobal(), 
2479                                                     C->getDebugLoc(),
2480                                                     Op.getValueType(),
Offs));
2481            return;
2482          }


Testcase:

target datalayout =
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-unknown-linux-gnu"

@__FUNCTION__.1623 = external constant [4 x i8]   ; <[4 x i8]*> [#uses=1]

define void @foo() nounwind {
entry:
  tail call void asm sideeffect "", "s,i,~{fpsr},~{flags}"(i8* getelementptr
inbounds ([4 x i8]* @__FUNCTION__.1623, i64 0, i64 0), i8* getelementptr
inbounds ([4 x i8]* @__FUNCTION__.1623, i64 0, i64 0)) nounwind
  ret void
}

-- 
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