From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1238 invoked by alias); 17 Oct 2004 17:20:13 -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 1231 invoked from network); 17 Oct 2004 17:20:12 -0000 Received: from unknown (HELO mail.cs.umass.edu) (128.119.243.168) by sourceware.org with SMTP; 17 Oct 2004 17:20:12 -0000 Received: from localhost (IDENT:W6vI+1/0Endm3rYNmNylCwP6nprHy+uM@loki.cs.umass.edu [128.119.243.168]) by mail.cs.umass.edu (8.12.11/8.12.5) with ESMTP id i9HHK8Fn030755 for ; Sun, 17 Oct 2004 13:20:10 -0400 Date: Sun, 17 Oct 2004 17:23:00 -0000 Message-Id: <20041017.131951.31447437.kazu@cs.umass.edu> To: gcc-patches@gcc.gnu.org Subject: Re: [patch] expr.c: Remove an obsolete comment. From: Kazu Hirata In-Reply-To: <20041017.120318.102577353.kazu@cs.umass.edu> References: <20041017.120318.102577353.kazu@cs.umass.edu> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg01386.txt.bz2 Hi, > - /* If lhs is complex, expand calls in rhs before computing it. > - That's so we don't compute a pointer and save it over a > - call. If lhs is simple, compute it first so we can give it > - as a target if the rhs is just a call. This avoids an > - extra temp and copy and that prevents a partial-subsumption > - which makes bad code. Actually we could treat > - component_ref's of vars like vars. */ > - This comment seems to be for the time when we still had preexpand_calls, which was removed by Mark Mitchell. http://gcc.gnu.org/ml/gcc-bugs/2000-10/msg00471.html Until then, the code used to look like /* If lhs is complex, expand calls in rhs before computing it. That's so we don't compute a pointer and save it over a call. If lhs is simple, compute it first so we can give it as a target if the rhs is just a call. This avoids an extra temp and copy and that prevents a partial-subsumption which makes bad code. Actually we could treat component_ref's of vars like vars. */ tree lhs = TREE_OPERAND (exp, 0); tree rhs = TREE_OPERAND (exp, 1); tree noncopied_parts = 0; tree lhs_type = TREE_TYPE (lhs); temp = 0; if (TREE_CODE (lhs) != VAR_DECL && TREE_CODE (lhs) != RESULT_DECL && TREE_CODE (lhs) != PARM_DECL && ! (TREE_CODE (lhs) == INDIRECT_REF && TYPE_READONLY (TREE_TYPE (TREE_OPERAND (lhs, 0))))) preexpand_calls (exp); where the comment makes sense. I committed my patch as obvious. Kazu Hirata