This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53900] [regression] Too optimistic on a alignment assert
- From: "chtz at informatik dot uni-bremen.de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 07 Jan 2013 10:19:13 +0000
- Subject: [Bug c++/53900] [regression] Too optimistic on a alignment assert
- Auto-submitted: auto-generated
- References: <bug-53900-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900
--- Comment #7 from Christoph Hertzberg <chtz at informatik dot uni-bremen.de> 2013-01-07 10:19:13 UTC ---
(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?