[llvm-bugs] [Bug 24631] New: MI Serialization crashes on empty inlineasm

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 31 00:07:06 PDT 2015


            Bug ID: 24631
           Summary: MI Serialization crashes on empty inlineasm
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: hfinkel at anl.gov
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 14795
  --> https://llvm.org/bugs/attachment.cgi?id=14795&action=edit
reduced test case

$ cat mirp.ll 
target datalayout = "E-m:e-i64:64-n32:64"
target triple = "powerpc64-unknown-linux-gnu"

define void @foo() #0 {
  tail call void asm sideeffect "", "~{memory}"() #0
  ret void

attributes #0 = { nounwind }

$ llc -stop-after=if-converter < mirp.ll 
llc: /src/llvm/lib/IR/AsmWriter.cpp:346: void
llvm::printLLVMNameWithoutPrefix(llvm::raw_ostream&, llvm::StringRef):
Assertion `!Name.empty() && "Cannot get empty name!"' failed.

The problem seems related to how llvm::MIPrinter::print handles external
symbols, specifically:

789      case MachineOperand::MO_ExternalSymbol:
790        OS << '$';
791        printLLVMNameWithoutPrefix(OS, Op.getSymbolName());
792        printOffset(Op.getOffset());
793        break;

printLLVMNameWithoutPrefix cannot be called with an empty name string, but it
is in this case because the inline asm string is empty:

  INLINEASM <es:> [sideeffect] [mayload] [maystore] [attdialect]

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/20150831/0712b6e4/attachment.html>

More information about the llvm-bugs mailing list