[llvm-bugs] [Bug 26099] New: clang crashes on valid code on x86_64-linux-gnu

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Jan 9 21:22:24 PST 2016


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

            Bug ID: 26099
           Summary: clang crashes on valid code on x86_64-linux-gnu
           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.


$ clang-trunk -v
clang version 3.8.0 (trunk 257159)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
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.1
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64


$ clang-trunk -c abc.c
clang: /home/absozero/trunk/llvm/include/llvm/Support/Casting.h:237: typename
cast_retty<X, Y *>::ret_type llvm::cast(Y *) [X = llvm::VectorType, Y =
llvm::Type]: Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible
type!"' failed.
#0 0x000000000304f3e8 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/root-clang/bin/clang+0x304f3e8)
#1 0x000000000304fb57 (/home/absozero/trunk/root-clang/bin/clang+0x304fb57)
#2 0x00007f72ab96c340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#3 0x00007f72aa980cc9 gsignal
/build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007f72aa9840d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007f72aa979b86 __assert_fail_base
/build/buildd/eglibc-2.19/assert/assert.c:92:0
#6 0x00007f72aa979c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#7 0x0000000000ba1a21
clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(llvm::Value*,
clang::CodeGen::Address, bool, clang::QualType,
clang::CodeGen::AlignmentSource, llvm::MDNode*, bool, clang::QualType, unsigned
long, bool) (/home/absozero/trunk/root-clang/bin/clang+0xba1a21)
#8 0x0000000000b8fb23
clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(clang::CodeGen::RValue,
clang::CodeGen::LValue, bool)
(/home/absozero/trunk/root-clang/bin/clang+0xb8fb23)
#9 0x0000000000b77fa9
clang::CodeGen::CodeGenFunction::EmitScalarInit(clang::Expr const*,
clang::ValueDecl const*, clang::CodeGen::LValue, bool)
(/home/absozero/trunk/root-clang/bin/clang+0xb77fa9)
#10 0x0000000000b7b226
clang::CodeGen::CodeGenFunction::EmitExprAsInit(clang::Expr const*,
clang::ValueDecl const*, clang::CodeGen::LValue, bool)
(/home/absozero/trunk/root-clang/bin/clang+0xb7b226)
#11 0x0000000000b79caa
clang::CodeGen::CodeGenFunction::EmitAutoVarInit(clang::CodeGen::CodeGenFunction::AutoVarEmission
const&) (/home/absozero/trunk/root-clang/bin/clang+0xb79caa)
#12 0x0000000000b766a1
clang::CodeGen::CodeGenFunction::EmitVarDecl(clang::VarDecl const&)
(/home/absozero/trunk/root-clang/bin/clang+0xb766a1)
#13 0x0000000000a4788b
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&)
(/home/absozero/trunk/root-clang/bin/clang+0xa4788b)
#14 0x0000000000a3f727
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
(/home/absozero/trunk/root-clang/bin/clang+0xa3f727)
#15 0x0000000000a3e831 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*) (/home/absozero/trunk/root-clang/bin/clang+0xa3e831)
#16 0x0000000000a4851c
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/home/absozero/trunk/root-clang/bin/clang+0xa4851c)
#17 0x0000000000a78f17
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/home/absozero/trunk/root-clang/bin/clang+0xa78f17)
#18 0x0000000000a8c545
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/home/absozero/trunk/root-clang/bin/clang+0xa8c545)
#19 0x0000000000a88533
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/home/absozero/trunk/root-clang/bin/clang+0xa88533)
#20 0x0000000000a8e437
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*)
(/home/absozero/trunk/root-clang/bin/clang+0xa8e437)
#21 0x00000000009f9eaf (/home/absozero/trunk/root-clang/bin/clang+0x9f9eaf)
#22 0x00000000009ec7e7 (/home/absozero/trunk/root-clang/bin/clang+0x9ec7e7)
#23 0x0000000000ca0ff3 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang+0xca0ff3)
#24 0x000000000077f905 clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang+0x77f905)
#25 0x00000000007477f1
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang+0x7477f1)
#26 0x000000000072630c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang+0x72630c)
#27 0x000000000071c1c8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang+0x71c1c8)
#28 0x00000000007249b3 main
(/home/absozero/trunk/root-clang/bin/clang+0x7249b3)
#29 0x00007f72aa96bec5 __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:321:0
#30 0x000000000071bc64 _start
(/home/absozero/trunk/root-clang/bin/clang+0x71bc64)
Stack dump:
0.    Program arguments: /home/absozero/trunk/root-clang/bin/clang -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 -target-linker-version 2.24
-dwarf-column-info -debugger-tuning=gdb -coverage-file
/home/absozero/projects/reduction/abc.c -resource-dir
/home/absozero/trunk/root-clang/bin/../lib/clang/3.8.0 -c-isystem
/usr/local/include/csmith-2.3.0 -c-isystem . -cxx-isystem
/usr/local/include/csmith-2.3.0 -cxx-isystem . -internal-isystem
/usr/local/include -internal-isystem
/home/absozero/trunk/root-clang/bin/../lib/clang/3.8.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 -ferror-limit 19
-fmessage-length 172 -fobjc-runtime=gcc -fdiagnostics-show-option
-fcolor-diagnostics -o abc.o -x c abc.c
1.    <eof> parser at end of file
2.    abc.c:2:6: LLVM IR generation of declaration 'bar'
3.    abc.c:2:6: Generating code for declaration 'bar'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.8.0 (trunk 257159)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang: 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: note: diagnostic msg:
********************

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

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



$ cat abc.c

void bar (int a)
{
  int __attribute__ ((__vector_size__ (8))) b = __builtin_ia32_vec_init_v2si
(0, a);
}

-- 
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/20160110/33b1601d/attachment-0001.html>


More information about the llvm-bugs mailing list