From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19923 invoked by alias); 3 May 2011 19:27:41 -0000 Received: (qmail 19914 invoked by uid 22791); 3 May 2011 19:27:40 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 May 2011 19:27:26 +0000 Received: (qmail 28348 invoked from network); 3 May 2011 19:27:25 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 May 2011 19:27:25 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1QHLFk-0003Gi-F6; Tue, 03 May 2011 19:27:24 +0000 Date: Tue, 03 May 2011 19:51:00 -0000 From: "Joseph S. Myers" To: Nathan Froyd cc: Eric Botcazou , Jan Hubicka , gcc-patches@gcc.gnu.org, Xinliang David Li Subject: Re: [google]: initialize language field for clone function struct In-Reply-To: <20110503191043.GC23480@codesourcery.com> Message-ID: References: <20110503164614.GB18705@kam.mff.cuni.cz> <201105032034.51751.ebotcazou@adacore.com> <20110503191043.GC23480@codesourcery.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00216.txt.bz2 On Tue, 3 May 2011, Nathan Froyd wrote: > On Tue, May 03, 2011 at 07:06:58PM +0000, Joseph S. Myers wrote: > > In my view we should require front ends to take responsibility for > > variable-size types, and get rid of this language-independent function > > (copying such parts as are needed into the front ends that need them). C > > for example uses its own version as the language-independent one isn't > > right for C. Similarly, the pending_size code should be local to front > > ends. > > The raft of changes/improvements enabled by this change would be most > welcome. *_SIZE becoming double_ints or HOST_WIDE_INT instead of trees > is the first thing that comes to mind; perhaps there are others. I don't see how you can do that; you'll still have variable-sized types and objects, it would just be entirely the front end's responsibility to ensure that the size expression is evaluated exactly once (whenever required by the language). At most, the size would either be a constant or an internal DECL created by the front end if you move that to the front end instead of using SAVE_EXPR. However, I think the fields storing type and decl sizes (and alignment) in *bits* are suspect. Values in bits are needed when dealing with bit-field layout, but I think types should otherwise be defined to be made up of whole bytes (bytes of BITS_PER_UNIT bits, at this level) with code dealing with bit-fields looking at TYPE_PRECISION as needed. -- Joseph S. Myers joseph@codesourcery.com