<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 --- - Clang trunk crashes on knl target"
   href="https://llvm.org/bugs/show_bug.cgi?id=27789">27789</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang trunk crashes on knl target
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </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>llc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>anton.mitrokhin@phystech.edu
          </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=16379" name="attach_16379" title="Reproducer">attachment 16379</a> <a href="attachment.cgi?id=16379&action=edit" title="Reproducer">[details]</a></span>
Reproducer

Test case is attached. clang++ crashes on -O3 and -O2 when compiling for knl
target.

Launch:
<span class="quote">> clang++ -std=c++11 -O3 -march=knl -o out small.cpp</span >

<span class="quote">> clang -v :</span >
clang version 3.9.0 (trunk 269756)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /export/users/amitrokh/llvm/bin-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.8.5
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64


Output:
clang-3.9:
/export/users/amitrokh/llvm/llvm-trunk/lib/Target/X86/X86ISelLowering.cpp:16143:
llvm::SDValue LowerExtendedLoad(llvm::SDValue, const llvm::X86Subtarget&,
llvm::SelectionDAG&): Assertion `TLI.isTypeLegal(WideVecVT) && "We only lower
types that form legal widened vector types"' failed.
#0 0x000000000111f305 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x111f305)
#1 0x000000000111d0b6 llvm::sys::RunSignalHandlers()
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x111d0b6)
#2 0x000000000111d2e1 SignalHandler(int)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x111d2e1)
#3 0x00007fdc20418100 __restore_rt (/lib64/libpthread.so.0+0xf100)
#4 0x00007fdc1f6465f7 __GI_raise (/lib64/libc.so.6+0x355f7)
#5 0x00007fdc1f647ce8 __GI_abort (/lib64/libc.so.6+0x36ce8)
#6 0x00007fdc1f63f566 __assert_fail_base (/lib64/libc.so.6+0x2e566)
#7 0x00007fdc1f63f612 (/lib64/libc.so.6+0x2e612)
#8 0x0000000000802b87 LowerExtendedLoad(llvm::SDValue, llvm::X86Subtarget
const&, llvm::SelectionDAG&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x802b87)
#9 0x00000000008b62e2 llvm::X86TargetLowering::LowerOperation(llvm::SDValue,
llvm::SelectionDAG&) const
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x8b62e2)
#10 0x000000000181431d (anonymous
namespace)::VectorLegalizer::LegalizeOp(llvm::SDValue)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x181431d)
#11 0x00000000018163b5 llvm::SelectionDAG::LegalizeVectors()
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x18163b5)
#12 0x00000000017c8845 llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x17c8845)
#13 0x00000000017d114a
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x17d114a)
#14 0x00000000017d3324
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x17d3324)
#15 0x00000000007c45f4 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x7c45f4)
#16 0x0000000000b18de4
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0xb18de4)
#17 0x0000000000da62b3 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0xda62b3)
#18 0x0000000000da666b llvm::FPPassManager::runOnModule(llvm::Module&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0xda666b)
#19 0x0000000000da697f llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0xda697f)
#20 0x000000000126e4b2 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions
const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction,
llvm::raw_pwrite_stream*)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x126e4b2)
#21 0x00000000018ac7d6
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x18ac7d6)
#22 0x0000000001cb383b clang::ParseAST(clang::Sema&, bool, bool)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x1cb383b)
#23 0x00000000018acb8b clang::CodeGenAction::ExecuteAction()
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x18acb8b)
#24 0x000000000158cd66 clang::FrontendAction::Execute()
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x158cd66)
#25 0x000000000156796e
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x156796e)
#26 0x000000000162080c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x162080c)
#27 0x00000000006ee418 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x6ee418)
#28 0x00000000006c741f main
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x6c741f)
#29 0x00007fdc1f632b15 __libc_start_main (/lib64/libc.so.6+0x21b15)
#30 0x00000000006ea495 _start
(/export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9+0x6ea495)
Stack dump:
0.      Program arguments: /export/users/amitrokh/llvm/bin-trunk/bin/clang-3.9
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
crash.cpp -mrelocation-model static -mthread-model posix -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array
-target-cpu knl -momit-leaf-frame-pointer -dwarf-column-info
-debugger-tuning=gdb -resource-dir
/export/users/amitrokh/llvm/bin-trunk/bin/../lib/clang/3.9.0 -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/backward
-internal-isystem /usr/local/include -internal-isystem
/export/users/amitrokh/llvm/bin-trunk/bin/../lib/clang/3.9.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O3
-std=c++11 -fdeprecated-macro -fdebug-compilation-dir
/export/users/amitrokh/forCreduce/untracked/SelLowering -ferror-limit 19
-fmessage-length 237 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp
-o /tmp/crash-2a6f35.o -x c++ crash.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'crash.cpp'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function
'@_Z3fn1v'
clang-3.9: error: unable to execute command: Aborted (core dumped)
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 269756)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /export/users/amitrokh/llvm/bin-trunk/bin
clang-3.9: 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-3.9: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/crash-bc0589.cpp
clang-3.9: note: diagnostic msg: /tmp/crash-bc0589.sh
clang-3.9: 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>