Re: [PATCH] fix dominance testing of mixed types

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

 



On Sun, Mar 18, 2018 at 6:55 AM, Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
> The function dominates() is used to test the dominance of
> one instruction over another one. To do this different things
> need to be checked, like:
> - same symbol or not
> - same address & same offset
> - partial overlapping
>
> One case is not covered though: when type cohercion is done
> via a pointer to an union (IOW when a memory location is used
> to store one type and is then read back as another type).
> For example, the location is first stored as a float and then is
> read back as an integer of the same size. Currently, sparse
> will consider that the store effectively dominates the load
> which will then allow to simplify away the load and use the
> pseudo holding the float value for the expected integer.
>
> There is surely several ways to fix this problem.
> The solution used in this patch is to check if both instructions
> are of of the same floating-pointness.
>
> Note: this solution is probably incomplete. For example, what
>       about compound types?

Thanks for the patch. The test case is definitly good to have.
The solution looks likely work for your test case.

The more general topic is pointer alias analyse.

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