From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25059 invoked by alias); 1 Sep 2004 06:22:45 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 25000 invoked from network); 1 Sep 2004 06:22:44 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 1 Sep 2004 06:22:44 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i816MiS0005993; Wed, 1 Sep 2004 02:22:44 -0400 Received: from [172.16.50.18] (vpn50-18.rdu.redhat.com [172.16.50.18]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i816Mh315068; Wed, 1 Sep 2004 02:22:43 -0400 Subject: Re: Question on cfg_remove_useless_stmts_bb From: Jeffrey A Law Reply-To: law@redhat.com To: Richard Kenner Cc: gcc@gcc.gnu.org In-Reply-To: <10408181142.AA16853@vlsi1.ultra.nyu.edu> References: <10408181142.AA16853@vlsi1.ultra.nyu.edu> Content-Type: text/plain Organization: Red Hat, Inc Message-Id: <1094019757.2907.286.camel@localhost.localdomain> Mime-Version: 1.0 Date: Wed, 01 Sep 2004 06:22:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2004-09/txt/msg00015.txt.bz2 On Wed, 2004-08-18 at 05:42, Richard Kenner wrote: > the fact that it wasn't obvious to you is a good indication that I > should have had more comments in that code. > > Actually, there's still some confusion there. Now that you've pointed it > out, from the way I read that code, VAL is always either a PARM_DECL or > a VAR_DECL. So why test !TREE_CONSTANT (val)? VAL can certainly be a constant. Consider if (a == 42) Which should match: if (TREE_CODE (cond) == EQ_EXPR && (TREE_CODE (TREE_OPERAND (cond, 0)) == VAR_DECL || TREE_CODE (TREE_OPERAND (cond, 0)) == PARM_DECL) && (TREE_CODE (TREE_OPERAND (cond, 1)) == VAR_DECL || TREE_CODE (TREE_OPERAND (cond, 1)) == PARM_DECL || TREE_CONSTANT (TREE_OPERAND (cond, 1)))) FWIW, this is one of the things that could likely go away if we don't translate trees out of SSA form -- this code exists merely to clean up trivial redundancies created by the out-of-ssa translation pass. Jeff