From patchwork Thu Jul 19 15:52:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Glisse X-Patchwork-Id: 171965 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 11F8C2C00A3 for ; Fri, 20 Jul 2012 01:52:24 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1343317945; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Date:From:To:Subject:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=rSUD91K NPf9SGd4VeoFHMgsNglA=; b=gWMoTfRGocR8101R+30lVCzOaQfXeS6uT1UT5yV FN47dJEJPGOG/qCzsh0NRuiyRF9/2CAWtVs/MsF1ULiwA3tZukCArOHb6CJaskQ9 C7du7dzRuKOWqhd/Zbbr1D+SFqlgRFkqs/bHw9JBRZMEWYgIrcNHBbDyN8gE6UYN p5L8= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Date:From:To:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=h2hFtIwvaCu8bqZU+Fn95ifjh7ZLpLGvfL/dajEow5YKbekjP4y3Yc3nZPqF34 uwnt+KXPNW7pYIRsGrWnisTSQB2eTerAf/Ur/4L8ALZFt51RH0H72lx9CiC9NHVC 2eeHKs4clWFF4g7+N4A+o+/i7tWx/o5rNzvGadQm7QUQs=; 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 17:52:02 +0200 (CEST) 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 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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;