[llvm-bugs] [Bug 26596] New: clang crashes on x86_64-linux-gnu with message "Tried to create a shift operation on a non-integral type"

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 12 13:33:21 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26596

            Bug ID: 26596
           Summary: clang crashes on x86_64-linux-gnu with message "Tried
                    to create a shift operation on a non-integral type"
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: helloqirun at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

The current clang trunk crashes when compiling the following test case on
x86_64-linux-gnu in both 32-bit and 64-bit modes.

It might be a regression from 3.3.


$ clang-trunk -v
clang version 3.9.0 (trunk 260668)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.3
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0
Selected GCC installation:
/usr/local/bin/../lib/gcc/x86_64-unknown-linux-gnu/5.3.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64



$ clang-trunk abc.c
clang-3.9: /home/absozero/trunk/llvm/lib/IR/Instructions.cpp:1992: 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.
#0 0x000000000187da38 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x187da38)
#1 0x000000000187bec6 llvm::sys::RunSignalHandlers()
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x187bec6)
#2 0x000000000187e15e SignalHandler(int)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x187e15e)
#3 0x00007f3bac83e340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#4 0x00007f3bab9f0cc9 gsignal
/build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007f3bab9f40d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#6 0x00007f3bab9e9b86 __assert_fail_base
/build/buildd/eglibc-2.19/assert/assert.c:92:0
#7 0x00007f3bab9e9c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#8 0x000000000147216d llvm::BinaryOperator::init(llvm::Instruction::BinaryOps)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x147216d)
#9 0x000000000147202f
llvm::BinaryOperator::BinaryOperator(llvm::Instruction::BinaryOps,
llvm::Value*, llvm::Value*, llvm::Type*, llvm::Twine const&,
llvm::Instruction*) (/home/absozero/trunk/root-clang/bin/clang-3.9+0x147202f)
#10 0x00000000014725d2
llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value*,
llvm::Value*, llvm::Twine const&, llvm::Instruction*)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x14725d2)
#11 0x0000000001b949aa (anonymous
namespace)::ScalarExprEmitter::EmitShl((anonymous namespace)::BinOpInfo const&)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1b949aa)
#12 0x0000000001b918b0 (anonymous
namespace)::ScalarExprEmitter::EmitCompoundAssignLValue(clang::CompoundAssignOperator
const*, llvm::Value* ((anonymous namespace)::ScalarExprEmitter::*)((anonymous
namespace)::BinOpInfo const&), llvm::Value*&)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1b918b0)
#13 0x0000000001ba0a37 (anonymous
namespace)::ScalarExprEmitter::EmitCompoundAssign(clang::CompoundAssignOperator
const*, llvm::Value* ((anonymous namespace)::ScalarExprEmitter::*)((anonymous
namespace)::BinOpInfo const&))
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1ba0a37)
#14 0x0000000001b8dea6
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1b8dea6)
#15 0x0000000001b51ed8 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1b51ed8)
#16 0x00000000019fa3bf clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*) (/home/absozero/trunk/root-clang/bin/clang-3.9+0x19fa3bf)
#17 0x0000000001a040fb
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1a040fb)
#18 0x0000000001a2fc07
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1a2fc07)
#19 0x0000000001a43343
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/home/absozero/trunk/root-clang/bin/clang-3.9+0x1a43343)
#20 0x0000000001a3f123
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/home/absozero/trunk/root-clang/bin/clang-3.9+0x1a3f123)
#21 0x0000000001a451b7
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1a451b7)
#22 0x000000000205e54f (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x205e54f)
#23 0x000000000205d7c7
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x205d7c7)
#24 0x0000000002404ee3 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x2404ee3)
#25 0x0000000001d76f15 clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1d76f15)
#26 0x0000000001d41461
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1d41461)
#27 0x0000000001e0c69d
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x1e0c69d)
#28 0x000000000072ccf8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang-3.9+0x72ccf8)
#29 0x000000000072b80f main
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x72b80f)
#30 0x00007f3bab9dbec5 __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:321:0
#31 0x00000000007286ae _start
(/home/absozero/trunk/root-clang/bin/clang-3.9+0x7286ae)
Stack dump:
0.    Program arguments: /home/absozero/trunk/root-clang/bin/clang-3.9 -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name abc.c -mrelocation-model static -mthread-model posix
-mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -resource-dir
/home/absozero/trunk/root-clang/bin/../lib/clang/3.9.0 -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/bin/../lib/clang/3.9.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-fdebug-compilation-dir /home/absozero/projects/reduction/crash -ferror-limit
19 -fmessage-length 142 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/abc-c1ffda.o -x c abc.c 
1.    <eof> parser at end of file
2.    abc.c:2:5: LLVM IR generation of declaration 'main'
3.    abc.c:2:5: Generating code for declaration 'main'
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 260668)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang-3.9: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.9: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.9: note: diagnostic msg: /tmp/abc-a91917.c
clang-3.9: note: diagnostic msg: /tmp/abc-a91917.sh
clang-3.9: note: diagnostic msg: 

********************



----
$ cat abc.c
__attribute__((__vector_size__(4 * sizeof(float)))) float a, b;
int main() { a <<= b; }

-- 
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/20160212/ca1d61e5/attachment.html>


More information about the llvm-bugs mailing list