https://gcc.gnu.org/bugzilla/show_bug.cgi?id=27214

--- Comment #14 from amker at gcc dot gnu.org ---
(In reply to Richard Biener from comment #13)
> The desired cleanup is to make POINTER_PLUS_EXPR take a signed offset
> argument,
> aka ssizetype instead of sizetype.
> 
> Bin was working on this at some point, so was I ...  Bin, can you paste the
> result (aka fallout) of your experiment(s)?

Yes, I tried this sometime ago, but never got a toolchain with regression tests
ICE free.  POINTER_PLUS_EXPR are used/constructed in too many places, I need to
identify each case.  As you pointed out, we basically treat sizetype offset as
ssizetype, in this point of view, there is no overflow/undefined issue, right? 
Changing to ssizetype complicates code, for example, when we compute difference
(in bytes) of pointers, we need to convert offset to sizetype again.

One advantage for using ssizetype I can think about is in computing range
information related to pointers?  In this case non-overflow behavior can be
used directly, rather than like pointer + sizetype_offset.

Note my original motivation is to better analyzing overflow-ness in scev, which
turned out not rely on pointer_plus_expr and fixed by independently.

Reply via email to