From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8582 invoked by alias); 1 Aug 2012 19:21:21 -0000 Received: (qmail 8572 invoked by uid 22791); 1 Aug 2012 19:21:21 -0000 X-SWARE-Spam-Status: No, hits=-7.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail4-relais-sop.national.inria.fr (HELO mail4-relais-sop.national.inria.fr) (192.134.164.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 01 Aug 2012 19:21:07 +0000 Received: from ip-178.net-81-220-91.toulouse.rev.numericable.fr (HELO laptop-mg.local) ([81.220.91.178]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 01 Aug 2012 21:21:05 +0200 Date: Wed, 01 Aug 2012 19:21:00 -0000 From: Marc Glisse To: gcc-patches@gcc.gnu.org Subject: Re: ORDERED_EXPR in invert_tree_comparison In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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: 2012-08/txt/msg00054.txt.bz2 Hello, an opinion on this? (I just noticed: I'll update the list in the comment visible at the top of the patch if this gets in). On Thu, 19 Jul 2012, Marc Glisse wrote: > Hello, > > the simple patch below passes the testsuite after a c,c++ bootstrap without > new regressions. Note however that > > #include > int f(double a, double b){ > return (!isunordered(a,b))&&(a } > > is then optimized by ifcombine to "return (a absence of -fno-trapping-math. I don't know if there are ways to trigger this > latent bug without the patch. > > > > 2012-06-15 Marc Glisse > > PR tree-optimization/53805 > * fold-const.c (invert_tree_comparison): Do invert ORDERED_EXPR and > UNORDERED_EXPR for floating point. > > --- fold-const.c (revision 189622) > +++ fold-const.c (working copy) > @@ -2096,13 +2096,14 @@ pedantic_non_lvalue_loc (location_t loc, > It is generally not safe to do this for floating-point comparisons, except > for EQ_EXPR and NE_EXPR, so we return ERROR_MARK in this case. */ > > enum tree_code > invert_tree_comparison (enum tree_code code, bool honor_nans) > { > - if (honor_nans && flag_trapping_math && code != EQ_EXPR && code != NE_EXPR) > + if (honor_nans && flag_trapping_math && code != EQ_EXPR && code != NE_EXPR > + && code != ORDERED_EXPR && code != UNORDERED_EXPR) > return ERROR_MARK; > > switch (code) > { > case EQ_EXPR: > return NE_EXPR; -- Marc Glisse