From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13304 invoked by alias); 18 Oct 2004 15:14:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 13266 invoked from network); 18 Oct 2004 15:14:18 -0000 Received: from unknown (HELO dberlin.org) (68.164.203.246) by sourceware.org with SMTP; 18 Oct 2004 15:14:18 -0000 Received: from [129.34.20.23] (HELO [9.2.217.169]) by dberlin.org (CommuniGate Pro SMTP 4.2.1) with ESMTP id 7398359; Mon, 18 Oct 2004 11:14:18 -0400 In-Reply-To: <10410181452.AA03986@vlsi1.ultra.nyu.edu> References: <10410181452.AA03986@vlsi1.ultra.nyu.edu> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <6167E63A-2118-11D9-B44B-000D93B1B044@dberlin.org> Content-Transfer-Encoding: 7bit Cc: gcc-patches@gcc.gnu.org From: Daniel Berlin Subject: Re: [patch] for PR 18040 Date: Mon, 18 Oct 2004 15:20:00 -0000 To: kenner@vlsi1.ultra.nyu.edu (Richard Kenner) X-SW-Source: 2004-10/txt/msg01486.txt.bz2 On Oct 18, 2004, at 10:52 AM, Richard Kenner wrote: > A quick check of a random function handling component_refs shows > they > will also be missing optimizations > > Let me be very clear here: > > If the nops aren't needed, they won't be there. So the question isn't > if they are needed or not. Rather, it's whether the expression should > be > split up among statements. > > Are you really arguing that it's more likely to miss optimizations if > they > are in *one* statement than if they are in multiple statements? Yes. > If so, > can you explain? > It is much easier to optimize expressions that are simple, regardless of how they are split up, because it makes your optimizers simpler to write, and you are much less likely to miss corner cases, etc. There is no magic problem with a statement being split up into multiple statements, because that's just not how algorithms to do optimization are written. From the POV, of say, CCP, it doesn't care about the difference between a = 10 b = 20 c = a + b return c; and c = 10 + 20 return c; or even about the difference between return 10 + 20; and a = 5 b = a + 2 c = b + 2 d = c + 1 e = 10 f = e + 5 g = f + 5 h = d + g return h; Both are just as easy to optimize. --Dan