[LLVMbugs] [Bug 14319] New: ICE on const ref initialization

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Nov 11 22:11:39 PST 2012


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

             Bug #: 14319
           Summary: ICE on const ref initialization
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: leonid at volnitsky.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


GCC-4.8 is ok.  File main.i is attached. Original source at
https://github.com/lvv/scc/tree/clang-ice . 
If line 24 at https://github.com/lvv/scc/blob/clang-ice/mapped_range.h, is
uncommented - CLANG will ICE.  This line declare unused var, so this line can
be commented out. 

The line:

parent_t * const & parent_p = (parent_t*)(b::parent_p);


Clang ICE msg:

0  libLLVM-3.2svn.so 0x00007f381b728dff
1  libLLVM-3.2svn.so 0x00007f381b729359
2  libpthread.so.0   0x00007f381aef5410
3  clang             0x00000000006e9773
clang::CodeGen::CodeGenModule::GetOrCreateLLVMFunction(llvm::StringRef,
llvm::Type*, clang::GlobalDecl, bool, llvm::Attributes) + 627
4  clang             0x00000000006e99b5
clang::CodeGen::CodeGenModule::GetAddrOfFunction(clang::GlobalDecl,
llvm::Type*, bool) + 101
5  clang             0x000000000075238e
6  clang             0x000000000075b99f
clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(clang::DeclRefExpr const*) +
415
7  clang             0x000000000075c4c8
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 552
8  clang             0x0000000000760909
clang::CodeGen::CodeGenFunction::EmitCheckedLValue(clang::Expr const*,
clang::CodeGen::CodeGenFunction::TypeCheckKind) + 41
9  clang             0x0000000000787440
10 clang             0x000000000078eed2
11 clang             0x000000000078d37f
12 clang             0x000000000079124b
13 clang             0x000000000078dbc9
14 clang             0x0000000000791a5c
15 clang             0x000000000078dacf
16 clang             0x0000000000792bfd
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 61
17 clang             0x00000000007509c7
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 423
18 clang             0x000000000075cbcf
19 clang             0x000000000075d52b
clang::CodeGen::CodeGenFunction::EmitReferenceBindingToExpr(clang::Expr const*,
clang::NamedDecl const*) + 91
20 clang             0x000000000073de2e
clang::CodeGen::CodeGenFunction::EmitExprAsInit(clang::Expr const*,
clang::ValueDecl const*, clang::CodeGen::LValue, bool) + 302
21 clang             0x00000000007255ff
clang::CodeGen::CodeGenFunction::EmitInitializerForField(clang::FieldDecl*,
clang::CodeGen::LValue, clang::Expr*, llvm::ArrayRef<clang::VarDecl*>) + 879
22 clang             0x00000000007260d7
clang::CodeGen::CodeGenFunction::EmitCtorPrologue(clang::CXXConstructorDecl
const*, clang::CXXCtorType, clang::CodeGen::FunctionArgList&) + 1991
23 clang             0x00000000007278cc
clang::CodeGen::CodeGenFunction::EmitConstructorBody(clang::CodeGen::FunctionArgList&)
+ 124
24 clang             0x00000000007fa20b
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 955
25 clang             0x000000000070bc11
clang::CodeGen::CodeGenModule::EmitCXXConstructor(clang::CXXConstructorDecl
const*, clang::CXXCtorType) + 177
26 clang             0x00000000006ead41
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 433
27 clang             0x00000000006ec53e
clang::CodeGen::CodeGenModule::EmitDeferred() + 142
28 clang             0x00000000006ec5a9
clang::CodeGen::CodeGenModule::Release() + 9
29 clang             0x00000000006d10a5
30 clang             0x00000000008184fe clang::ParseAST(clang::Sema&, bool,
bool) + 334
31 clang             0x00000000006d00b3 clang::CodeGenAction::ExecuteAction() +
51
32 clang             0x0000000000598a41 clang::FrontendAction::Execute() + 97
33 clang             0x0000000000579fef
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 271
34 clang             0x0000000000560788
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1560
35 clang             0x0000000000556b92 cc1_main(char const**, char const**,
char const*, void*) + 6706
36 clang             0x000000000055f4ab main + 5915
37 libc.so.6         0x00007f381a63d4bd __libc_start_main + 253
38 clang             0x0000000000554fb9
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu -S
-disable-free -disable-llvm-verifier -main-file-name main.cc -mrelocation-model
static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -target-linker-version 2.22
-momit-leaf-frame-pointer -g -resource-dir /usr/bin/../lib/clang/3.2 -O0 -Wall
-Wno-sign-compare -Wno-unused-function -std=gnu++11 -fdeprecated-macro
-fdebug-compilation-dir /home/lvv/p/scc -ferror-limit 19 -fmessage-length 127
-ftrapv -mstackrealign -fobjc-runtime=gcc -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o main.s -x c++-cpp-output
main.ii 
1.    <eof> parser at end of file
2.    Per-file LLVM IR generation
3.    /home/lvv/p/scc/mapped_range.h:52:2: Generating code for declaration
'sto::mapped_range_iterator<std::__debug::vector<std::tuple<int,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::allocator<std::tuple<int, std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > > &, const int &(*)(const std::tuple<int,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > > &),
int, true>::mapped_range_iterator'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.2 (trunk)
Target: x86_64-pc-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/main-cfCCJJ.cpp
clang: note: diagnostic msg: /tmp/main-cfCCJJ.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