[llvm-bugs] [Bug 49154] New: Assertion `S1->getType() == S2->getType() && "Cannot create binary operator with two operands of differing type!"'

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 11 22:45:24 PST 2021


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

            Bug ID: 49154
           Summary: Assertion `S1->getType() == S2->getType() && "Cannot
                    create binary operator with two operands of differing
                    type!"'
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: phosek at chromium.org
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

Created attachment 24518
  --> https://bugs.llvm.org/attachment.cgi?id=24518&action=edit
Clang crash reproducer

We're hitting the following issue with the attached reproducer:

clang++: /src/clang-llvm/llvm-project/llvm/lib/IR/Instructions.cpp:2523: static
llvm::BinaryOperator
*llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value *,
llvm::Value *, const llvm::Twine &, llvm::Instruction *): Assertion
`S1->getType() == S2->getType() && "Cannot create binary operator with two
operands of differing type!"' failed.
Stack dump:
 #0 0x00000000089312ba llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/src/clang-llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:11
 #1 0x00000000089313cb PrintStackTraceSignalHandler(void*)
/src/clang-llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
 #2 0x000000000892fc83 llvm::sys::RunSignalHandlers()
/src/clang-llvm/llvm-project/llvm/lib/Support/Signals.cpp:71:5
 #3 0x0000000008931a05 SignalHandler(int)
/src/clang-llvm/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
 #4 0x00007f92d0d72140 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
 #5 0x00007f92d0a31ce1 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007f92d0a1b537 abort ./stdlib/abort.c:81:7
 #7 0x00007f92d0a1b40f get_sysdep_segment_value ./intl/loadmsgcat.c:509:8
 #8 0x00007f92d0a1b40f _nl_load_domain ./intl/loadmsgcat.c:970:34
 #9 0x00007f92d0a2a662 (/lib/x86_64-linux-gnu/libc.so.6+0x34662)
#10 0x0000000007d02604
llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value*,
llvm::Value*, llvm::Twine const&, llvm::Instruction*)
/src/clang-llvm/llvm-project/llvm/lib/IR/Instructions.cpp:2524:10
#11 0x000000000570185f
llvm::IRBuilderBase::CreateInsertNUWNSWBinOp(llvm::Instruction::BinaryOps,
llvm::Value*, llvm::Value*, llvm::Twine const&, bool, bool)
/src/clang-llvm/llvm-project/llvm/include/llvm/IR/IRBuilder.h:1210:33
#12 0x0000000005b86e03 llvm::IRBuilderBase::CreateAdd(llvm::Value*,
llvm::Value*, llvm::Twine const&, bool, bool)
/src/clang-llvm/llvm-project/llvm/include/llvm/IR/IRBuilder.h:1277:5
#13 0x00000000082f23b2
llvm::InstrProfiling::lowerIncrement(llvm::InstrProfIncrementInst*)
/src/clang-llvm/llvm-project/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:698:11
#14 0x00000000082f1e41 llvm::InstrProfiling::lowerIntrinsics(llvm::Function*)
/src/clang-llvm/llvm-project/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:453:20
#15 0x00000000082f1acf llvm::InstrProfiling::run(llvm::Module&,
std::__2::function<llvm::TargetLibraryInfo const& (llvm::Function&)>)
/src/clang-llvm/llvm-project/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:572:19
#16 0x00000000082f662e (anonymous
namespace)::InstrProfilingLegacyPass::runOnModule(llvm::Module&)
/src/clang-llvm/llvm-project/llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:162:22
#17 0x0000000007d41999 (anonymous
namespace)::MPPassManager::runOnModule(llvm::Module&)
/src/clang-llvm/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1549:23
#18 0x0000000007d4150d llvm::legacy::PassManagerImpl::run(llvm::Module&)
/src/clang-llvm/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:540:16
#19 0x0000000007d46051 llvm::legacy::PassManager::run(llvm::Module&)
/src/clang-llvm/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1676:3
#20 0x0000000008d14649 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::__2::unique_ptr<llvm::raw_pwrite_stream,
std::__2::default_delete<llvm::raw_pwrite_stream> >)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1017:3
#21 0x0000000008d1173e clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, clang::CodeGenOptions const&,
clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout
const&, llvm::Module*, clang::BackendAction,
std::__2::unique_ptr<llvm::raw_pwrite_stream,
std::__2::default_delete<llvm::raw_pwrite_stream> >)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/BackendUtil.cpp:1607:17
#22 0x000000000993aeec
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:348:7
#23 0x000000000bf10ed1 clang::ParseAST(clang::Sema&, bool, bool)
/src/clang-llvm/llvm-project/clang/lib/Parse/ParseAST.cpp:178:12
#24 0x000000000977e12c clang::ASTFrontendAction::ExecuteAction()
/src/clang-llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1058:1
#25 0x0000000009936d20 clang::CodeGenAction::ExecuteAction()
/src/clang-llvm/llvm-project/clang/lib/CodeGen/CodeGenAction.cpp:1083:5
#26 0x000000000977db5c clang::FrontendAction::Execute()
/src/clang-llvm/llvm-project/clang/lib/Frontend/FrontendAction.cpp:953:7
#27 0x000000000965ea66
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
/src/clang-llvm/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:949:23
#28 0x0000000009928a2e
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
/src/clang-llvm/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:278:8
#29 0x0000000005606fe4 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) /src/clang-llvm/llvm-project/clang/tools/driver/cc1_main.cpp:246:13
#30 0x00000000055f9964 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
/src/clang-llvm/llvm-project/clang/tools/driver/driver.cpp:330:5
#31 0x00000000055f8b97 main
/src/clang-llvm/llvm-project/clang/tools/driver/driver.cpp:407:5
#32 0x00007f92d0a1cd0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#33 0x00000000055f836a _start (./bin/clang+++0x55f836a)

-- 
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/20210212/a3ae6c5a/attachment.html>


More information about the llvm-bugs mailing list