From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29222 invoked by alias); 24 Jun 2009 04:18:46 -0000 Received: (qmail 29213 invoked by uid 22791); 24 Jun 2009 04:18:45 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 X-Spam-Check-By: sourceware.org Received: from mta5.srv.hcvlny.cv.net (HELO mta5.srv.hcvlny.cv.net) (167.206.4.200) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 24 Jun 2009 04:18:39 +0000 Received: from [192.168.1.10] (ool-44c60ac6.dyn.optonline.net [68.198.10.198]) by mta5.srv.hcvlny.cv.net (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTP id <0KLQ00J8H6N1T1S0@mta5.srv.hcvlny.cv.net> for gcc@gcc.gnu.org; Wed, 24 Jun 2009 00:18:37 -0400 (EDT) Date: Wed, 24 Jun 2009 05:41:00 -0000 From: Jerry Quinn Subject: Re: Basic frontend question about layout In-reply-to: To: Andrew Pinski Cc: "gcc@gcc.gnu.org" Message-id: <1245817116.4098.29.camel@cerberus.qb5.org> MIME-version: 1.0 Content-type: text/plain Content-transfer-encoding: 7BIT References: <1245815328.4098.13.camel@cerberus.qb5.org> 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/msg00554.txt.bz2 On Tue, 2009-06-23 at 20:52 -0700, Andrew Pinski wrote: > On Tue, Jun 23, 2009 at 8:48 PM, Jerry Quinn wrote: > > Hi, folks, > > > > I'm having trouble seeing how layout is specified at the GENERIC level > > for RECORD_TYPEs. The docs and comments in tree.def say that you cannot > > rely on the order of fields of the type. In stor-layout.c, > > layout_types() seems to do the obvious thing, taking the fields in > > order, but the docs make it sound like there is no way to be sure what > > you'll get. > > Could someone please clear up my confusion? > > The confusion here is that layout_types is separate from the rest of > the middle-end and the front-end could do the layout themselves and > the front-end calls layout_type if it does not do the layout itself. As I look at the code, it seems like a front end doesn't actually need to call layout_type at all. Is that correct? If so, is the layout C-compatible, assuming the field types being used are individually compatible? I'm gleaning this from a mix of code, comments, and gccint texinfo docs. Would it make sense to update them to indicate that layout is in order as long as the rest of the language-specific front end doesn't choose to lay things out differently? Thanks, Jerry