<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 --- - no front-end error on illegal code, resulting in back-end crash"
   href="http://llvm.org/bugs/show_bug.cgi?id=21322">21322</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>no front-end error on illegal code, resulting in back-end crash
          </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>Windows NT
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>warren_ristow@playstation.sony.com
          </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>The x86 test-case below gets an assertion-failure:

$ cat test.cpp
//////////////// "test.cpp" ////////////////
#include <x86intrin.h>

__m128 vec_right_shift_err_test(__m128 v)
{
    return v >> (__m128) { 1.0f, 1.0f };
}
////////////////////////////////////////////
$ clang++ --version
clang version 3.6.0 (trunk 220234)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ clang++ -c test.cpp
clang: /home/warren/Upstream/llvm/lib/IR/Instructions.cpp:1830:
  void llvm::BinaryOperator::init(llvm::Instruction::BinaryOps):
  Assertion `(getType()->isIntegerTy() ||
    (getType()->isVectorTy() &&
    cast<VectorType>(getType())->getElementType()->isIntegerTy())) &&
    "Tried to create a shift operation on a non-integral type!"' failed.
  ...
$

Checking earlier pre-built Clang+LLVM binaries, version 3.2 produced a
user-error (and didn't crash):

$ ~/llvm.3.2/bin/clang++ --version
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$ ~/llvm.3.2/bin/clang++ -c test.cpp
test.cpp:6:14: error: invalid operands to binary expression
      ('__m128' and '__m128')
    return v >> (__m128) { 1.0f, 1.0f };
           ~ ^  ~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
$

But version 3.3 and later get compiler crashes.  I suppose the proper behavior
is to produce an error message, like 3.2 did (and doing that would then prevent
the assertion-failure from triggering).</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>