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

--- Comment #11 from Andrew Pinski <pinskia 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.

According to their pages it is designed for IPC/shared memory but I am not 100%
sure if the offsets are correct.

Also it depends on the size of Foo being 12 which is causing the issue.  Either
exact division is going wrong or there is an alignment which is causing the
offset with the exact division going wrong. I am suspecting to the later.

Reply via email to