[LLVMbugs] [Bug 13570] New: Reaching unreachable with C++11's auto keyword and -g flag
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Aug 10 01:35:52 PDT 2012
http://llvm.org/bugs/show_bug.cgi?id=13570
Bug #: 13570
Summary: Reaching unreachable with C++11's auto keyword and -g
flag
Product: clang
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: sebastian.lauwers at gmail.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
Hi,
I know there is bug #9414 which seems similar to this, however the test case in
that ticket does not reproduce the issue I have come across. This instance of
the problem seems more specific:
When using the auto keyword on a specific type, in combination with the -g
flag, clang fails, executing an UNREACHABLE at CGDebugInfo.cpp:345
If the -g flag is not used, compilation succeeds.
I have attached the smallest testcase I could figure out to reproduce the
issue. Apologies for it being so massive.
Here is the trace:
$ clang++ -I/home/slau/src/foss/mirror-lib/include testcase.cpp -std=gnu++11 -g
Unexpected builtin type
UNREACHABLE executed at CGDebugInfo.cpp:345!
0 clang 0x0000000001c1c2ff
1 clang 0x0000000001c1c7c4
2 libpthread.so.0 0x00007fea12f37060
3 libc.so.6 0x00007fea122173a5 gsignal + 53
4 libc.so.6 0x00007fea1221ab0b abort + 379
5 clang 0x0000000001c0b0af llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 463
6 clang 0x00000000007e4611
clang::CodeGen::CGDebugInfo::CreateType(clang::BuiltinType const*) + 2145
7 clang 0x00000000007eaae9
clang::CodeGen::CGDebugInfo::CreateTypeNode(clang::QualType, llvm::DIFile) +
505
8 clang 0x00000000007e29b0
clang::CodeGen::CGDebugInfo::getOrCreateType(clang::QualType, llvm::DIFile) +
96
9 clang 0x00000000007e5bf1
clang::CodeGen::CGDebugInfo::CreateType(clang::FunctionType const*,
llvm::DIFile) + 65
10 clang 0x00000000007eaa9e
clang::CodeGen::CGDebugInfo::CreateTypeNode(clang::QualType, llvm::DIFile) +
430
11 clang 0x00000000007e29b0
clang::CodeGen::CGDebugInfo::getOrCreateType(clang::QualType, llvm::DIFile) +
96
12 clang 0x00000000007e6768
clang::CodeGen::CGDebugInfo::getOrCreateMethodType(clang::CXXMethodDecl const*,
llvm::DIFile) + 136
13 clang 0x00000000007e6cc1
clang::CodeGen::CGDebugInfo::CreateCXXMemberFunction(clang::CXXMethodDecl
const*, llvm::DIFile, llvm::DIType) + 81
14 clang 0x00000000007e73e9
clang::CodeGen::CGDebugInfo::CollectCXXMemberFunctions(clang::CXXRecordDecl
const*, llvm::DIFile, llvm::SmallVectorImpl<llvm::Value*>&, llvm::DIType) + 185
15 clang 0x00000000007e85d4
clang::CodeGen::CGDebugInfo::CreateType(clang::RecordType const*) + 1044
16 clang 0x00000000007eab93
clang::CodeGen::CGDebugInfo::CreateTypeNode(clang::QualType, llvm::DIFile) +
675
17 clang 0x00000000007e29b0
clang::CodeGen::CGDebugInfo::getOrCreateType(clang::QualType, llvm::DIFile) +
96
18 clang 0x00000000007e77af
clang::CodeGen::CGDebugInfo::CollectCXXBases(clang::CXXRecordDecl const*,
llvm::DIFile, llvm::SmallVectorImpl<llvm::Value*>&, llvm::DIType) + 399
19 clang 0x00000000007e855f
clang::CodeGen::CGDebugInfo::CreateType(clang::RecordType const*) + 927
20 clang 0x00000000007eab93
clang::CodeGen::CGDebugInfo::CreateTypeNode(clang::QualType, llvm::DIFile) +
675
21 clang 0x00000000007e29b0
clang::CodeGen::CGDebugInfo::getOrCreateType(clang::QualType, llvm::DIFile) +
96
22 clang 0x00000000007eb3ef
clang::CodeGen::CGDebugInfo::CreateLimitedType(clang::RecordType const*) + 1567
23 clang 0x00000000007e4eac
clang::CodeGen::CGDebugInfo::getOrCreateLimitedType(clang::QualType,
llvm::DIFile) + 108
24 clang 0x00000000007e821a
clang::CodeGen::CGDebugInfo::CreateType(clang::RecordType const*) + 90
25 clang 0x00000000007eab93
clang::CodeGen::CGDebugInfo::CreateTypeNode(clang::QualType, llvm::DIFile) +
675
26 clang 0x00000000007e29b0
clang::CodeGen::CGDebugInfo::getOrCreateType(clang::QualType, llvm::DIFile) +
96
27 clang 0x00000000007ed36f
clang::CodeGen::CGDebugInfo::EmitDeclare(clang::VarDecl const*, unsigned int,
llvm::Value*, unsigned int, llvm::IRBuilder<true, llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter<true> >&) + 271
28 clang 0x00000000007f4de6
clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(clang::VarDecl const&) +
2230
29 clang 0x00000000007f2884
clang::CodeGen::CodeGenFunction::EmitVarDecl(clang::VarDecl const&) + 68
30 clang 0x000000000088f00b
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) + 155
31 clang 0x0000000000889a03
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 211
32 clang 0x00000000008893e5
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 37
33 clang 0x000000000088eddc
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 236
34 clang 0x00000000008899e9
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 185
35 clang 0x00000000008893e5
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 37
36 clang 0x000000000089a77e
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 862
37 clang 0x000000000079941e
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 1998
38 clang 0x0000000000796912
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 258
39 clang 0x000000000079814a
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 1530
40 clang 0x000000000079df98
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 216
41 clang 0x00000000007914ef
42 clang 0x00000000007908ac
43 clang 0x00000000008b8374 clang::ParseAST(clang::Sema&, bool, bool)
+ 452
44 clang 0x000000000078fbe8 clang::CodeGenAction::ExecuteAction() +
184
45 clang 0x000000000064fd15 clang::FrontendAction::Execute() + 101
46 clang 0x0000000000632b7d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 973
47 clang 0x000000000061b66c
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3452
48 clang 0x00000000006104eb cc1_main(char const**, char const**, char
const*, void*) + 731
49 clang 0x0000000000617b08 main + 3480
50 libc.so.6 0x00007fea1220230d __libc_start_main + 237
src/foss/mirror-lib/include -fmodule-cache-path /var/tmp/clang-module-cache
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/bin/../lib/clang/3.2/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=gnu++11 -fdeprecated-macro
-fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 136
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/testcase-FopMQt.o -x c++
testcase.cpp
1. <eof> parser at end of file
2. testcase.cpp:24:5: LLVM IR generation of declaration 'main'
3. testcase.cpp:24:5: Generating code for declaration 'main'
4. testcase.cpp:24:16: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 (http://llvm.org/git/clang.git
fc05decf08feefd2ffe8cc250219aee6eab3119c) (http://llvm.org/git/llvm.git
0b66bd9b078c99dfca6ba0836750cdc168f635d1)
Target: x86_64-unknown-linux-gnu
Thread model: posix
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/testcase-rL0SSD.cpp
clang: note: diagnostic msg: /tmp/testcase-rL0SSD.sh
clang: note: diagnostic msg:
********************
In case more information is required:
Project in which the bug was found: https://github.com/firestarter/firestarter
mirror/puddle library: http://kifri.fri.uniza.sk/~chochlik/mirror-lib/html/
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list