Re: sparse-llvm functions must be cast to correct type before calling

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

 



On Thu, Mar 16, 2017 at 08:58:25PM +0000, Dibyendu Majumdar wrote:
> Hi,
> 
> The following test (adapted from snippet posted by Linus) fails in sparse-llvm:

...
 
> To resolve this before calling a function we need to cast it to the
> expected type. This can be done like this in output_op_call():

This is a very general problem with sparse-llvm, directly caused
by the fact the sparse associates type to instructions and LLVM
to the values.

What's happening is that the first time a pseudo is used
it's a value is created (with the curret type, of course)
*and* is stored in the pseudo::priv.
The next times this pseudo is used the LLVM value is directly
taken from the ::priv without regards for the current type.

In the coming update of the LLVM serie, I added an helper
for this sort of things: adjust_type(). But it need to be
added at the right place(s).

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