From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10473 invoked by alias); 19 Jul 2012 15:52:20 -0000 Received: (qmail 10463 invoked by uid 22791); 19 Jul 2012 15:52:19 -0000 X-SWARE-Spam-Status: No, hits=-6.4 required=5.0 tests=BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail1-relais-roc.national.inria.fr (HELO mail1-relais-roc.national.inria.fr) (192.134.164.82) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Jul 2012 15:52:05 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 19 Jul 2012 17:52:03 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1Srt1G-0006Lx-R6 for gcc-patches@gcc.gnu.org; Thu, 19 Jul 2012 17:52:02 +0200 Date: Thu, 19 Jul 2012 15:52:00 -0000 From: Marc Glisse To: gcc-patches@gcc.gnu.org Subject: ORDERED_EXPR in invert_tree_comparison Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII 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-07/txt/msg00924.txt.bz2 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 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