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

Tavian Barnes <tavianator at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tavianator at gmail dot com

--- Comment #61 from Tavian Barnes <tavianator at gmail dot com> ---
(In reply to rguent...@suse.de from comment #44)
> The other (unfortunate) thing is that in GCC pointer subtraction
> is always performed on integers, thus for the C source code
> 
>  int idx = ptr1 - ptr2;
> 
> we internally have sth like
> 
>  int idx = ((long)ptr1 - (long)ptr2) / 4;
> 
> so you can't really treat pointers as "escaped" here without loss.

It seems possible to distinguish between ptr-to-int casts that actually occur
in the source, from ptr-to-int casts that are generated for other reasons by
the compiler.

Reply via email to