From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29231 invoked by alias); 2 Aug 2013 15:54:24 -0000 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 Received: (qmail 29125 invoked by uid 48); 2 Aug 2013 15:54:21 -0000 From: "ebotcazou at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/58041] Unaligned access to arrays in packed structure Date: Fri, 02 Aug 2013 15:54:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ebotcazou at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: wschmidt at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-08/txt/msg00137.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58041 Eric Botcazou changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.org --- Comment #22 from Eric Botcazou --- > After thinking it over some more, I think you are right, Martin. We should > go ahead with the optimization with the corrected alignment attached to the > type. Please go ahead with your patch. I will run a round of regression > testing on PowerPC (an architecture for which the generic test produces > misaligned but legal memory references) as well. > > Sorry for going back and forth on this. I try to avoid wasting compile time > on useless transformations, but in this case we will still see some benefit > in some cases, and the code should be no worse than before when we don't. We should be very wary of generating unaligned accesses during optimization for targets that define SLOW_UNALIGNED_ACCESS. And note that most architectures supported by GCC are STRICT_ALIGNMENT, not the other way around, so it's the common case.