<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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: Assertion `Num < NumOperands && "Invalid child # of SDNode!"' failed with -march=skylake-avx512 -O3"
   href="https://bugs.llvm.org/show_bug.cgi?id=48326">48326</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ICE: Assertion `Num < NumOperands && "Invalid child # of SDNode!"' failed with -march=skylake-avx512 -O3
          </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>enhancement
          </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>Vsevolod.Livinskij@frtk.ru
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Reproducer:
<span class="quote">>$ cat func.cpp</span >
extern char var_2;
extern int var_6;
extern int arr_13[];
extern bool arr_17[];
void test() {
#pragma clang loop vectorize_predicate(enable)
  for (int a = 0; a < 12; a += bool(var_6))
    if (var_2)
      arr_13[a] = 0;
    else
      arr_17[a] = 0;
}

Error:
<span class="quote">>$ clang++ -c -march=skylake-avx512 -O3 func.cpp</span >
clang++: llvm/include/llvm/CodeGen/SelectionDAGNodes.h:885: const
llvm::SDValue& llvm::SDNode::getOperand(unsigned int) const: Assertion `Num <
NumOperands && "Invalid child # of SDNode!"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: clang++ -c -march=skylake-avx512 -O3 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
'@_Z4testv'
 #0 0x0000561f0957c021 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
(/clang-12+0x1f01021)
 #1 0x0000561f09579bb4 llvm::sys::RunSignalHandlers() (/clang-12+0x1efebb4)
 #2 0x0000561f09579e51 llvm::sys::CleanupOnSignal(unsigned long)
(/clang-12+0x1efee51)
 #3 0x0000561f094dfae8 CrashRecoverySignalHandler(int) (/clang-12+0x1e64ae8)
 #4 0x00007f0e0187b3c0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
 #5 0x00007f0e0131b18b raise
/build/glibc-ZN95T4/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
 #6 0x00007f0e012fa859 abort /build/glibc-ZN95T4/glibc-2.31/stdlib/abort.c:81:7
 #7 0x00007f0e012fa729 get_sysdep_segment_value
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:509:8
 #8 0x00007f0e012fa729 _nl_load_domain
/build/glibc-ZN95T4/glibc-2.31/intl/loadmsgcat.c:970:34
 #9 0x00007f0e0130bf36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
#10 0x0000561f0a2d2835 (/clang-12+0x2c57835)
#11 0x0000561f0a2fbe2c refineIndexType(llvm::MaskedScatterSDNode*,
llvm::SDValue&, bool, llvm::SelectionDAG&) (/clang-12+0x2c80e2c)
#12 0x0000561f0a2fbfb1 (anonymous
namespace)::DAGCombiner::visitMSCATTER(llvm::SDNode*) (.isra.0)
(/clang-12+0x2c80fb1)
#13 0x0000561f0a36fa18 (anonymous namespace)::DAGCombiner::visit(llvm::SDNode*)
(/clang-12+0x2cf4a18)
#14 0x0000561f0a371ae5 (anonymous
namespace)::DAGCombiner::combine(llvm::SDNode*) (/clang-12+0x2cf6ae5)
#15 0x0000561f0a37352f llvm::SelectionDAG::Combine(llvm::CombineLevel,
llvm::AAResults*, llvm::CodeGenOpt::Level) (/clang-12+0x2cf852f)
#16 0x0000561f0a47380c llvm::SelectionDAGISel::CodeGenAndEmitDAG()
(/clang-12+0x2df880c)
#17 0x0000561f0a47985b
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&)
(/clang-12+0x2dfe85b)
#18 0x0000561f0a47b1b7
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (.part.0)
(/clang-12+0x2e001b7)
#19 0x0000561f083448bc (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&)
(/clang-12+0xcc98bc)
#20 0x0000561f08940e59
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/clang-12+0x12c5e59)
#21 0x0000561f08e65891 llvm::FPPassManager::runOnFunction(llvm::Function&)
(/clang-12+0x17ea891)
#22 0x0000561f08e65f89 llvm::FPPassManager::runOnModule(llvm::Module&)
(/clang-12+0x17eaf89)
#23 0x0000561f08e64a9c llvm::legacy::PassManagerImpl::run(llvm::Module&)
(/clang-12+0x17e9a9c)
#24 0x0000561f09851944 (anonymous
namespace)::EmitAssemblyHelper::EmitAssembly(clang::BackendAction,
std::unique_ptr<llvm::raw_pwrite_stream,
std::default_delete<llvm::raw_pwrite_stream> >) (/clang-12+0x21d6944)
#25 0x0000561f09853440 clang::EmitBackendOutput(clang::DiagnosticsEngine&,
clang::HeaderSearchOptions const&, 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> >) (/clang-12+0x21d8440)
#26 0x0000561f0a59f249
clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)
(/clang-12+0x2f24249)
#27 0x0000561f0b79f169 clang::ParseAST(clang::Sema&, bool, bool)
(/clang-12+0x4124169)
#28 0x0000561f0a59de20 clang::CodeGenAction::ExecuteAction()
(/clang-12+0x2f22e20)
#29 0x0000561f09ec2419 clang::FrontendAction::Execute() (/clang-12+0x2847419)
#30 0x0000561f09e73796
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/clang-12+0x27f8796)
#31 0x0000561f09f99e98
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/clang-12+0x291ee98)
#32 0x0000561f08281307 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/clang-12+0xc06307)
#33 0x0000561f0827c758 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)
(/clang-12+0xc01758)
#34 0x0000561f09d18dc9 void llvm::function_ref<void
()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const::'lambda'()>(long) (/clang-12+0x269ddc9)
#35 0x0000561f094dfc6c
llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>)
(/clang-12+0x1e64c6c)
#36 0x0000561f09d19a64
clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>
<span class="quote">>, std::__cxx11::basic_string<char, std::char_traits<char>,</span >
std::allocator<char> >*, bool*) const (.part.0) (/clang-12+0x269ea64)
#37 0x0000561f09cec24b
clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&,
clang::driver::Command const*&) const (/clang-12+0x267124b)
#38 0x0000561f09cecd57
clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const
(/clang-12+0x2671d57)
#39 0x0000561f09cf7be9
clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&,
llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&)
(/clang-12+0x267cbe9)
#40 0x0000561f081f035d main (/clang-12+0xb7535d)
#41 0x00007f0e012fc0b3 __libc_start_main
/build/glibc-ZN95T4/glibc-2.31/csu/../csu/libc-start.c:342:3
#42 0x0000561f0827c2ae _start (/clang-12+0xc012ae)
clang-12: error: clang frontend command failed with exit code 134 (use -v to
see invocation)
clang version 12.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
17df5373e6174f56ccdb78ffa072a954731639cc)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: 
clang-12: note: diagnostic msg: 


clang version 12.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
17df5373e6174f56ccdb78ffa072a954731639cc)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: 
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
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>