From patchwork Mon Aug 1 19:28:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 107796 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 64220B7090 for ; Tue, 2 Aug 2011 05:28:55 +1000 (EST) Received: (qmail 28101 invoked by alias); 1 Aug 2011 19:28:54 -0000 Received: (qmail 28092 invoked by uid 22791); 1 Aug 2011 19:28:53 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rcsinet15.oracle.com (HELO rcsinet15.oracle.com) (148.87.113.117) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 01 Aug 2011 19:28:38 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id p71JSZuD015138 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 1 Aug 2011 19:28:37 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id p71JSYlQ007204 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 1 Aug 2011 19:28:35 GMT Received: from abhmt118.oracle.com (abhmt118.oracle.com [141.146.116.70]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id p71JSTBa032052; Mon, 1 Aug 2011 14:28:29 -0500 Received: from [192.168.1.4] (/79.53.13.39) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 01 Aug 2011 12:28:28 -0700 Message-ID: <4E36FE62.1040807@oracle.com> Date: Mon, 01 Aug 2011 21:28:34 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Jason Merrill CC: gcc-patches List Subject: Re: C++ PATCH for c++/49813 (__builtin_isinf in constant expression) References: <4E299FEB.9020100@redhat.com> <4E36ECA0.3010508@redhat.com> In-Reply-To: <4E36ECA0.3010508@redhat.com> X-IsSubscribed: yes 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 Thanks a lot, Jason. I applied the below, tested x86_64-linux multilib. Paolo. ////////////////////// 2011-08-01 Paolo Carlini PR c++/49813 * include/c_global/cmath (isinf): Remove workaround. Index: include/c_global/cmath =================================================================== --- include/c_global/cmath (revision 177068) +++ include/c_global/cmath (working copy) @@ -547,18 +547,17 @@ isfinite(_Tp __x) { return true; } - // Workaround the isinf issue discussed in PR 49813. constexpr bool isinf(float __x) - { return fpclassify(__x) == FP_INFINITE; } + { return __builtin_isinf(__x); } constexpr bool isinf(double __x) - { return fpclassify(__x) == FP_INFINITE; } + { return __builtin_isinf(__x); } constexpr bool isinf(long double __x) - { return fpclassify(__x) == FP_INFINITE; } + { return __builtin_isinf(__x); } template constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,