<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Assert in llvm::ReassociatePass::OptimizeAdd"
   href="https://llvm.org/bugs/show_bug.cgi?id=30256">30256</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assert in llvm::ReassociatePass::OptimizeAdd
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>babokin@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, Vsevolod.Livinskij@frtk.ru
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=17208" name="attach_17208" title="reproducer">attachment 17208</a> <a href="attachment.cgi?id=17208&action=edit" title="reproducer">[details]</a></span>
reproducer

<span class="quote">> clang++ -std=c++11 -O1 pr.cpp -c</span >
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)

<span class="quote">> clang --version</span >
clang version 4.0.0 (trunk 280256)
Target: x86_64-unknown-linux-gnu</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>