[LLVMbugs] [Bug 21322] New: no front-end error on illegal code, resulting in back-end crash

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 20 22:16:08 PDT 2014


            Bug ID: 21322
           Summary: no front-end error on illegal code, resulting in
                    back-end crash
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: warren_ristow at playstation.sony.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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).

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141021/7694edda/attachment.html>

More information about the llvm-bugs mailing list