From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27884 invoked by alias); 7 Jan 2013 04:27:18 -0000 Received: (qmail 26733 invoked by uid 48); 7 Jan 2013 04:25:56 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53900] [regression] Too optimistic on a alignment assert Date: Mon, 07 Jan 2013 04:27: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: pinskia at gcc dot gnu.org 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/msg00434.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900 --- Comment #6 from Andrew Pinski 2013-01-07 04:25:38 UTC --- > __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.