From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 0B4593858CDA for ; Wed, 2 Nov 2022 09:13:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B4593858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cebitec.uni-bielefeld.de Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id A4593B05DE; Wed, 2 Nov 2022 10:13:45 +0100 (CET) X-Virus-Scanned: amavisd-new at CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UhPhsBZclZLK; Wed, 2 Nov 2022 10:13:45 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p50855a16.dip0.t-ipconnect.de [80.133.90.22]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id 228D3B04E0; Wed, 2 Nov 2022 10:13:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=CeBiTec.Uni-Bielefeld.DE; s=20200306; t=1667380425; bh=KsFdjM+Ie+3/eVmFY59VPdx9jy8/f3q8VVydMIryW94=; h=From:To:Cc:Subject:Date:From; b=JAoNnqetekER+QfMBSti068U2TMFfk0iA5KJQPgirPDmDBr7MhoTwqb3xbXWMMpJv Y+QHkpSLILs+V/1W94sYwa5iGMduRfX+nI8h5UIXwvTYCA+PPk6eUw8dDby+JEGpLc egvdD5dYjQ6wPZWHlJGsYznyUrNZKo+pCqTznJRqh3zP7m2vwchncMtsPqDwC55kVS gtEMuhLpWnImIZ8z9Ye779jcQtntFtQ+P5k+1Kb3bwjTpebgbV0xaYKLFEwyWAcW0E hw+fpuwKA5dLlJyI0HIe4ChJK1zV9NibEyr7usTQAFQ34i1Qlzw4uFDbXsgC0wiTlB lJ/emuLWqZTiw== From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek Subject: [PATCH] builtins: Guard builtins.cc against HUGE_VAL and NAN definitions Date: Wed, 02 Nov 2022 10:13:44 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Status: No, score=-3795.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain trunk bootstrap recently broke on Solaris like this: /vol/gcc/src/hg/master/local/gcc/builtins.cc:2104:8: error: pasting "CFN_BUILT_IN_" and "(" does not give a valid preprocessing token 2104 | case CFN_BUILT_IN_##MATHFN: \ | ^~~~~~~~~~~~~ /vol/gcc/src/hg/master/local/gcc/builtins.cc:2112:3: note: in expansion of macro 'CASE_MATHFN' 2112 | CASE_MATHFN(MATHFN) \ | ^~~~~~~~~~~ /vol/gcc/src/hg/master/local/gcc/builtins.cc:1967:5: note: in expansion of macro 'CASE_MATHFN_FLOATN' 1967 | CASE_MATHFN_FLOATN (HUGE_VAL) \ and similarly for NAN. It turns out this happens because is included at some point, which (in ) defines #define HUGE_VAL (__builtin_huge_val()) #define NAN (__builtin_nanf("")) While this only happpens on Solaris right now, the same issue would be present on other targets when gets included somehow. To avoid this, this patch #undef's both macros. Bootstrapped without regressions on i386-pc-solaris2.11 and sparc-sun-solaris2.11. Ok for trunk? Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2022-11-01 Rainer Orth gcc: * builtins.cc (mathfn_built_in_2): #undef HUGE_VAL, NAN. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=sol2-builtins-math.h.patch # HG changeset patch # Parent 3e5ba66da20edf52cdfe371ea2244c91d770f64a builtins: Guard builtins.cc against HUGE_VAL and NAN definitions diff --git a/gcc/builtins.cc b/gcc/builtins.cc --- a/gcc/builtins.cc +++ b/gcc/builtins.cc @@ -1931,6 +1931,11 @@ mathfn_built_in_2 (tree type, combined_f built_in_function fcodef64x = END_BUILTINS; built_in_function fcodef128x = END_BUILTINS; + /* If has been included somehow, HUGE_VAL and NAN definitions + break the uses below. */ +#undef HUGE_VAL +#undef NAN + switch (fn) { #define SEQ_OF_CASE_MATHFN \ --=-=-=--