From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96224 invoked by alias); 7 May 2019 07:55:29 -0000 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 Received: (qmail 96216 invoked by uid 89); 7 May 2019 07:55:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1208 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 May 2019 07:55:28 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 446D3307D91E; Tue, 7 May 2019 07:55:27 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-81.ams2.redhat.com [10.36.116.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CFAD0611D9; Tue, 7 May 2019 07:55:26 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id x477tNR5030031; Tue, 7 May 2019 09:55:24 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id x477tLYp030030; Tue, 7 May 2019 09:55:21 +0200 Date: Tue, 07 May 2019 07:55:00 -0000 From: Jakub Jelinek To: Richard Biener Cc: Jeff Law , Marc Glisse , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fold (x + 0.0) + 0.0 to x + 0.0 (PR tree-optimization/90356) Message-ID: <20190507075521.GH2706@tucnak> Reply-To: Jakub Jelinek References: <20190507072146.GG2706@tucnak> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.3 (2019-02-01) X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00267.txt.bz2 On Tue, May 07, 2019 at 09:48:13AM +0200, Richard Biener wrote: > Will leave the "correctness check" for other folks but the above is > better written as > > + (outer_op (inner_op @0 REAL_CST@1) REAL_CST@2) > + (if (real_zerop (@1) > + && real_zerop (@2) > > because that gets code-generated better. Btw, for -fsignalling-nans Ok, will change. I want to introduce uniform_real_cst_p similar to uniform_integer_cst_p incrementally and then it will change again. > can we have a literal sNaN? Then you need :c on the inner_op since > I'm not sure we canonicalize to sNaN + 0.0 rather than 0.0 + sNaN. I had :c on both initially, but that doesn't compile, because MINUS_EXPR is not commutative. And I wanted to avoid writing 4 patterns instead of 1. > Maybe not worth optimizing though (since we rule out -frounding-math > a similar case there doesn't need to be considered). > > > + && HONOR_SIGNED_ZEROS (element_mode (type)) > > + && !HONOR_SIGN_DEPENDENT_ROUNDING (element_mode (type))) > > You can write HONOR_SIGNED_ZEROS (type) here for brevity. Ok, will do (and change it then in fold_real_zero_addition_p as well). Jakub