https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113662
--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> --- So I think the way offset_type is used here is incorrect. boost::interprocess::offset_ptr<T> allocate( std::size_t n ) { return boost::interprocess::offset_ptr<T>(a.allocate(n)); } That stores the offset from the stack object to the allocated memory. That is wrong. I am suspecting there is still some oddness going on because we optimize exact divide better now.