From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4549 invoked by alias); 26 Jul 2005 05:57:01 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 4517 invoked by uid 22791); 26 Jul 2005 05:56:56 -0000 Received: from nondot.cs.uiuc.edu (HELO nondot.org) (128.174.245.159) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 26 Jul 2005 05:56:56 +0000 Received: by nondot.org (Postfix, from userid 501) id 8620D1037EF; Tue, 26 Jul 2005 00:53:20 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by nondot.org (Postfix) with ESMTP id 7CCDB1077C4; Tue, 26 Jul 2005 00:53:20 -0500 (CDT) Date: Tue, 26 Jul 2005 05:57:00 -0000 From: Chris Lattner To: Ian Lance Taylor Cc: gcc-help@gcc.gnu.org Subject: Re: attribute aligned(4) ignored In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-SW-Source: 2005-07/txt/msg00278.txt.bz2 On Tue, 25 Jul 2005, Ian Lance Taylor wrote: >> ... the struct maintains its 8-byte alignment even though nothing >> inside of it requires 8-byte alignment any more. > > When I try that with a powerpc-eabi compiler, it appears to generates > a struct with a size of 12 bytes and an alignment of 4 bytes. Do you > not see that with a Darwin compiler? What target are you configuring > for? What sources are you using? This is a powerpc-darwin specific issue I believe. The Darwin ABI states (roughly) that doubles have 4-byte alignment, unless they are the first element of a structure (in which they have 8-byte alignment). I think this is a holdover from AIX compatibility. It is my guess that this ABI rule is overruling the user request, but I don't really know how to go about verifying this, or working around it :( -Chris -- http://nondot.org/sabre/ http://llvm.org/