[LLVMbugs] [Bug 14756] New: Core dump when compiling a simple c++ source file (involving rvalue reference)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Dec 30 18:48:14 PST 2012


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

             Bug #: 14756
           Summary: Core dump when compiling a simple c++ source file
                    (involving rvalue reference)
           Product: clang
           Version: 3.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: zhangxiongpang at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Platform: linux, x86_64, clang++3.2 (trunk 167604)

Source file:
------------------------------------------
// test.cpp
typedef int(fun_type)(int);
fun_type&& foo(){ return fun_type(); }
------------------------------------------

Building command:
------------------------------------------
clang++ -std=c++0x -c test.cpp
------------------------------------------

Core dump information:
------------------------------------------
Cannot create a null constant of that type!
UNREACHABLE executed at /var/tmp/llvm/llvm/lib/VMCore/Constants.cpp:120!
0  clang           0x0000000002c0e5e1
1  clang           0x0000000002c0e2b6
2  libpthread.so.0 0x000000370100f4c0
3  libc.so.6       0x0000003700c329a5 gsignal + 53
4  libc.so.6       0x0000003700c34185 abort + 373
5  clang           0x0000000002bf6317
6  clang           0x0000000002acda42 llvm::Constant::getNullValue(llvm::Type*)
+ 696
7  clang           0x0000000000f63219
8  clang           0x0000000000f601a8
9  clang           0x0000000000f6fb72
10 clang           0x0000000000f5fee9
11 clang           0x0000000000f6e9ac
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 156
12 clang           0x0000000000f19a67
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 99
13 clang           0x0000000000f1ac78
14 clang           0x0000000000f1b3a9
clang::CodeGen::CodeGenFunction::EmitReferenceBindingToExpr(clang::Expr const*,
clang::NamedDecl const*) + 113
15 clang           0x0000000000fd1db4
clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) + 616
16 clang           0x0000000000fcf4d1
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 747
17 clang           0x0000000000fcf964
clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt const&,
bool, clang::CodeGen::AggValueSlot) + 248
18 clang           0x0000000000fcf72f
clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*) + 243
19 clang           0x0000000000fcf231
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 75
20 clang           0x0000000000fe8b1e
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&)
+ 154
21 clang           0x0000000000fe903f
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 1005
22 clang           0x0000000000e5defb
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 865
23 clang           0x0000000000e5ace4
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 450
24 clang           0x0000000000e5a5c9
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 753
25 clang           0x0000000000e610c1
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 321
26 clang           0x0000000000e53095
27 clang           0x0000000000e51acd
28 clang           0x0000000001010817 clang::ParseAST(clang::Sema&, bool, bool)
+ 553
29 clang           0x0000000000c48152 clang::ASTFrontendAction::ExecuteAction()
+ 298
30 clang           0x0000000000e50f0f clang::CodeGenAction::ExecuteAction() +
1223
31 clang           0x0000000000c47d86 clang::FrontendAction::Execute() + 252
32 clang           0x0000000000c1ffe7
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 717
33 clang           0x0000000000bf0e92
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1036
34 clang           0x0000000000be1511 cc1_main(char const**, char const**, char
const*, void*) + 710
35 clang           0x0000000000beb759 main + 484
36 libc.so.6       0x0000003700c1ec5d __libc_start_main + 253
37 clang           0x0000000000be0ce9
Stack dump:
0.      Program arguments: /var/tmp/llvm/build/Debug+Asserts/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free
-main-file-name test.cpp -mrelocation-model static -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu
x86-64 -target-linker-version 2.20.51.0.2 -momit-leaf-frame-pointer
-coverage-file /var/tmp/zhang/20121231/test/test.o -resource-dir
/var/tmp/llvm/build/Debug+Asserts/bin/../lib/clang/3.2 -fmodule-cache-path
/var/tmp/clang-module-cache -internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux
-internal-isystem
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/backward
-internal-isystem /usr/local/include -internal-isystem
/var/tmp/llvm/build/Debug+Asserts/bin/../lib/clang/3.2/include
-internal-externc-isystem /include -internal-externc-isystem /usr/include
-std=c++0x -fdeprecated-macro -fdebug-compilation-dir
/usr/tmp/zhang/20121231/test -ferror-limit 19 -fmessage-length 114
-mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o test.o -x c++ test.cpp 
1.      <eof> parser at end of file
2.      test.cpp:2:12: LLVM IR generation of declaration 'foo'
3.      test.cpp:2:12: Generating code for declaration 'foo'
4.      test.cpp:2:17: LLVM IR generation of compound statement ('{}')
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.2 (trunk 167604) (llvm/trunk 167603)
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/test-I5VIwj.cpp
clang: note: diagnostic msg: /tmp/test-I5VIwj.sh
clang: note: diagnostic msg: 

********************
------------------------------------------

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