From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15960 invoked by alias); 18 May 2011 07:26:39 -0000 Received: (qmail 15949 invoked by uid 22791); 18 May 2011 07:26:37 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 May 2011 07:26:21 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 29025) id C99CC9AC858; Wed, 18 May 2011 09:26:20 +0200 (CEST) Date: Wed, 18 May 2011 10:10:00 -0000 From: Zdenek Dvorak To: Tom de Vries Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH, PR45098, 3/10] Message-ID: <20110518072620.GA18720@kam.mff.cuni.cz> References: <4DD21F6E.4050308@codesourcery.com> <4DD220C1.7000405@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DD220C1.7000405@codesourcery.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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/msg01260.txt.bz2 Hi, > 2011-05-05 Tom de Vries > > PR target/45098 > * tree-ssa-loop-ivopts.c (computation_cost): Prevent cost of 0. this looks strange. Something like cost = seq_cost (seq, speed); if (MEM_P (rslt)) the current code; else cost += rtx_cost (rslt, SET, speed)); would make more sense to me (if I understand correctly what you are trying to achieve). Zdenek > Index: gcc/tree-ssa-loop-ivopts.c > =================================================================== > --- gcc/tree-ssa-loop-ivopts.c (revision 173380) > +++ gcc/tree-ssa-loop-ivopts.c (working copy) > @@ -2862,7 +2862,9 @@ computation_cost (tree expr, bool speed) > default_rtl_profile (); > node->frequency = real_frequency; > > - cost = seq_cost (seq, speed); > + cost = (seq != NULL_RTX > + ? seq_cost (seq, speed) > + : (unsigned)rtx_cost (rslt, SET, speed)); > if (MEM_P (rslt)) > cost += address_cost (XEXP (rslt, 0), TYPE_MODE (type), > TYPE_ADDR_SPACE (type), speed);