From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26986 invoked by alias); 30 Jun 2009 14:22:15 -0000 Received: (qmail 26971 invoked by uid 22791); 30 Jun 2009 14:22:14 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_50,J_CHICKENPOX_43,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-vw0-f194.google.com (HELO mail-vw0-f194.google.com) (209.85.212.194) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 30 Jun 2009 14:22:04 +0000 Received: by vwj32 with SMTP id 32so59130vwj.0 for ; Tue, 30 Jun 2009 07:22:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.99.144 with SMTP id u16mr4183759vcn.119.1246371721862; Tue, 30 Jun 2009 07:22:01 -0700 (PDT) In-Reply-To: <20090629135915.GA1654@cardhu.act-europe.fr> References: <20090629135915.GA1654@cardhu.act-europe.fr> Date: Tue, 30 Jun 2009 15:14:00 -0000 Message-ID: <303e1d290906300722p49fb56f2w87915994935a0b9b@mail.gmail.com> Subject: Re: BIGGEST_ALIGNMENT vs g++ compat test expectation on aix ? From: David Edelsohn To: Olivier Hainque Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00698.txt.bz2 On Mon, Jun 29, 2009 at 9:59 AM, Olivier Hainque wrote: > Working on a collect2 related patch resubmission for ppc-aix, I > stumbled on regressions in the c++ series for a problem unrelated to > my change. Not sure how you'd typically deal with these, so providing > the datapoints here. > > tmpdir-g++.dg-struct-layout-1/t027 and a couple of other tests failed > from constructs like > > =A0 =A0struct S2661 { > =A0 =A0 =A0 =A0union{v16sf b[31];Tal2short c __attribute__((aligned (4)))= ;}a; > =A0 =A0 =A0 =A0float d; > =A0 =A0}; > > =A0 =A0struct S2661 s2661; > =A0 =A0struct S2661 a2661[5]; > > =A0 =A0info.als =3D __alignof__ (s2661); > =A0 =A0if (&a2661[3] & (info.als - 1)) FAIL ... > > the alignment check is up to that of v16sf (64bytes), and this > occasionaly fails because csects are "only" aligned in accordance with > > =A0 rs6000.h:#define BIGGEST_ALIGNMENT 128 > > The discrepancy is visible straight from the assembly output > for e.g. t027_y (out of the unchanged compiler as well): > > =A0 =A0 =A0 =A0.csect .data[RW],4 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0^^^ > =A0 =A0 =A0 =A0.align 6 > =A0 =A0 =A0 =A0 =A0 =A0 =A0^^^ > a2661: > =A0 =A0 =A0 =A0.space 10240 The default alignment of CSECTs is 4, but using -fdata-sections should place the object in its own CSECT with stricter alignment. David