[LLVMbugs] [Bug 4612] New: Assert failure: getConstant with a uint64_t value that doesn't fit in the type!

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jul 23 10:05:52 PDT 2009


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

           Summary: Assert failure: getConstant with a uint64_t value that
                    doesn't fit in the type!
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: docmach+llvm at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3236)
 --> (http://llvm.org/bugs/attachment.cgi?id=3236)
Code to reproduce bug

When compiling the attached code with -O3 the compilation fails.  It succeeds
if no optimization flags are used.

main.c:5:24: warning: implicitly declaring C library function 'malloc' with
type
      'void *(unsigned long)'
    int * largeArray = malloc(largeSize*sizeof(int));
                       ^
main.c:5:24: note: please include the header <stdlib.h> or explicitly provide a
      declaration for 'malloc'
clang-cc: SelectionDAG.cpp:872: llvm::SDValue
llvm::SelectionDAG::getConstant(uint64_t, llvm::MVT, bool): Assertion
`(EltVT.getSizeInBits() >= 64 || (uint64_t)((int64_t)Val >>
EltVT.getSizeInBits()) + 1 < 2) && "getConstant with a uint64_t value that
doesn't fit in the type!"' failed.
0   clang-cc        0x00000000011bdc7f
1   clang-cc        0x00000000011be069
2   libpthread.so.0 0x00007fe5e4aa5a10
3   libc.so.6       0x00007fe5e3dca205 gsignal + 53
4   libc.so.6       0x00007fe5e3dcb723 abort + 387
5   libc.so.6       0x00007fe5e3dc3229 __assert_fail + 233
6   clang-cc        0x0000000000d94e2b
7   clang-cc        0x0000000000db31bd
8   clang-cc        0x0000000000dd944c
9   clang-cc        0x0000000000dd9841
10  clang-cc        0x0000000000ddb5ef
11  clang-cc        0x00000000011529ea
12  clang-cc        0x0000000001152bf6
13  clang-cc        0x0000000001152e60
14  clang-cc        0x000000000044ba1d
15  clang-cc        0x000000000044c1c7
16  clang-cc        0x000000000063457d
17  clang-cc        0x0000000000431209
18  clang-cc        0x000000000043a1d2 main + 5506
19  libc.so.6       0x00007fe5e3db65c6 __libc_start_main + 230
20  clang-cc        0x000000000042ee29
Stack dump:
0.      Program arguments: /opt/src/llvm/Release/bin/clang-cc -triple
x86_64-unknown-linux-gnu -S -disable-free -main-file-name main.c
--relocation-model static --disable-fp-elim --unwind-tables=1 --mcpu=x86-64
--fmath-errno=1 -O3 -fdiagnostics-show-option -o /tmp/cc-UKxix3.s -x c main.c 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@main'
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)

This is with llvm r76880 and clang r76881


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