[LLVMbugs] [Bug 13966] New: Assertion `ResNo < NumValues && "Illegal result number!"' failed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 28 01:01:26 PDT 2012


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

             Bug #: 13966
           Summary: Assertion `ResNo < NumValues && "Illegal result
                    number!"' failed
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: kcc at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


clang r164813, 64-bit linux; test case by csmith+creduce 

clang -v   -c -w -g -O3 r.i 

llvm::EVT llvm::SDNode::getValueType(unsigned int) const: Assertion `ResNo <
NumValues && "Illegal result number!"' failed.

#3  0x0000000000b2b323 in llvm::SelectionDAG::ReplaceAllUsesWith(llvm::SDNode*,
llvm::SDNode*) ()
#4  0x0000000000b9a5a8 in llvm::SelectionDAGISel::DoInstructionSelection() ()
#5  0x0000000000b9b747 in llvm::SelectionDAGISel::CodeGenAndEmitDAG() ()
#6  0x0000000000b9c5e1 in
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) ()
#7  0x0000000000ba365e in
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) ()
#8  0x0000000000ba479c in
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) ()
#9  0x00000000011b054d in llvm::FPPassManager::runOnFunction(llvm::Function&)
()
#10 0x00000000011b0633 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#11 0x00000000011b00c1 in llvm::MPPassManager::runOnModule(llvm::Module&) ()
#12 0x00000000011b023b in llvm::PassManagerImpl::run(llvm::Module&) ()
#13 0x00000000012ad488 in clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) ()
#14 0x00000000012aa859 in
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()


///////////////////////////////////////////////////
a;
b;
fn1 (unsigned char p1, unsigned char p2) {
  return p1 % p2;
}
fn2 (unsigned p1) {
  if (fn1 (p1 > b & a, 3) )
    a--;
}
///////////////////////////////////////////////////



; ModuleID = 'r.i'
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-S128"
target triple = "x86_64-unknown-linux-gnu"

@b = common global i32 0, align 4
@a = common global i32 0, align 4

define i32 @fn1(i8 zeroext %p1, i8 zeroext %p2) nounwind uwtable readnone {
entry:
  %0 = urem i8 %p1, %p2
  %rem = zext i8 %0 to i32
  ret i32 %rem
}

define i32 @fn2(i32 %p1) nounwind uwtable {
entry:
  %0 = load i32* @b, align 4, !tbaa !0
  %cmp = icmp ult i32 %0, %p1
  %conv = zext i1 %cmp to i32
  %1 = load i32* @a, align 4, !tbaa !0
  %and = and i32 %conv, %1
  %conv1 = trunc i32 %and to i8
  %2 = urem i8 %conv1, 3
  %tobool = icmp eq i8 %2, 0
  br i1 %tobool, label %if.end, label %if.then

if.then:                                          ; preds = %entry
  %dec = add nsw i32 %1, -1
  store i32 %dec, i32* @a, align 4, !tbaa !0
  br label %if.end

if.end:                                           ; preds = %entry, %if.then
  ret i32 undef
}

!0 = metadata !{metadata !"int", metadata !1}
!1 = metadata !{metadata !"omnipotent char", metadata !2}
!2 = metadata !{metadata !"Simple C/C++ TBAA"}



% llc z.ll 
llvm::EVT llvm::SDNode::getValueType(unsigned int) const: Assertion `ResNo <
NumValues && "Illegal result number!"' failed.

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