From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13637 invoked by alias); 31 Mar 2011 07:14:24 -0000 Received: (qmail 13617 invoked by uid 22791); 31 Mar 2011 07:14:23 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-px0-f176.google.com (HELO mail-px0-f176.google.com) (209.85.212.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Mar 2011 07:14:18 +0000 Received: by pxi11 with SMTP id 11so410243pxi.21 for ; Thu, 31 Mar 2011 00:14:17 -0700 (PDT) Received: by 10.143.26.19 with SMTP id d19mr1657023wfj.131.1301555657779; Thu, 31 Mar 2011 00:14:17 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-210-217.ip51.fastwebnet.it [93.34.210.217]) by mx.google.com with ESMTPS id p40sm1137260wfc.5.2011.03.31.00.14.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 31 Mar 2011 00:14:16 -0700 (PDT) Message-ID: <4D9429C4.4040409@gnu.org> Date: Thu, 31 Mar 2011 08:13:00 -0000 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: Michael Matz CC: gcc-patches@gcc.gnu.org Subject: Re: Random cleanups [2/4]: canonicalize ctor values References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-03/txt/msg02146.txt.bz2 On 03/31/2011 03:22 AM, Michael Matz wrote: > this came up when looking into why the static ctors contain useless trees > (like casts). We can simply canonicalize them while varpool analyzes > pending decls. It'll look at initialzers once, where we can "gimplify" > them. This requires making canonicalize_constructor_val be able to be > called outside of functions. And it requires the java frontend not > leaving a dangling function decl as current (for the static ctor function > it generates). canonicalize_constructor_val may be doing useful things on ADDR_EXPR too, but you don't call it in that case because you only added your code in the default case. You only reach it when the ADDR_EXPR is wrapped in a cast. Any reason why you didn't add it (possibly wrapped in a loop) _before_ the switch statement? Paolo