From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5472 invoked by alias); 22 Apr 2003 16:19:37 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5465 invoked from network); 22 Apr 2003 16:19:37 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 22 Apr 2003 16:19:37 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h3MGJaD00830 for ; Tue, 22 Apr 2003 12:19:36 -0400 Received: from redhat.com (IDENT:iZuqVbasSTzI1XScJeSZQhVskOCcrPdF@vpn50-32.rdu.redhat.com [172.16.50.32]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h3MGJaq10173 for ; Tue, 22 Apr 2003 12:19:36 -0400 Received: (from aph@localhost) by redhat.com (8.11.6/8.11.0) id h3MGJU115383; Tue, 22 Apr 2003 17:19:30 +0100 From: Andrew Haley MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16037.27536.768942.704796@cuddles.redhat.com> Date: Tue, 22 Apr 2003 17:17:00 -0000 To: Jason Merrill Cc: gcc@gcc.gnu.org Subject: Re: On alignment In-Reply-To: References: <20030422110729.071B7F2CB7@nile.gnat.com> <16037.14231.913810.357203@cuddles.redhat.com> X-SW-Source: 2003-04/txt/msg01070.txt.bz2 Jason Merrill writes: > On Tue, 22 Apr 2003 13:37:43 +0100, Andrew Haley wrote: > > > Robert Dewar writes: > > > > That packing rule is part of the i86 psABI > > > > > > It's still mighty odd, and of course in Ada you have to override this rule > > > since it conflicts with the Ada standard, which requires that the default > > > minimum alignment of a composite be not less than the alignment of any > > > component. > > > > It's pretty weird in C++. > > It's the same in C. Weird or not, that's what the SVR4 psABI says, so > that's what we do. It's rather scary. It means, for example, that template void copy (T *a, T *b) { if (__alignof__ (T) >= 8) copy_by_dwords (a, b); else copy_by_bytes (a, b); } won't do what is expected when applied to a member of a struct. I suppose we get away with this because the x86 never generates alignment traps in such cases. Andrew.