From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15896 invoked by alias); 4 May 2011 11:01:22 -0000 Received: (qmail 15884 invoked by uid 22791); 4 May 2011 11:01:21 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 May 2011 11:01:07 +0000 Received: by wye20 with SMTP id 20so869681wye.20 for ; Wed, 04 May 2011 04:01:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.98.9 with SMTP id o9mr1020894wbn.25.1304506866464; Wed, 04 May 2011 04:01:06 -0700 (PDT) Received: by 10.227.20.74 with HTTP; Wed, 4 May 2011 04:01:06 -0700 (PDT) In-Reply-To: <201105041200.29307.ebotcazou@adacore.com> References: <201105041200.29307.ebotcazou@adacore.com> Date: Wed, 04 May 2011 11:19:00 -0000 Message-ID: Subject: Re: [google]: initialize language field for clone function struct From: Richard Guenther To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org, Xinliang David Li , Jan Hubicka Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00276.txt.bz2 On Wed, May 4, 2011 at 12:00 PM, Eric Botcazou wrot= e: >> Umm, I think most of them (if not all) are just bogus. =A0If a FE doesn't >> want to fold some stuff when at global scope it should not call fold. > > That isn't so easy because fold is invoked on sizes of types by stor-layo= ut.c > and these sizes can be variable (at least in Ada). =A0So I think that the= calls > to the hook are still needed. =A0But: > =A01) The -1 thing should go and the hook return boolean. =A0The prerequi= site is > to tidy up variable_size, > =A02) I think that the GIMPLE hook can return 0 unconditionally. > >> But I'm not sure that is actually what it tries to do ... and the existi= ng >> checks are far from consistently spread out in fold-const.c ... > > It prevents save_expr from being called at global level, since you cannot > create SAVE_EXPRs outside functions. =A0Likewise in variable_size. I see several places in fold-const.c that are not properly guarded then. But anyway, if it is supposed to protect SAVE_EXPRs then I'd have expected save_expr to contain that check and possibly return NULL if it can't save. And I'm not sure you can't do SAVE_EXPRs outside of functions - you could simply emit global temporaries. Richard. > -- > Eric Botcazou >