[LLVMbugs] [Bug 12071] New: CopyToReg in Glue causes crash in InstrEmitter

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Feb 23 20:11:05 PST 2012


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

             Bug #: 12071
           Summary: CopyToReg in Glue causes crash in InstrEmitter
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: hfinkel at anl.gov
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8094
  --> http://llvm.org/bugs/attachment.cgi?id=8094
test case, will cause llc to assert

In InstrEmitter.cpp, the following code crashes when a CopyToReg is part of a
glued node group:
  // Scan the glue chain for any used physregs.
  if (Node->getValueType(Node->getNumValues()-1) == MVT::Glue) {
    for (SDNode *F = Node->getGluedUser(); F; F = F->getGluedUser()) {
      if (F->getOpcode() == ISD::CopyFromReg) {
        UsedRegs.push_back(cast<RegisterSDNode>(F->getOperand(1))->getReg());
        continue;
      }
      // Collect declared implicit uses.
      const MCInstrDesc &MCID = TII->get(F->getMachineOpcode());

The offending node looks something like this:
0x35860b0: ch,glue = CopyToReg 0x357f040:1, 0x357e540, 0x357f040, 0x357f040:2
[ID=1]

And this results in the assertion:
llc: /src/llvm-trunk/include/llvm/CodeGen/SelectionDAGNodes.h:379: unsigned int
llvm::SDNode::getMachineOpcode() const: Assertion `isMachineOpcode() && "Not a
MachineInstr opcode!"' failed.

Should CopyToReg be handled like CopyFromReg?

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