[LLVMbugs] [Bug 14465] New: ICE: "bitwidth too large" assertion in SROA pass

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 30 09:36:42 PST 2012


             Bug #: 14465
           Summary: ICE: "bitwidth too large" assertion in SROA pass
           Product: clang
           Version: 3.2
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: llvm-bugs at justinbogner.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 9623
  --> http://llvm.org/bugs/attachment.cgi?id=9623
Preprocessed source

I have this function that stomps on the stack in some unit test code:

    /* I came up with this number through trial and error. */
    int stack[1024*1024];

    memset(stack, 0xFE, sizeof(stack));

This causes an assertion in clang with -O1 and -O2. The assertion occurs if the
size of the array is (1<<18) or greater, and this compiles with (1<<17).


clang: /home/bognej/src/llvm/lib/VMCore/Type.cpp:306: static llvm::IntegerType
*llvm::IntegerType::get(llvm::LLVMContext &, unsigned int): Assertion `NumBits
<= MAX_INT_BITS && "bitwidth too large"' failed.
0  clang           0x0000000001d92a4f
1  clang           0x0000000001d92f33
2  libpthread.so.0 0x00007fe23ba43cb0
3  libc.so.6       0x00007fe23ac99445 gsignal + 53
4  libc.so.6       0x00007fe23ac9cbab abort + 379
5  libc.so.6       0x00007fe23ac9210e
6  libc.so.6       0x00007fe23ac921b2
7  clang           0x0000000001d3f01c
llvm::IntegerType::get(llvm::LLVMContext&, unsigned int) + 460
8  clang           0x0000000001a39f5f
9  clang           0x0000000001a36591
10 clang           0x0000000001d34a7b
llvm::FPPassManager::runOnFunction(llvm::Function&) + 443
11 clang           0x0000000001d33ff8
llvm::FunctionPassManagerImpl::run(llvm::Function&) + 168
12 clang           0x0000000001d33eec
llvm::FunctionPassManager::run(llvm::Function&) + 108
13 clang           0x00000000007a5815
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*,
clang::BackendAction, llvm::raw_ostream*) + 5557
14 clang           0x00000000007a342a
15 clang           0x00000000008d7545 clang::ParseAST(clang::Sema&, bool, bool)
+ 549
16 clang           0x00000000007a249c clang::CodeGenAction::ExecuteAction() +
17 clang           0x0000000000645b9a clang::FrontendAction::Execute() + 106
18 clang           0x0000000000627eed
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 989
19 clang           0x000000000060ea52
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3618
20 clang           0x0000000000605836 cc1_main(char const**, char const**, char
const*, void*) + 790
21 clang           0x000000000060adaa main + 3498
22 libc.so.6       0x00007fe23ac8476d __libc_start_main + 237
23 clang           0x0000000000605459
Stack dump:
0.      Program arguments: /home/bognej/local/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -disable-free -main-file-name ice.c
-mrelocation-model static -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -target-linker-version 2.22
-momit-leaf-frame-pointer -coverage-file /home/bognej/tmp/ice.o -resource-dir
/home/bognej/local/bin/../lib/clang/3.2 -fmodule-cache-path
/var/tmp/clang-module-cache -internal-isystem /usr/local/include
-internal-isystem /home/bognej/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 -O2
-fdebug-compilation-dir /home/bognej/tmp -ferror-limit 19 -fmessage-length 106
-mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics
-o ice.o -x c ice.c 
1.      <eof> parser at end of file
2.      Per-function optimization
3.      Running pass 'SROA' on function '@stomp_on_stack'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
clang version 3.2 (http://llvm.org/git/clang.git
befd16738b89241b794e5ebfd02d0511f7e39f90) (http://llvm.org/git/llvm.git
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: 

Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/ice-Hg1JSe.c
clang: note: diagnostic msg: /tmp/ice-Hg1JSe.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