https://llvm.org/bugs/show_bug.cgi?id=26870
Bug ID: 26870 Summary: Assertion: Inst.getNumOperands() == 6 && Inst.getOperand(RegOp).isReg() && ... Product: libraries Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Backend: X86 Assignee: unassignedb...@nondot.org Reporter: h...@chromium.org CC: llvm-bugs@lists.llvm.org Classification: Unclassified $ cat /work/creduce/a.ii class A { public: long long m_fn1(); unsigned getTypeAllocSize___trans_tmp_2; long m_fn2(int *) { long a; long long b = (m_fn1() + 7) / 8; a = (b + 1) / getTypeAllocSize___trans_tmp_2 * getTypeAllocSize___trans_tmp_2; return a; } }; class B { public: int *m_fn3(); }; class C { A DL; int *m_fn4(B &); }; int c, d; int *C::m_fn4(B &p1) { { unsigned e = DL.m_fn2(&c), f = DL.m_fn2(&d); if (e == f) return p1.m_fn3(); } } $ bin/clang -cc1 -triple i686-pc-windows-msvc18.0.0 -emit-obj -target-cpu pentium4 -O2 -std=c++11 -vectorize-loops -vectorize-slp -x c++ /work/creduce/a.ii /work/creduce/a.ii:28:1: warning: control may reach end of non-void function } ^ clang: ../lib/Target/X86/X86MCInstLower.cpp:367: void SimplifyShortMoveForm(llvm::X86AsmPrinter&, llvm::MCInst&, unsigned int): Assertion `Inst.getNumOperands() == 6 && Inst.getOperand(RegOp).isReg() && Inst.getOperand(AddrBase + X86::AddrBaseReg).isReg() && Inst.getOperand(AddrBase + X86::AddrScaleAmt).isImm() && Inst.getOperand(AddrBase + X86::AddrIndexReg).isReg() && Inst.getOperand(AddrBase + X86::AddrSegmentReg).isReg() && (Inst.getOperand(AddrOp).isExpr() || Inst.getOperand(AddrOp).isImm()) && "Unexpected instruction!"' failed. #0 0x0000000001ac2cd5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1ac2cd5) #1 0x0000000001ac0a86 llvm::sys::RunSignalHandlers() (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1ac0a86) #2 0x0000000001ac0cb1 SignalHandler(int) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1ac0cb1) #3 0x00007f6146353340 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x10340) #4 0x00007f6145574cc9 gsignal /build/eglibc-3GlaMS/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0 #5 0x00007f61455780d8 abort /build/eglibc-3GlaMS/eglibc-2.19/stdlib/abort.c:91:0 #6 0x00007f614556db86 __assert_fail_base /build/eglibc-3GlaMS/eglibc-2.19/assert/assert.c:92:0 #7 0x00007f614556dc32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32) #8 0x000000000117dae4 SimplifyShortMoveForm(llvm::X86AsmPrinter&, llvm::MCInst&, unsigned int) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x117dae4) #9 0x000000000117fd90 (anonymous namespace)::X86MCInstLower::Lower(llvm::MachineInstr const*, llvm::MCInst&) const [clone .constprop.249] (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x117fd90) #10 0x0000000001180d28 llvm::X86AsmPrinter::EmitInstruction(llvm::MachineInstr const*) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1180d28) #11 0x0000000001f62be7 llvm::AsmPrinter::EmitFunctionBody() (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1f62be7) #12 0x0000000001178636 llvm::X86AsmPrinter::runOnMachineFunction(llvm::MachineFunction&) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1178636) #13 0x000000000177d223 llvm::FPPassManager::runOnFunction(llvm::Function&) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x177d223) #14 0x000000000177d5db llvm::FPPassManager::runOnModule(llvm::Module&) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x177d5db) #15 0x000000000177d8ef llvm::legacy::PassManagerImpl::run(llvm::Module&) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x177d8ef) #16 0x0000000001bec6ba clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, llvm::raw_pwrite_stream*) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1bec6ba) #17 0x00000000021798ec clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x21798ec) #18 0x000000000249315b clang::ParseAST(clang::Sema&, bool, bool) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x249315b) #19 0x0000000002179a7e clang::CodeGenAction::ExecuteAction() (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x2179a7e) #20 0x0000000001ec8f56 clang::FrontendAction::Execute() (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1ec8f56) #21 0x0000000001ea5b7e clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1ea5b7e) #22 0x0000000001f4c72e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x1f4c72e) #23 0x00000000009e4a48 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x9e4a48) #24 0x00000000009a0ab5 main (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x9a0ab5) #25 0x00007f614555fec5 __libc_start_main /build/eglibc-3GlaMS/eglibc-2.19/csu/libc-start.c:321:0 #26 0x00000000009e09f4 _start (/usr/local/google/work/llvm/build.release/bin/clang-3.9+0x9e09f4) Stack dump: 0. Program arguments: bin/clang -cc1 -triple i686-pc-windows-msvc18.0.0 -emit-obj -target-cpu pentium4 -O2 -std=c++11 -vectorize-loops -vectorize-slp -x c++ /work/creduce/a.ii 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Function Pass Manager' on module '/work/creduce/a.ii'. 4. Running pass 'X86 Assembly / Object Emitter' on function '@"\01?m_fn4@C@@AAEPAHAAVB@@@Z"' Aborted (core dumped) This breaks self-hosting 32-bit Clang on Windows. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs