[llvm-bugs] [Bug 30256] New: Assert in llvm::ReassociatePass::OptimizeAdd

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 2 06:51:22 PDT 2016


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

            Bug ID: 30256
           Summary: Assert in llvm::ReassociatePass::OptimizeAdd
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: babokin at gmail.com
                CC: llvm-bugs at lists.llvm.org, Vsevolod.Livinskij at frtk.ru
    Classification: Unclassified

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

> clang++ -std=c++11 -O1 pr.cpp -c
clang-4.0:
/export/users/dybaboki/llvm/llvm-trunk/lib/Transforms/Scalar/Reassociate.cpp:1592:
llvm::Value *llvm::ReassociatePass::OptimizeAdd(llvm::Instruction *,
SmallVectorImpl<llvm::reassociate::ValueEntry> &): Assertion `NumAddedValues >
1 && "Each occurrence should contribute a value"' failed.
#0 0x000000000115d575 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x115d575)
#1 0x000000000115dc46 SignalHandler(int)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x115dc46)
#2 0x00007f8f60dcba00 __restore_rt (/lib64/libpthread.so.0+0x10a00)
#3 0x00007f8f5f947a28 __GI_raise (/lib64/libc.so.6+0x34a28)
#4 0x00007f8f5f94962a __GI_abort (/lib64/libc.so.6+0x3662a)
#5 0x00007f8f5f940227 __assert_fail_base (/lib64/libc.so.6+0x2d227)
#6 0x00007f8f5f9402d2 (/lib64/libc.so.6+0x2d2d2)
#7 0x0000000001081773 llvm::ReassociatePass::OptimizeAdd(llvm::Instruction*,
llvm::SmallVectorImpl<llvm::reassociate::ValueEntry>&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x1081773)
#8 0x0000000001082e2a
llvm::ReassociatePass::OptimizeExpression(llvm::BinaryOperator*,
llvm::SmallVectorImpl<llvm::reassociate::ValueEntry>&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x1082e2a)
#9 0x0000000001085f4a
llvm::ReassociatePass::ReassociateExpression(llvm::BinaryOperator*)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x1085f4a)
#10 0x0000000001085085 llvm::ReassociatePass::OptimizeInst(llvm::Instruction*)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x1085085)
#11 0x0000000001086d25 llvm::ReassociatePass::run(llvm::Function&,
llvm::AnalysisManager<llvm::Function>&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x1086d25)
#12 0x000000000108870c (anonymous
namespace)::ReassociateLegacyPass::runOnFunction(llvm::Function&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x108870c)
#13 0x0000000000d70e3f llvm::FPPassManager::runOnFunction(llvm::Function&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0xd70e3f)
#14 0x0000000001b51fe7 (anonymous
namespace)::CGPassManager::runOnModule(llvm::Module&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x1b51fe7)
#15 0x0000000000d71598 llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0xd71598)
#16 0x00000000012e0c13 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x12e0c13)
#17 0x00000000019b487f
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x19b487f)
#18 0x0000000001ddccc6 clang::ParseAST(clang::Sema&, bool, bool)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x1ddccc6)
#19 0x000000000169bc45 clang::FrontendAction::Execute()
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x169bc45)
#20 0x0000000001666571
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x1666571)
#21 0x000000000172f9e1
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x172f9e1)
#22 0x00000000006e2d79 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x6e2d79)
#23 0x00000000006e17fe main
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x6e17fe)
#24 0x00007f8f5f933580 __libc_start_main (/lib64/libc.so.6+0x20580)
#25 0x00000000006dec49 _start
(/export/users/dybaboki/llvm/bin-trunk/bin/clang-4.0+0x6dec49)

> clang --version
clang version 4.0.0 (trunk 280256)
Target: x86_64-unknown-linux-gnu

-- 
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/20160902/31e32688/attachment.html>


More information about the llvm-bugs mailing list