On Wed, 22 Jan 2020, Joseph Myers wrote: > On Tue, 21 Jan 2020, Richard Biener wrote: > > > Second. Fact is RTL does not distinguish between pointers and > > integers and thus any attempt to make something valid when you > > use integers and invalid when you use pointers is not going to work. > > That simply means that an earlier stage in the compiler would need to mark > cases of integers converted from pointers in some way as "could have > provenance of any address-exposed object" (that being the effect of > PNVI-ae models) unless it can prove the offsets etc. applied do keep the > pointer within the original object.
We already have that, it's called points-to analysis which computes "points-to sets" even for integers. But even there it assumes you can't leave an object via arithmetic, doing that would be quite bad for optimization in the current state or prohibitly expensive since it would require exact offset tracking. Now invent something that transfers this to RTL. Patches to the main piece where the issue triggers (find_base_term + base_alias_check and the very similar find_base_value) welcome. Richard.