<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 --- - ICE in llvm::TargetLowering::SimplifyDemandedBits on knl."
   href="https://llvm.org/bugs/show_bug.cgi?id=27873">27873</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ICE in llvm::TargetLowering::SimplifyDemandedBits on knl.
          </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=16413" name="attach_16413" title="Reproducer.">attachment 16413</a> <a href="attachment.cgi?id=16413&action=edit" title="Reproducer.">[details]</a></span>
Reproducer.

ICE in llvm::TargetLowering::SimplifyDemandedBits with -O1 -march=knl.

Error:
<span class="quote">>  clang++ -O1 -march=knl func.cpp</span >

clang-3.9:
/export/users/vlivinsk/llvm/llvm-trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp:433:
bool llvm::TargetLowering::SimplifyDemandedBits(llvm::SDValue, const
llvm::APInt&, llvm::APInt&, llvm::APInt&,
llvm::TargetLowering::TargetLoweringOpt&, unsigned int) const: Assertion
`Op.getValueType().getScalarType().getSizeInBits() == BitWidth && "Mask size
mismatches value type size!"' failed.
#0 0x0000000001285c15 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x1285c15)
#1 0x0000000001283976 llvm::sys::RunSignalHandlers()
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x1283976)
#2 0x0000000001283b8a SignalHandler(int)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x1283b8a)
#3 0x00007f4aa7c379f0 __restore_rt (/lib64/libpthread.so.0+0x109f0)
#4 0x00007f4aa6de9a98 __GI_raise (/lib64/libc.so.6+0x34a98)
#5 0x00007f4aa6deb69a __GI_abort (/lib64/libc.so.6+0x3669a)
#6 0x00007f4aa6de2227 __assert_fail_base (/lib64/libc.so.6+0x2d227)
#7 0x00007f4aa6de22d2 (/lib64/libc.so.6+0x2d2d2)
#8 0x000000000191e9d3 llvm::TargetLowering::SimplifyDemandedBits(llvm::SDValue,
llvm::APInt const&, llvm::APInt&, llvm::APInt&,
llvm::TargetLowering::TargetLoweringOpt&, unsigned int) const
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x191e9d3)
#9 0x000000000191a9b7 llvm::TargetLowering::SimplifyDemandedBits(llvm::SDValue,
llvm::APInt const&, llvm::APInt&, llvm::APInt&,
llvm::TargetLowering::TargetLoweringOpt&, unsigned int) const
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x191a9b7)
#10 0x00000000017d48fa (anonymous
namespace)::DAGCombiner::SimplifyDemandedBits(llvm::SDValue, llvm::APInt
const&) (/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x17d48fa)
#11 0x00000000017d53e9 (anonymous
namespace)::DAGCombiner::SimplifyDemandedBits(llvm::SDValue)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x17d53e9)
#12 0x00000000017f6c3f (anonymous
namespace)::DAGCombiner::visitXOR(llvm::SDNode*)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x17f6c3f)
#13 0x000000000181a9bb (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x181a9bb)
#14 0x000000000181c05c (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x181c05c)
#15 0x000000000181e4dc llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults&, llvm::CodeGenOpt::Level)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x181e4dc)
#16 0x00000000018ee7df llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x18ee7df)
#17 0x00000000018f8132
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x18f8132)
#18 0x00000000018fa5e0
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x18fa5e0)
#19 0x0000000000911274 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x911274)
#20 0x0000000000c47e05
llvm::MachineFunctionPass::runOnFunction(llvm::Function&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0xc47e05)
#21 0x0000000000ef0193 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0xef0193)
#22 0x0000000000ef059b llvm::FPPassManager::runOnModule(llvm::Module&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0xef059b)
#23 0x0000000000eefcdd llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0xeefcdd)
#24 0x00000000013cba73 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/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x13cba73)
#25 0x00000000019ca6e4
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x19ca6e4)
#26 0x0000000001cdb55a clang::ParseAST(clang::Sema&, bool, bool)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x1cdb55a)
#27 0x00000000019cac67 clang::CodeGenAction::ExecuteAction()
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x19cac67)
#28 0x00000000016cf506 clang::FrontendAction::Execute()
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x16cf506)
#29 0x00000000016a42e6
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x16a42e6)
#30 0x0000000001753257
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x1753257)
#31 0x00000000008395f0 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x8395f0)
#32 0x0000000000807cf0 main
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x807cf0)
#33 0x00007f4aa6dd5580 __libc_start_main (/lib64/libc.so.6+0x20580)
#34 0x0000000000836069 _start
(/export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9+0x836069)
Stack dump:
0.      Program arguments: /export/users/vlivinsk/llvm/bin-trunk/bin/clang-3.9
-cc1 -triple x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name
func.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/vlivinsk/llvm/bin-trunk/bin/../lib/clang/3.9.0 -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/5.3.1/../../../../include/c++/5.3.1/backward
-internal-isystem /usr/local/include -internal-isystem
/export/users/vlivinsk/llvm/bin-trunk/bin/../lib/clang/3.9.0/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include -O1
-fdeprecated-macro -fdebug-compilation-dir
/export/users/vlivinsk/dpd_tpi_randloop-randloop/found/clang/crash/S_615022346/reduce
-ferror-limit 19 -fmessage-length 189 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/func-c24a0e.o -x c++ func.cpp
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'func.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 270677)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /export/users/vlivinsk/llvm/bin-trunk/bin

LLVM version:
clang version 3.9.0 (trunk 270677)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /export/users/vlivinsk/llvm/bin-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/5.3.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.3.1
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/5.3.1
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64</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>