From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14446 invoked by alias); 7 Jan 2013 10:19:40 -0000 Received: (qmail 14341 invoked by uid 48); 7 Jan 2013 10:19:17 -0000 From: "chtz at informatik dot uni-bremen.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53900] [regression] Too optimistic on a alignment assert Date: Mon, 07 Jan 2013 10:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chtz at informatik dot uni-bremen.de X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg00461.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900 --- Comment #7 from Christoph Hertzberg 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?