From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13550 invoked by alias); 6 Nov 2002 22:55:03 -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 13530 invoked from network); 6 Nov 2002 22:55:03 -0000 Received: from unknown (HELO mx2.redhat.com) (12.150.115.133) by sources.redhat.com with SMTP; 6 Nov 2002 22:55:03 -0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.11.6/8.11.6) with ESMTP id gA6MrRP26818; Wed, 6 Nov 2002 17:53:27 -0500 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id gA6Mstl29756; Wed, 6 Nov 2002 17:54:55 -0500 Received: from localhost.localdomain (frothingslosh.sfbay.redhat.com [172.16.24.27]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id gA6MssD06993; Wed, 6 Nov 2002 14:54:54 -0800 Received: (from rth@localhost) by localhost.localdomain (8.11.6/8.11.6) id gA6Mssx22430; Wed, 6 Nov 2002 14:54:54 -0800 X-Authentication-Warning: localhost.localdomain: rth set sender to rth@redhat.com using -f Date: Wed, 06 Nov 2002 14:55:00 -0000 From: Richard Henderson To: Jan Hubicka Cc: gcc-patches@gcc.gnu.org, aj@suse.de Subject: Re: Simplify floating point conversions III Message-ID: <20021106225454.GL22215@redhat.com> Mail-Followup-To: Richard Henderson , Jan Hubicka , gcc-patches@gcc.gnu.org, aj@suse.de References: <20021105171400.GX14655@kam.mff.cuni.cz> <20021105173800.GD20534@redhat.com> <20021106092310.GE22059@kam.mff.cuni.cz> <20021106175441.GZ22059@kam.mff.cuni.cz> <20021106180930.GA22066@redhat.com> <20021106214803.GD22059@kam.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021106214803.GD22059@kam.mff.cuni.cz> User-Agent: Mutt/1.4i X-SW-Source: 2002-11/txt/msg00365.txt.bz2 On Wed, Nov 06, 2002 at 10:48:03PM +0100, Jan Hubicka wrote: > + /* Wind away possible cast. */ > + if (TREE_CODE (arg0) == NOP_EXPR > + && (TYPE_PRECISION (TREE_TYPE (arg0)) > + > TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg0, 0))))) > + arg0 = TREE_OPERAND (arg0, 0); [...] > + /* Be curefull about integer to fp conversions. > + These may overflow still. */ > + if (FLOAT_TYPE_P (TREE_TYPE (arg0)) I'd rather something like static tree strip_float_extensions (exp) tree exp; { tree sub, expt, subt; if (TREE_CODE (exp) != NOP_EXPR) return exp; sub = TREE_OPERAND (exp, 0); subt = TREE_TYPE (sub); expt = TREE_TYPE (exp); if (!FLOAT_TYPE_P (subt)) return exp; if (TYPE_PRECISION (subt) > TYPE_PRECISION (expt)) return exp; return strip_float_extensions (sub); } > + case RDIV_EXPR: > + { > + tree arg0 = TREE_OPERAND (expr, 0); > + tree arg1 = TREE_OPERAND (expr, 1); > + > + /* Unwind possible casts. */ Useful here as well. r~