[LLVMbugs] [Bug 22614] New: Crash in InstrEmitter, Assertion `I != VRBaseMap.end() && "Node emitted out of order - late"'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 17 01:17:01 PST 2015


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

            Bug ID: 22614
           Summary: Crash in InstrEmitter, Assertion `I != VRBaseMap.end()
                    && "Node emitted out of order - late"'
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: patrik.h.hagglund at ericsson.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 13883
  --> http://llvm.org/bugs/attachment.cgi?id=13883&action=edit
test.c

Testcase for r229467:

a, b, c;
f() {
  b = c & 1 ? a : a - c;
}

bin/clang -w -emit-llvm -S test.c -o test.ll
bin/opt -S -inline -simplifycfg -instcombine test.ll -o test.opt.ll
bin/llc -march x86-64 -mcpu=corei7 -pre-RA-sched=linearize -o test.s
test.opt.ll

test.opt.ll:

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

define i32 @f() {
entry:
  %retval = alloca i32, align 4
  %0 = load i32* @c, align 4
  %and = and i32 %0, 1
  %tobool = icmp ne i32 %and, 0
  %1 = load i32* @a, align 4
  %sub = select i1 %tobool, i32 0, i32 %0
  %cond = sub nsw i32 %1, %sub
  store i32 %cond, i32* @b, align 4
  %2 = load i32* %retval, align 4
  ret i32 %2
}


llc: ../lib/CodeGen/SelectionDAG/InstrEmitter.cpp:302: unsigned int
llvm::InstrEmitter::getVR(llvm::SDValue, llvm::DenseMap<llvm::SDValue, unsigned
int>&): Assertion `I != VRBaseMap.end() && "Node emitted out of order - late"'
failed.
0  llc             0x0000000001e2b607 llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1  llc             0x0000000001e2b89d
2  llc             0x0000000001e2a54d
3  libpthread.so.0 0x00007fd027c1e810
4  libc.so.6       0x00007fd027439755 gsignal + 53
5  libc.so.6       0x00007fd02743ad31 abort + 385
6  libc.so.6       0x00007fd027432610 __assert_fail + 240
7  llc             0x0000000001d5c9cd llvm::InstrEmitter::getVR(llvm::SDValue,
llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::DenseMapPair<llvm::SDValue, unsigned int> >&) + 465
8  llc             0x0000000001d5cb51
llvm::InstrEmitter::AddRegisterOperand(llvm::MachineInstrBuilder&,
llvm::SDValue, unsigned int, llvm::MCInstrDesc const*,
llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::DenseMapPair<llvm::SDValue, unsigned int> >&, bool, bool, bool) +
357
9  llc             0x0000000001d5cfaa
llvm::InstrEmitter::AddOperand(llvm::MachineInstrBuilder&, llvm::SDValue,
unsigned int, llvm::MCInstrDesc const*, llvm::DenseMap<llvm::SDValue, unsigned
int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::DenseMapPair<llvm::SDValue, unsigned int> >&, bool, bool, bool) +
196
10 llc             0x0000000001d5f01c
llvm::InstrEmitter::EmitMachineNode(llvm::SDNode*, bool, bool,
llvm::DenseMap<llvm::SDValue, unsigned int, llvm::DenseMapInfo<llvm::SDValue>,
llvm::detail::DenseMapPair<llvm::SDValue, unsigned int> >&) + 1042
11 llc             0x0000000001c855b3
12 llc             0x0000000001c88bf1
13 llc             0x0000000001d273af
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 4553
14 llc             0x0000000001d25ea0
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 234
15 llc             0x0000000001d29363
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 3015
16 llc             0x0000000001d250be
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 992
17 llc             0x000000000137f02f
18 llc             0x000000000175f1b3
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 95
19 llc             0x0000000001a77cfc
llvm::FPPassManager::runOnFunction(llvm::Function&) + 290
20 llc             0x0000000001a77e6c
llvm::FPPassManager::runOnModule(llvm::Module&) + 84
21 llc             0x0000000001a781c0
22 llc             0x0000000001a78876
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 250
23 llc             0x0000000001a78a97
llvm::legacy::PassManager::run(llvm::Module&) + 39
24 llc             0x0000000000c0396e
25 llc             0x0000000000c02b47 main + 237
26 libc.so.6       0x00007fd027425c16 __libc_start_main + 230
27 llc             0x0000000000bffd29
Stack dump:
0.      Program arguments: ../build-all-gcc49-Debug/bin/llc -march x86-64
-mcpu=corei7 -pre-RA-sched=linearize -o test.s test.opt.ll
1.      Running pass 'Function Pass Manager' on module 'test.opt.ll'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@f'
Abort (core dumped)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150217/db251c9b/attachment.html>


More information about the llvm-bugs mailing list