<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 --- - Assertion `NodeToMatch->getOpcode() != ISD::DELETED_NODE && "NodeToMatch was removed partway through selection"' failed."
   href="https://llvm.org/bugs/show_bug.cgi?id=30775">30775</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion `NodeToMatch->getOpcode() != ISD::DELETED_NODE && "NodeToMatch was removed partway through selection"' failed.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </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>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Vsevolod.Livinskij@frtk.ru
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

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

Assertion `NodeToMatch->getOpcode() != ISD::DELETED_NODE && "NodeToMatch was
removed partway through selection"' failed.

===============================================================================

Reproducer:
int a, f;
short b, c, d, e;
struct i {
  int g : 25;
  unsigned h : 16;
  int : 1;
} l;
struct m {
  i j;
} k;
void n() {
  e = (k.j.h + c + b >= unsigned(a && l.g) * 0) -
      (k.j.h + c + k.j.h + b + (a && l.g) * l.g && l.g);
  d = f >> k.j.h + (k.j.h + c + k.j.h + b >= 0);
}

===============================================================================

LLVM version:
clang version 4.0.0 (trunk 284990)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/vlivinsk/workspace/llvm/bin-trunk//bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64

===============================================================================

Error:
<span class="quote">>$ clang++ -O3 -c small.cpp</span >
clang-4.0:
/home/vlivinsk/workspace/llvm/llvm-trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:3458:
void llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, const unsigned
char*, unsigned int): Assertion `NodeToMatch->getOpcode() != ISD::DELETED_NODE
&& "NodeToMatch was removed partway through selection"' failed.
#0 0x00000000014298b8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x14298b8)
#1 0x000000000142750e llvm::sys::RunSignalHandlers()
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x142750e)
#2 0x0000000001427682 SignalHandler(int)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1427682)
#3 0x00007fac2fd943d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x113d0)
#4 0x00007fac2ef4a418 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35418)
#5 0x00007fac2ef4c01a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3701a)
#6 0x00007fac2ef42bd7 (/lib/x86_64-linux-gnu/libc.so.6+0x2dbd7)
#7 0x00007fac2ef42c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)
#8 0x0000000001b1b180 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*,
unsigned char const*, unsigned int)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1b1b180)
#9 0x00000000009e515f (anonymous
namespace)::X86DAGToDAGISel::Select(llvm::SDNode*)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x9e515f)
#10 0x0000000001b0ff45 llvm::SelectionDAGISel::DoInstructionSelection()
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1b0ff45)
#11 0x0000000001b13d7f llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1b13d7f)
#12 0x0000000001b1e2dc
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1b1e2dc)
#13 0x0000000001b204f9
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) [clone
.part.722] [clone .constprop.746]
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1b204f9)
#14 0x00000000009e9d04 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x9e9d04)
#15 0x0000000000d37955
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0xd37955)
#16 0x000000000103f803 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x103f803)
#17 0x000000000103f8cc llvm::FPPassManager::runOnModule(llvm::Module&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x103f8cc)
#18 0x000000000103f36d llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x103f36d)
#19 0x00000000015b34e8 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> >)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x15b34e8)
#20 0x0000000001be2623
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1be2623)
#21 0x0000000001fc4f38 clang::ParseAST(clang::Sema&, bool, bool)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1fc4f38)
#22 0x0000000001bdda69 clang::CodeGenAction::ExecuteAction()
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x1bdda69)
#23 0x00000000018eee16 clang::FrontendAction::Execute()
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x18eee16)
#24 0x00000000018c1146
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x18c1146)
#25 0x00000000019748a2
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x19748a2)
#26 0x000000000091d048 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x91d048)
#27 0x00000000008dfa54 main
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x8dfa54)
#28 0x00007fac2ef35830 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#29 0x0000000000919a19 _start
(/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0+0x919a19)
Stack dump:
0.      Program arguments:
/home/vlivinsk/workspace/llvm/bin-trunk/bin/clang-4.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name small.cpp
-mrelocation-model static -mthread-model posix -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-momit-leaf-frame-pointer -dwarf-column-info -debugger-tuning=gdb
-coverage-notes-file
/home/vlivinsk/workspace/yarpgen/found/clang/S_4051824292/small.gcno
-resource-dir /home/vlivinsk/workspace/llvm/bin-trunk/bin/../lib/clang/4.0.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/x86_64-linux-gnu/c++/5.4.0
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/backward
-internal-isystem /usr/local/include -internal-isystem
/home/vlivinsk/workspace/llvm/bin-trunk/bin/../lib/clang/4.0.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-fdeprecated-macro -fdebug-compilation-dir
/home/vlivinsk/workspace/yarpgen/found/clang/S_4051824292 -ferror-limit 19
-fmessage-length 172 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -vectorize-loops -vectorize-slp -o small.o -x c++
small.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'small.cpp'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@_Z1nv'
clang-4.0: error: unable to execute command: Aborted (core dumped)
clang-4.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 4.0.0 (trunk 284990)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/vlivinsk/workspace/llvm/bin-trunk//bin
clang-4.0: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-4.0: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-4.0: note: diagnostic msg: /tmp/small-f6a70a.cpp
clang-4.0: note: diagnostic msg: /tmp/small-f6a70a.sh
clang-4.0: note: diagnostic msg:

********************</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>