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

--- Comment #9 from mikulas at artax dot karlin.mff.cuni.cz ---
> See what I wrote, any object size bigger than half of address space really
> isn't supportable, because then (char *) (P) - (char *) (Q) might not fit into
> ptrdiff_t.  There is no point slowing down all pointer subtractions (other 
> than
> char/signed char/unsigned char pointers) for something that really wouldn't
> work reliably anyway.

But the code in comment 4 doesn't perform (char *)P - (char *)Q. It performs
(short *)P - (short *)Q. And that result clearly fits into the signed ptrdiff_t
type.

If the code in comment 4 performed (char *)b - (char *)a, that operation would
be invalid because of overflow. But it doesn't.

Reply via email to