From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23194 invoked by alias); 25 Mar 2003 09:26:53 -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 23177 invoked from network); 25 Mar 2003 09:26:51 -0000 Received: from unknown (HELO cuddles.cambridge.redhat.com) (81.96.64.123) by sources.redhat.com with SMTP; 25 Mar 2003 09:26:51 -0000 Received: (from aph@localhost) by cuddles.cambridge.redhat.com (8.11.6/8.11.0) id h2P9QY216673; Tue, 25 Mar 2003 09:26:34 GMT From: Andrew Haley MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16000.8394.609107.387355@cuddles.cambridge.redhat.com> Date: Tue, 25 Mar 2003 10:16:00 -0000 To: Jason Merrill Cc: Michael Matz , , Jakub Jelinek Subject: Re: On alignment In-Reply-To: References: <15995.12035.664047.457709@cuddles.cambridge.redhat.com> <15996.10496.282670.431066@cuddles.cambridge.redhat.com> X-SW-Source: 2003-03/txt/msg01515.txt.bz2 Jason Merrill writes: > On Sat, 22 Mar 2003 09:12:32 +0000 (GMT), Andrew Haley wrote: > > > Jason Merrill writes: > > > Can you give me an example of a case that needs an aligned attribute? What > > > is the Java frontend doing that makes this necessary? > > > > http://gcc.gnu.org/ml/gcc-patches/2003-03/msg00429.html > > OK, you're trying to suppress the tail padding optimization. It occurred > to me that another way to express that could be > > struct B : A { > // force normal alignment > char : 0 __attribute ((__aligned (__alignof (A)))); > short bs; > }; > > but of course that doesn't work properly either; user-specified > alignment is currently ignored on a zero-length bitfield. But > that's a one-line fix, and shouldn't create a compatibility > problem, since there would have been no point in specifying such an > alignment before. Would that work for you? Excellent. That's all I need. Andrew.