<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 --- - fatal error: error in backend: Cannot select: 0x350c838: v32i16 = X86ISD::VINSERT 0x350c7d0, 0x350c1b8, Constant:i64<0>"
   href="https://llvm.org/bugs/show_bug.cgi?id=31913">31913</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>fatal error: error in backend: Cannot select: 0x350c838: v32i16 = X86ISD::VINSERT 0x350c7d0, 0x350c1b8, Constant:i64<0>
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>4.0
          </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>kretz@kde.org
          </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=17955" name="attach_17955" title="preprocessed source">attachment 17955</a> <a href="attachment.cgi?id=17955&action=edit" title="preprocessed source">[details]</a></span>
preprocessed source

I reduced the testcase to the attached source file. Resolving the -Wreturn-type
warning makes the error disappear. This warning is an artifact of the
multidelta reduction. There is no such warning in the unreduced sources.

Compiled with `clang++-4.0 -std=c++14 -O1 -march=skylake-avx512 -c` to get the
crash:
# Crash reproducer for clang version 4.0.0-svn294486-1~exp1
(branches/release_40)
# Driver args: "--driver-mode=g++" "-std=c++14" "-O1" "-march=skylake-avx512"
"-c" "loadstore.cpp"
# Original command:  "/usr/lib/llvm-4.0/bin/clang" "-cc1" "-triple"
"x86_64-pc-linux-gnu" "-emit-obj" "-disable-free" "-disable-llvm-verifier"
"-discard-value-names" "-main-file-name" "loadstore.cpp" "-mrelocation-model"
"static" "-mthread-model" "posix" "-fmath-errno" "-masm-verbose"
"-mconstructor-aliases" "-munwind-tables" "-fuse-init-array" "-target-cpu"
"skylake-avx512" "-momit-leaf-frame-pointer" "-dwarf-column-info"
"-debugger-tuning=gdb" "-coverage-notes-file" "/tmp/loadstore.gcno"
"-resource-dir" "/usr/lib/llvm-4.0/bin/../lib/clang/4.0.0" "-internal-isystem"
"/usr/include/clang/4.0.0/include/" "-internal-isystem"
"/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0"
"-internal-isystem"
"/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/x86_64-linux-gnu/c++/6.2.0"
"-internal-isystem"
"/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/x86_64-linux-gnu/c++/6.2.0"
"-internal-isystem"
"/usr/bin/../lib/gcc/x86_64-linux-gnu/6.2.0/../../../../include/c++/6.2.0/backward"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/llvm-4.0/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" "-O1" "-std=c++14"
"-fdeprecated-macro" "-fdebug-compilation-dir" "/tmp" "-ferror-limit" "19"
"-fmessage-length" "274" "-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "loadstore.o" "-x" "c++"
"loadstore.cpp"
 "/usr/lib/llvm-4.0/bin/clang" "-cc1" "-triple" "x86_64-pc-linux-gnu"
"-emit-obj" "-disable-free" "-disable-llvm-verifier" "-discard-value-names"
"-main-file-name" "loadstore.cpp" "-mrelocation-model" "static"
"-mthread-model" "posix" "-fmath-errno" "-masm-verbose" "-mconstructor-aliases"
"-munwind-tables" "-fuse-init-array" "-target-cpu" "skylake-avx512"
"-momit-leaf-frame-pointer" "-dwarf-column-info" "-debugger-tuning=gdb"
"-coverage-notes-file" "/tmp/loadstore.gcno" "-O1" "-std=c++14"
"-fdeprecated-macro" "-ferror-limit" "19" "-fmessage-length" "274"
"-fobjc-runtime=gcc" "-fcxx-exceptions" "-fexceptions"
"-fdiagnostics-show-option" "-fcolor-diagnostics" "-x" "c++"
"loadstore-574999.cpp"

fatal error: error in backend: Cannot select: 0x350c838: v32i16 =
X86ISD::VINSERT 0x350c7d0, 0x350c1b8, Constant:i64<0>
  0x350c7d0: v32i16 = bitcast 0x350c768
    0x350c768: v16i32 = BUILD_VECTOR Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>,
Constant:i32<0>, Constant:i32<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
      0x350c700: i32 = Constant<0>
  0x350c1b8: i16 = truncate 0x350bc70
    0x350bc70: i32 = add 0x350bd40, Constant:i32<1>
      0x350bd40: i32,ch = CopyFromReg 0x3479650, Register:i32 %vreg0
        0x350bda8: i32 = Register %vreg0
      0x350bcd8: i32 = Constant<1>
  0x350c288: i64 = Constant<0>
In function: _Z3foov
clang: error: clang frontend command failed with exit code 70 (use -v to see
invocation)
clang version 4.0.0-svn294486-1~exp1 (branches/release_40)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin</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>