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

--- Comment #33 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #10)
> (In reply to Andrew Pinski from comment #9)
> > There is something off by this offset_ptr.
> 
> I am almost want to say this code is undefined; it is at least questionable.
> 
> From the looks of it, it does:
> 
> offset = (intptr_t)this - (intptr_t)array;
> 
> then array = offset + (intptr_t)this;
> 
> I am still trying to figure out if that is valid. I have not idea why boost
> even has this kind of thing.

I think this is OK, assuming array and offset are intptr_t and array is then
re-interpreted as pointer.

Reply via email to