From patchwork Tue Aug 15 17:44:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 801701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-83172-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="ayrPXlq/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xX0W557xTz9t3f for ; Wed, 16 Aug 2017 03:55:13 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:in-reply-to:references :message-id; q=dns; s=default; b=A64NJNGrME50YDKj4lJW6irV1OLuUM+ oY3TrdgmEt+pAwk+jfHaVRiMX9LpphAY3HOz70G4sxjoHIz2wsDzfjt0BeYFxAn4 Q9/t5RDunLmFsXXvF8q3YP/ipDGti29ZZ9gw0FY00wZOUiYJSiJovX8gMPg0jFca RF9a/ine9//g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:in-reply-to:references :message-id; s=default; bh=kA7H3y0pSz39kxBFoTQVZN00TPM=; b=ayrPX lq/IaCEnlLA+1P5y8OAXWFa+lQbz4f7KpMrnW03gAuYlocLZvtb8A35hHMvxGibC V/236xBS/NZW+zgfsFxs5iW4YovZXNNJLxheI4ay8pThMdx6FVPWQyflhQN+Ynei yDMKKh+iEQHdPFXtZba2Gt8zwgZvQU4t3ZXQX4= Received: (qmail 94084 invoked by alias); 15 Aug 2017 17:48:51 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 88649 invoked by uid 89); 15 Aug 2017 17:45:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com From: "Gabriel F. T. Gomes" To: libc-alpha@sourceware.org Subject: [PATCH 1/3] Do not use __builtin_types_compatible_p in C++ mode (bug 21930) Date: Tue, 15 Aug 2017 14:44:59 -0300 In-Reply-To: <20170815174501.4143-1-gftg@linux.vnet.ibm.com> References: <20170815174501.4143-1-gftg@linux.vnet.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 17081517-0056-0000-0000-000003B7081F X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007550; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000221; SDB=6.00902759; UDB=6.00452170; IPR=6.00682975; BA=6.00005534; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016707; XFM=3.00000015; UTC=2017-08-15 17:45:14 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17081517-0057-0000-0000-000007ED3647 Message-Id: <20170815174501.4143-2-gftg@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-15_13:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708150298 The logic to define isinf for float128 depends on the availability of __builtin_types_compatible_p, which is only available in C mode, however, the conditionals do not check for C or C++ mode. This lead to an error in libstdc++ configure, as reported by bug 21930. This patch adds a conditional for C mode in the definition of isinf for float128. No definition is provided in C++ mode, since libstdc++ headers undefine isinf. Tested for powerpc64le (glibc test suite and libstdc++-v3 configure). [BZ #21930] * math/math.h (isinf): Check if in C or C++ mode before using __builtin_types_compatible_p, since this is a C mode feature. --- math/math.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/math/math.h b/math/math.h index e21708045a..dea8dbe1ae 100644 --- a/math/math.h +++ b/math/math.h @@ -442,8 +442,12 @@ enum /* Return nonzero value if X is positive or negative infinity. */ # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \ - && !defined __SUPPORT_SNAN__ - /* __builtin_isinf_sign is broken for float128 only before GCC 7.0. */ + && !defined __SUPPORT_SNAN__ && !defined __cplusplus + /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0, + use the helper function, __isinff128, with older compilers. This is + only provided for C mode, because in C++ mode, GCC has no support + for __builtin_types_compatible_p (and when in C++ mode, this macro is + not used anyway, because libstdc++ headers undefine it). */ # define isinf(x) \ (__builtin_types_compatible_p (__typeof (x), _Float128) \ ? __isinff128 (x) : __builtin_isinf_sign (x))