On Fri, Aug 03, 2018 at 01:19:14AM -0600, Jeff Law wrote:
> I'm leaning towards a similar conclusion, namely that we can only rely
> on type information for the pointer that actually gets passed to strlen,
> which 99.9% of the time is (char *), potentially with const qualifiers.

You can't derive anything from the pointer type of the strlen argument,
because pointer conversions are useless in the middle-end, so if there was
some conversion at some point, it might be gone, or you might get there a
completely different pointer type of something that happened to have the
same value.  That is why the information, if it matters, needs to be stored
elsewhere, on the memory access (MEM_REF has such info, TARGET_MEM_REF too,
handled_component_p do too).

        Jakub

Reply via email to