http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-01-07 10:21:44 UTC --- (In reply to comment #7) > (In reply to comment #6) > > > __attribute__((aligned(16))) float array[4]; > > > > Explicitly says the array is aligned to 16 bytes which means it is > > undefined by > > the C/C++ standard what happens if you a pointer to the struct which > > contains > > this array. As this pointer will always be aligned by definition of the > > struct > > (and any other use of it is undefined), then by definition > > std::ptrdiff_t(array) will always have the lower 8bits be zero. > > So does that mean that new and std::allocator act undefined for aligned > objects? > Is there anything wrong with Gael's second test case? It is rather a bug in libstdc++ which should be reported separately though it needs an ABI change to work correctly.