[llvm-bugs] [Bug 27071] New: Assertion failed: (isImm() && "Wrong MachineOperand accessor"), function getImm, file include/llvm/CodeGen/MachineOperand.h, line 411.

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 25 11:23:50 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27071

            Bug ID: 27071
           Summary: Assertion failed: (isImm() && "Wrong MachineOperand
                    accessor"), function getImm, file
                    include/llvm/CodeGen/MachineOperand.h, line 411.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: dimitry at andric.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This assertion was reported on the freebsd-current mailing list. [1]  It occurs
when compiling with -Os -fpic for the i386 target.  FreeBSD 11 has clang 3.8.0
release, but it still reproduces with trunk r264394.

Reduced test case:

typedef struct {
} x0;
_Thread_local int x1;
void x2(x0*);
void x3(void) {
  x0 x4;
  switch (x1) {
  case '\\':
    x2(&x4);
  }
}

Compilation flags:

clang -cc1 -triple i386 -emit-obj -mrelocation-model pic -pic-level 1 -Os
testcase.c

Stack trace:

#0  0x2b7eba43 in thr_kill () from /lib/libc.so.7
#1  0x2b7eba28 in __raise (s=0) at
/share/dim/src/freebsd/base/head/lib/libc/gen/raise.c:52
#2  0x2b7eb963 in abort () at
/share/dim/src/freebsd/base/head/lib/libc/stdlib/abort.c:65
#3  0x2b867708 in __assert (func=0xaf301dc "getImm", file=0xbfbfcaa8
"\250\312\277\277\006", line=411, failedexpr=<optimized out>) at
/share/dim/src/freebsd/base/head/lib/libc/gen/assert.c:51
#4  0x089fe334 in llvm::X86InstrInfo::getSPAdjust(llvm::MachineInstr const*)
const ()
#5  0x08d2ffbd in (anonymous
namespace)::PEI::replaceFrameIndices(llvm::MachineBasicBlock*,
llvm::MachineFunction&, int&) ()
#6  0x08d2de0c in (anonymous
namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&) ()
#7  0x08cc0e17 in llvm::MachineFunctionPass::runOnFunction(llvm::Function&) ()
#8  0x08f5e41b in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
#9  0x08f5e6c2 in llvm::FPPassManager::runOnModule(llvm::Module&) ()
#10 0x08f5ec47 in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
#11 0x08f5f2e8 in llvm::legacy::PassManager::run(llvm::Module&) ()
#12 0x09502d24 in clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*) ()
#13 0x09ce258c in
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) ()
#14 0x0a0e5c15 in clang::ParseAST(clang::Sema&, bool, bool) ()
#15 0x09942226 in clang::ASTFrontendAction::ExecuteAction() ()
#16 0x09ce10ce in clang::CodeGenAction::ExecuteAction() ()
#17 0x09941b03 in clang::FrontendAction::Execute() ()
#18 0x0990698a in
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) ()
#19 0x099dcddb in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) ()
#20 0x0830b327 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) ()
#21 0x08309c46 in main ()

[1] https://lists.freebsd.org/pipermail/freebsd-current/2016-March/060290.html

-- 
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/20160325/b74baf36/attachment.html>


More information about the llvm-bugs mailing list