From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18721 invoked by alias); 14 Apr 2011 15:48:28 -0000 Received: (qmail 18710 invoked by uid 22791); 14 Apr 2011 15:48:27 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Apr 2011 15:48:21 +0000 Received: by qyk35 with SMTP id 35so3742589qyk.20 for ; Thu, 14 Apr 2011 08:48:20 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.29.5 with SMTP id o5mr665431qcc.141.1302796100024; Thu, 14 Apr 2011 08:48:20 -0700 (PDT) Received: by 10.229.190.140 with HTTP; Thu, 14 Apr 2011 08:48:19 -0700 (PDT) In-Reply-To: References: <20110414133453.GA18805@intel.com> Date: Thu, 14 Apr 2011 15:48:00 -0000 Message-ID: Subject: Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost From: "H.J. Lu" To: Michael Matz Cc: Richard Guenther , GCC Patches Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg01093.txt.bz2 On Thu, Apr 14, 2011 at 8:26 AM, Michael Matz wrote: > Hi, > > On Thu, 14 Apr 2011, Richard Guenther wrote: > >> > + =A0if (align > DECL_ALIGN (decl)) >> > + =A0 =A0DECL_ALIGN (decl) =3D align; >> >> Shouldn't this unconditionally set DECL_ALIGN in case >> LOCAL_DECL_ALINGMENT returns something smaller? > > Decreasing alignment of DECLs points to a problem elsewhere, so perhaps an > assert that this doesn't happen is better. =A0Decreasing is a problem > because it's not conservative: there might have been code generated > already assuming the once larger alignment that then possibly breaks if it > turns out the alignment is actually smaller. ia32 may decrease local variable alignment: /* Don't do dynamic stack realignment for long long objects with -mpreferred-stack-boundary=3D2. */ if (!TARGET_64BIT && align =3D=3D 64 && ix86_preferred_stack_boundary < 64 && (mode =3D=3D DImode || (type && TYPE_MODE (type) =3D=3D DImode)) && (!type || !TYPE_USER_ALIGN (type)) && (!decl || !DECL_USER_ALIGN (decl))) align =3D 32; I am running bootstrap/test on Linux/x86-64 and Linux/ia32. --=20 H.J.