From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22897 invoked by alias); 22 Apr 2003 10:59:47 -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 22889 invoked from network); 22 Apr 2003 10:59:46 -0000 Received: from unknown (HELO Cantor.suse.de) (213.95.15.193) by sources.redhat.com with SMTP; 22 Apr 2003 10:59:46 -0000 Received: from Hermes.suse.de (Hermes.suse.de [213.95.15.136]) by Cantor.suse.de (Postfix) with ESMTP id 6245C14665; Tue, 22 Apr 2003 12:59:46 +0200 (MEST) To: Andrew Haley Cc: Jason Merrill , gcc@gcc.gnu.org Subject: Re: On alignment X-Yow: Somewhere in suburban Honolulu, an unemployed bellhop is whipping up a batch of illegal psilocybin chop suey!! From: Andreas Schwab Date: Tue, 22 Apr 2003 13:15:00 -0000 In-Reply-To: <16037.6826.35777.756256@cuddles.redhat.com> (Andrew Haley's message of "Tue, 22 Apr 2003 11:34:18 +0100") Message-ID: User-Agent: Gnus/5.090018 (Oort Gnus v0.18) Emacs/21.3.50 (gnu/linux) References: <200303251122.13693.kevin.hendricks@sympatico.ca> <200303251344.59988.kevin.hendricks@sympatico.ca> <16037.6826.35777.756256@cuddles.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2003-04/txt/msg01054.txt.bz2 Andrew Haley writes: |> WHat I still cannot understand is why a struct that contains a double |> is 4-aligned on x86, but a double is 8-aligned. This means that you |> cannot infer the alignment of a struct from the alignment of its |> members. Is this really part of the multi-vendor ABI? The alignment of a struct member determines the amount of padding that must be inserted, thus it is important to maintain the exact alignment requirements of the ABI. For simple variables there is no such requirement, there is never a problem when a standalone variable is overaligned. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."