[LLVMdev] Assert with getZExtValue()?
Ryan Taylor
ryta1203 at gmail.com
Mon Dec 3 10:52:20 PST 2012
So the problem here was trying to return MIN_VALUE zero extended, if I
return sign extended than this issue is resolved; however, I still get an
error with getSExtValue when trying to get the value of the const from
Instruction: %mask166 = and i128 %lvar_ins176, -18446462598732840961
On Fri, Nov 16, 2012 at 3:17 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> Eli,
>
> Thanks for responding. Yes, I read the error message but it seems odd
> that it would be trying to use more than 64 bits. It compiles and executes
> in gcc on 32 bit arch just fine. I'll probably take your suggestion and
> file a bug with a reduced testcase.
>
> Thanks again,
>
> Ryan
>
>
> On Fri, Nov 16, 2012 at 3:10 PM, Eli Friedman <eli.friedman at gmail.com>wrote:
>
>> On Fri, Nov 16, 2012 at 3:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
>> > Was hoping it might get some help or a better explanation of this:
>> >
>> > /ADT/APInt.h:1217: uint64_t llvm::APInt::getZExtValue() const: Assertion
>> > `getActiveBits() <= 64 && "Too many bits for uint64_t"' failed.
>>
>> The error message is exactly what it says: you're trying to call
>> getZExtValue() on an APInt whose value doesn't fit into a uint64_t.
>>
>> > Program received signal SIGABRT, Aborted.
>> > 0x00007ffff6eb4d05 in raise (sig=6) at
>> > ../nptl/sysdeps/unix/sysv/linux/raise.c:64
>> > 64 ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or
>> directory.
>> > in ../nptl/sysdeps/unix/sysv/linux/raise.c
>> > (gdb) bt
>> > #0 0x00007ffff6eb4d05 in raise (sig=6) at
>> > ../nptl/sysdeps/unix/sysv/linux/raise.c:64
>> > #1 0x00007ffff6eb8ab6 in abort () at abort.c:92
>> > #2 0x00007ffff6ead7c5 in __assert_fail (
>> > assertion=0x7ffff6c7c907 "getActiveBits() <= 64 && \"Too many bits
>> for
>> > uint64_t\"",
>> > file=<value optimized out>, line=1217, function=<value optimized
>> out>)
>> > at assert.c:81
>> > #3 0x00007ffff6c6c5cf in getZExtValue (this=<value optimized out>)
>> > at /home/ryan/llvm/llvm_core/trunk/include/llvm/ADT/APInt.h:1217
>> > #4 getZExtValue (this=<value optimized out>)
>> > at /home/ryan/llvm/llvm_core/trunk/include/llvm/Constants.h:117
>> > #5 cdfgPassClass::storeInstr (this=<value optimized out>) at
>> > a2c_pass.cpp:2125
>> > #6 0x00007ffff6c73dc1 in (anonymous namespace)::CDFGPass::runOnModule
>> > (this=0x16c2fa0,
>> > M=<value optimized out>) at a2c_pass.cpp:2949
>> > #7 0x0000000000f4cd4e in
>> llvm::MPPassManager::runOnModule(llvm::Module&) ()
>> > #8 0x0000000000f4d813 in llvm::PassManagerImpl::run(llvm::Module&) ()
>> > #9 0x0000000000f4d94a in llvm::PassManager::run(llvm::Module&) ()
>> > #10 0x0000000000525509 in main ()
>> >
>> > Also, why does it give <value optimized out>, when I print the value I
>> > clearly get one, unless this is some result of const prop?
>>
>> No clue how gdb decides these things. If you file a bug with a
>> reduced testcase, someone might find the answer.
>>
>> -Eli
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121203/a0a4c01c/attachment.html>
More information about the llvm-dev
mailing list