[LLVMbugs] [Bug 8691] New: clang fails to compile big static arrays
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Nov 24 17:46:24 PST 2010
http://llvm.org/bugs/show_bug.cgi?id=8691
Summary: clang fails to compile big static arrays
Product: new-bugs
Version: trunk
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: zl29ah at gmail.com
CC: llvmbugs at cs.uiuc.edu
I had around 700mb of free ram, so it seems pretty strange to me:
l29ah at l29ah-home /tmp $ echo 'char foo[12345678] = {1}; int main(){return
foo[1233];}' > a.c
l29ah at l29ah-home /tmp $ clang a.c
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
0 clang 0x00000000015f8dbf
1 clang 0x00000000015f9379
2 libpthread.so.0 0x00007f8a5c495470
3 libc.so.6 0x00007f8a5b7a87c5 gsignal + 53
4 libc.so.6 0x00007f8a5b7a9c46 abort + 390
5 libstdc++.so.6 0x00007f8a5c0376ad __gnu_cxx::__verbose_terminate_handler()
+ 285
6 libstdc++.so.6 0x00007f8a5c035976
7 libstdc++.so.6 0x00007f8a5c0359a3
8 libstdc++.so.6 0x00007f8a5c035aae
9 libstdc++.so.6 0x00007f8a5c035e9d operator new(unsigned long) + 125
10 clang 0x0000000001553bda llvm::User::operator new(unsigned long,
unsigned int) + 42
11 clang 0x00000000014d6934
llvm::ConstantUniqueMap<std::vector<llvm::Constant*,
std::allocator<llvm::Constant*> >, llvm::ArrayType, llvm::ConstantArray,
true>::Create(llvm::ArrayType const*, std::vector<llvm::Constant*,
std::allocator<llvm::Constant*> > const&,
std::_Rb_tree_iterator<std::pair<std::pair<llvm::ArrayType const*,
std::vector<llvm::Constant*, std::allocator<llvm::Constant*> > > const,
llvm::ConstantArray*> >) + 52
12 clang 0x00000000014c901e llvm::ConstantArray::get(llvm::ArrayType
const*, std::vector<llvm::Constant*, std::allocator<llvm::Constant*> > const&)
+ 622
13 clang 0x0000000000810938
14 clang 0x0000000000810a99
clang::CodeGen::CodeGenModule::EmitConstantExpr(clang::Expr const*,
clang::QualType, clang::CodeGen::CodeGenFunction*) + 249
15 clang 0x0000000000779f2f
clang::CodeGen::CodeGenModule::EmitGlobalVarDefinition(clang::VarDecl const*) +
79
16 clang 0x000000000077cd6c
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::CodeGen::GlobalDecl)
+ 156
17 clang 0x000000000077d305
clang::CodeGen::CodeGenModule::EmitGlobal(clang::CodeGen::GlobalDecl) + 821
18 clang 0x000000000077d59b
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 251
19 clang 0x00000000007703c1
20 clang 0x000000000076ec10
21 clang 0x000000000089fd8d clang::ParseAST(clang::Sema&, bool) + 173
22 clang 0x000000000076f7e3 clang::CodeGenAction::ExecuteAction() +
51
23 clang 0x000000000068793b
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 283
24 clang 0x0000000000669f42
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1154
25 clang 0x00000000006615b0 cc1_main(char const**, char const**, char
const*, void*) + 704
26 clang 0x0000000000668c82 main + 3090
27 libc.so.6 0x00007f8a5b794cdd __libc_start_main + 253
28 clang 0x0000000000661129
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name a.c
-mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.20.1.20100303
-resource-dir /usr/bin/../lib/clang/2.9 -ferror-limit 19 -fmessage-length 99
-fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-FjV6mE.o
-x c a.c
1. a.c:1:27: current parser token 'int'
2. a.c:1:6: LLVM IR generation of declaration 'foo'
3. a.c:1:6: Generating code for declaration 'foo'
clang: error: unable to execute command: Aborted
clang: error: clang frontend command failed due to signal 1 (use -v to see
invocation)
--
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