<html>
    <head>
      <base href="http://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 --- - Compile error after commit 214628. (Assertion `begin() + idx < end()' failed)"
   href="http://llvm.org/bugs/show_bug.cgi?id=20540">20540</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Compile error after commit 214628. (Assertion `begin() + idx < end()' failed)
          </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>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>After commit 214628 llc failed to compile
a.ll: (Reproducer)
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind readnone
declare i32 @llvm.x86.sse2.pmovmskb.128(<16 x i8>) #0

; Function Attrs: nounwind
define void @f_fu_(float* noalias nocapture %RET, <8 x i8> %__mask) #1 {
allocas:
  %mask8.i.i.i = shufflevector <8 x i8> %__mask, <8 x i8> <i8 0, i8 undef, i8
undef, i8 undef, i8 undef, i8 undef, i8 undef, i8 undef>, <16 x i32> <i32 0,
i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 8, i32 8, i32 8,
i32 8, i32 8, i32 8, i32 8>
  %m.i.i.i = call i32 @llvm.x86.sse2.pmovmskb.128(<16 x i8> %mask8.i.i.i) #1
  br label %pl_loopend.i.i

pl_loopend.i.i:
  %pl_and.i.1.i = and i32 %m.i.i.i, 2
  ret void
}

Compilation string:
.../llvm/bin-trunk_r214628/bin/llc a.ll -o new.s --mattr='+sse4.1'

Output:
llc:
/export/users/amitrokh/llvm/llvm-trunk_r214628/include/llvm/ADT/SmallVector.h:141:
reference llvm::SmallVectorTemplateCommon<int, void>::operator[](unsigned int)
[T = int]: Assertion `begin() + idx < end()' failed.
0  llc             0x00000000013b0a15 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1  llc             0x00000000013b1163
2  libpthread.so.0 0x0000003a4820f750
3  libc.so.6       0x0000003a47a35c39 gsignal + 57
4  libc.so.6       0x0000003a47a37348 abort + 328
5  libc.so.6       0x0000003a47a2eb96
6  libc.so.6       0x0000003a47a2ec42
7  llc             0x0000000000bfd707
8  llc             0x0000000000bfc212
9  llc             0x0000000000bf5614
10 llc             0x0000000000be1d91
llvm::X86TargetLowering::PerformDAGCombine(llvm::SDNode*,
llvm::TargetLowering::DAGCombinerInfo&) const + 3185
11 llc             0x0000000000c4fe0e
12 llc             0x0000000000c4f48e
llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AliasAnalysis&,
llvm::CodeGenOpt::Level) + 2254
13 llc             0x0000000000d6ff4b
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 3259
14 llc             0x0000000000d6e628
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 7096
15 llc             0x0000000000d6ba94
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1332
16 llc             0x0000000000b69806
17 llc             0x0000000000ee7a8c
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 124
18 llc             0x000000000134744a
llvm::FPPassManager::runOnFunction(llvm::Function&) + 362
19 llc             0x00000000013476db
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
20 llc             0x0000000001347c77
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 999
21 llc             0x0000000000582c1d main + 6749
22 libc.so.6       0x0000003a47a21d65 __libc_start_main + 245
23 llc             0x000000000057fbad
Stack dump:
0.      Program arguments: .../llvm/bin-trunk_r214628/bin/llc a.ll -o new.s
--mattr=+sse4.1
1.      Running pass 'Function Pass Manager' on module 'a.ll'.
2.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@f_fu_'

On LLVM 214627 everything goes smoothly.

It appears that Mask array (generated from OpMask array with
'getTargetShuffleMask') in llvm-trunk/lib/Target/X86/X86ISelLowering.cpp line
19132 upon call to the 'combineX86ShufflesRecursively' has illegal values {0 1
2 3 4 5 6 7 -1 -1 -1 -1 -1 -1 -1 -1} and size 16. The assert fails when meets
'-1'</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>