[LLVMbugs] [Bug 9414] New: Clang reaching UNREACHABLE upon using the C++0x 'auto' keyword together with -g flag

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Mar 6 06:58:27 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=9414

           Summary: Clang reaching UNREACHABLE upon using the C++0x 'auto'
                    keyword together with -g flag
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++0x
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: henrik at mysko.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Reproducer:

int main()
{
    auto x = 0;
    return x;
}

The code above compiles without -g:

$ clang++ -std=c++0x auto.cpp
$

But not with -g:

$ clang++ -std=c++0x -g auto.cpp
type should have been unwrapped!
UNREACHABLE executed at
/home/henrik/Storage/tmp/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp:1478!
0  clang           0x0000000001913d3f
1  clang           0x000000000191487a
2  libpthread.so.0 0x00007f9da2df2c80
3  libc.so.6       0x00007f9da20cbe25 gsignal + 53
4  libc.so.6       0x00007f9da20cfbe6 abort + 390
5  clang           0x00000000018fe9e4 llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 356
6  clang           0x00000000007dccf7
clang::CodeGen::CGDebugInfo::CreateTypeNode(clang::QualType, llvm::DIFile) +
455
7  clang           0x00000000007dd0cf
clang::CodeGen::CGDebugInfo::getOrCreateType(clang::QualType, llvm::DIFile) +
239
8  clang           0x00000000007e7ce4
clang::CodeGen::CGDebugInfo::EmitDeclare(clang::VarDecl const*, unsigned int,
llvm::Value*, unsigned int, llvm::IRBuilder<true, llvm::ConstantFolder,
llvm::IRBuilderDefaultInserter<true> >&) + 164
9  clang           0x00000000007f0575
clang::CodeGen::CodeGenFunction::EmitAutoVarAlloca(clang::VarDecl const&) +
1621
10 clang           0x00000000007f2676
clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(clang::VarDecl const&) + 22
11 clang           0x000000000088c9a8
clang::CodeGen::CodeGenFunction::EmitDeclStmt(clang::DeclStmt const&) + 88
12 clang           0x0000000000893d47
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 87
13 clang           0x000000000089031c
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 44
14 clang           0x0000000000893aff
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 239
15 clang           0x0000000000893de4
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 244
16 clang           0x000000000089031c
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 44
17 clang           0x00000000008b4da0
clang::CodeGen::CodeGenFunction::GenerateCode(clang::CodeGen::GlobalDecl,
llvm::Function*) + 672
18 clang           0x000000000079610a
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::CodeGen::GlobalDecl)
+ 794
19 clang           0x0000000000796d53
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::CodeGen::GlobalDecl)
+ 243
20 clang           0x0000000000797f1d
clang::CodeGen::CodeGenModule::EmitGlobal(clang::CodeGen::GlobalDecl) + 813
21 clang           0x000000000079820b
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 427
22 clang           0x000000000078bc94
23 clang           0x000000000078b667
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) + 151
24 clang           0x00000000008ce7ea clang::ParseAST(clang::Sema&, bool) + 154
25 clang           0x000000000078a1f4 clang::CodeGenAction::ExecuteAction() +
68
26 clang           0x000000000067536b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 347
27 clang           0x00000000006505ea
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1130
28 clang           0x0000000000646503 cc1_main(char const**, char const**, char
const*, void*) + 691
29 clang           0x000000000064f61c main + 5020
30 libc.so.6       0x00007f9da20b6efe __libc_start_main + 254
31 clang           0x0000000000646069
Stack dump:
0.      Program arguments: /usr/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
auto.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.21.0.20110302 -momit-leaf-frame-pointer -g -resource-dir
/usr/local/bin/../lib/clang/2.9 -std=c++0x -ferror-limit 19 -fmessage-length
272 -fcxx-exceptions -fexceptions -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/cc-5fnYLw.o -x c++ auto.cpp 
1.      <eof> parser at end of file
2.      auto.cpp:1:5: LLVM IR generation of declaration 'main'
3.      auto.cpp:1:5: Generating code for declaration 'main'
4.      auto.cpp:2:1: LLVM IR generation of compound statement ('{}')
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)

$ clang++ --version
clang version 2.9 (trunk 127118)
Target: x86_64-unknown-linux-gnu
Thread model: posix

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