Re: Sparse-LLVM issue compiling NULL pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 28, 2017 at 5:04 PM, Dibyendu Majumdar
<mobile@xxxxxxxxxxxxxxx> wrote:
> Hi Luc,
>
> On 28 February 2017 at 15:09, Luc Van Oostenryck
> <luc.vanoostenryck@xxxxxxxxx> wrote:
>> On Tue, Feb 28, 2017 at 06:20:43AM +0000, Dibyendu Majumdar wrote:
>>> I am trying to debug a failure in sparse-llvm when compiling following:
>>>
>>> struct mytype {
>>>  int *foo;
>>> };
>>> extern void init_mytype(struct mytype *mt);
>>> void init_mytype(struct mytype *mt) {
>>>  mt->foo = (void *)0;
>>> }
>>>
>>
>> I think that the best you can do for us to be able to help you is to create
>> test case showing concretely the issues you have.
>>
>
> Above is a simple test case. If you use an LLVM build with assertions
> enabled then the code generator aborts:
>
> Assertion failed: getOperand(0)->getType() ==
> cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr
> must be a pointer to Val type!", file
> C:\d\llvm-3.9.0.src\lib\IR\Instructions.cpp, line 1436

I had hoped that "sparse-llvm file.c | llvm-dis" would give a bit more info
but well ...

> In the details I posted I was trying to say that :
>
> a) The Expression Value does not appear to pass down the fact that it
> has found a NULL pointer - i.e. (void *)0.
> b) And even if this is conveyed (by making changes I suggested) then
> it is lost at the time of converting to value pseudo. As far as I can
> tell the cast is not being optimized away, it is just lost in
> translation.

OK. It would certainly be a good thing to show/look at the output of
test-linearize together with the C code and any info coming from
sparse-llvm (and llvm-dis) since this output is the readable form
of sparse-llvm's input.


Luc
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux