<html>
<head>
<base href="https://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 --- - clang++ crashes on code with "&__imag" on x86_64-linux-gnu"
href="https://llvm.org/bugs/show_bug.cgi?id=26056">26056</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang++ crashes on code with "&__imag" on x86_64-linux-gnu
</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>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>Frontend
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>helloqirun@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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 256926) (llvm/trunk 256925)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.1
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.cc
clang: /home/absozero/trunk/llvm/tools/clang/lib/AST/ExprClassification.cpp:56:
Cl clang::Expr::ClassifyImpl(clang::ASTContext &, clang::SourceLocation *)
const: Assertion `getValueKind() == VK_LValue' failed.
#0 0x0000000003041a98 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/home/absozero/trunk/root-clang/bin/clang+0x3041a98)
#1 0x0000000003042207 (/home/absozero/trunk/root-clang/bin/clang+0x3042207)
#2 0x00007fe4e2a07340 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10340)
#3 0x00007fe4e17ebcc9 gsignal
/build/buildd/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#4 0x00007fe4e17ef0d8 abort /build/buildd/eglibc-2.19/stdlib/abort.c:91:0
#5 0x00007fe4e17e4b86 __assert_fail_base
/build/buildd/eglibc-2.19/assert/assert.c:92:0
#6 0x00007fe4e17e4c32 (/lib/x86_64-linux-gnu/libc.so.6+0x2fc32)
#7 0x00000000017ba356 clang::Expr::ClassifyImpl(clang::ASTContext&,
clang::SourceLocation*) const
(/home/absozero/trunk/root-clang/bin/clang+0x17ba356)
#8 0x00000000017bb678 clang::Expr::ClassifyLValue(clang::ASTContext&) const
(/home/absozero/trunk/root-clang/bin/clang+0x17bb678)
#9 0x0000000000f37517
clang::Sema::CheckAddressOfOperand(clang::ActionResult<clang::Expr*, true>&,
clang::SourceLocation) (/home/absozero/trunk/root-clang/bin/clang+0xf37517)
#10 0x0000000000f3c73b clang::Sema::CreateBuiltinUnaryOp(clang::SourceLocation,
clang::UnaryOperatorKind, clang::Expr*)
(/home/absozero/trunk/root-clang/bin/clang+0xf3c73b)
#11 0x0000000000cdf207 clang::Parser::ParseCastExpression(bool, bool, bool&,
clang::Parser::TypeCastState)
(/home/absozero/trunk/root-clang/bin/clang+0xcdf207)
#12 0x0000000000cdc31c
clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState)
(/home/absozero/trunk/root-clang/bin/clang+0xcdc31c)
#13 0x0000000000cb6c66
clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&,
clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*)
(/home/absozero/trunk/root-clang/bin/clang+0xcb6c66)
#14 0x0000000000cb495a clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&,
unsigned int, clang::SourceLocation*, clang::Parser::ForRangeInit*)
(/home/absozero/trunk/root-clang/bin/clang+0xcb495a)
#15 0x0000000000c9c34d
clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec&, clang::AccessSpecifier)
(/home/absozero/trunk/root-clang/bin/clang+0xc9c34d)
#16 0x0000000000c9bd2a
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*, clang::AccessSpecifier)
(/home/absozero/trunk/root-clang/bin/clang+0xc9bd2a)
#17 0x0000000000c9ae1b
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::ParsingDeclSpec*) (/home/absozero/trunk/root-clang/bin/clang+0xc9ae1b)
#18 0x0000000000c9a3f2
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/home/absozero/trunk/root-clang/bin/clang+0xc9a3f2)
#19 0x0000000000c95ff6 clang::ParseAST(clang::Sema&, bool, bool)
(/home/absozero/trunk/root-clang/bin/clang+0xc95ff6)
#20 0x000000000077c875 clang::FrontendAction::Execute()
(/home/absozero/trunk/root-clang/bin/clang+0x77c875)
#21 0x0000000000745a91
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/home/absozero/trunk/root-clang/bin/clang+0x745a91)
#22 0x0000000000724bcc
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/home/absozero/trunk/root-clang/bin/clang+0x724bcc)
#23 0x000000000071aa88 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/home/absozero/trunk/root-clang/bin/clang+0x71aa88)
#24 0x0000000000723273 main
(/home/absozero/trunk/root-clang/bin/clang+0x723273)
#25 0x00007fe4e17d6ec5 __libc_start_main
/build/buildd/eglibc-2.19/csu/libc-start.c:321:0
#26 0x000000000071a524 _start
(/home/absozero/trunk/root-clang/bin/clang+0x71a524)
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.cc -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/compiler/reduction/abc.cc -resource-dir
/home/absozero/trunk/root-clang/bin/../lib/clang/3.8.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/x86_64-linux-gnu/c++/4.8
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/backward
-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
-fdeprecated-macro -fdebug-compilation-dir /home/absozero/compiler/reduction
-ferror-limit 19 -fmessage-length 172 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o abc.o -x c++
abc.cc
1. abc.cc:2:18: current parser token ';'
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 256926) (llvm/trunk 256925)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/bin
clang: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> 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-1cd58b.cpp
clang: note: diagnostic msg: /tmp/abc-1cd58b.sh
clang: note: diagnostic msg:
********************
———————————————
int b;
int a = &__imag b;</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>