From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id C2B323858C56 for ; Thu, 13 Oct 2022 01:14:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C2B323858C56 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.95,180,1661846400"; d="scan'208";a="84700051" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 12 Oct 2022 17:14:39 -0800 IronPort-SDR: d+ZmakM8igkNAtjT/oV1HOUfFM/naPDohWWG8xuzkv9cjQvDvCi9gUA+tKogXvQpabz+OM1SRr K6EIsTVLoVii1THCrykLGayIMw2CAMTeKcVmacxV1zd4ld14biTtUeMd/pjPcQZxeAc8L17qZq 9r8CWNj/adaj9bOa0Iim2a8KbDanOuHqtRA6Fq5+/9IvCtg/kvEXQ243nYDg2obmMUC554zaNh ABEBFLx5g1izLlwmQLTaJFOBvGWowUSOZi74vwPe112VEUqr6iZT2cStjdXy2ALuMXtytx+EGQ Rg4= Date: Thu, 13 Oct 2022 01:14:35 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Subject: [committed] c: Do not use *_IS_IEC_60559 == 2 Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-3116.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_NUMSUBJECT,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,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: A late change for C2x (addressing comments from the second round of editorial review before the CD ballot, postdating the most recent public working draft) removed the value 2 for *_IS_IEC_60559 (a new macro added in C2x). Adjust the implementation accordingly not to use this value. Bootstrapped with no regressions for x86_64-pc-linux-gnu. gcc/ * ginclude/float.h (FLT_IS_IEC_60559, DBL_IS_IEC_60559) (LDBL_IS_IEC_60559): Update comment. gcc/c-family/ * c-cppbuiltin.cc (builtin_define_float_constants): Do not use value 2 for *_IS_IEC_60559. gcc/testsuite/ * gcc.dg/c2x-float-10.c: Do not expect value 2 for *_IS_IEC_60559. diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index 4b8486c8879..2e39acb9239 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc @@ -319,14 +319,10 @@ builtin_define_float_constants (const char *name_prefix, } /* For C2x *_IS_IEC_60559. 0 means the type does not match an IEC - 60559 format, 1 that it matches a format but not operations and 2 - that it matches a format and operations (but may not conform to - Annex F; we take this as meaning exceptions and rounding modes - need not be supported). */ + 60559 format, 1 that it matches a format but not necessarily + operations. */ sprintf (name, "__%s_IS_IEC_60559__", name_prefix); - builtin_define_with_int_value (name, - (fmt->ieee_bits == 0 - ? 0 : (fmt->round_towards_zero ? 1 : 2))); + builtin_define_with_int_value (name, fmt->ieee_bits != 0); } /* Define __DECx__ constants for TYPE using NAME_PREFIX and SUFFIX. */ diff --git a/gcc/ginclude/float.h b/gcc/ginclude/float.h index afe4a712878..bc5439d664f 100644 --- a/gcc/ginclude/float.h +++ b/gcc/ginclude/float.h @@ -248,8 +248,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define DBL_NORM_MAX __DBL_NORM_MAX__ #define LDBL_NORM_MAX __LDBL_NORM_MAX__ -/* Whether each type matches an IEC 60559 format (1 for format, 2 for - format and operations). */ +/* Whether each type matches an IEC 60559 format. */ #undef FLT_IS_IEC_60559 #undef DBL_IS_IEC_60559 #undef LDBL_IS_IEC_60559 diff --git a/gcc/testsuite/gcc.dg/c2x-float-10.c b/gcc/testsuite/gcc.dg/c2x-float-10.c index 7b53a6ab050..7206921db87 100644 --- a/gcc/testsuite/gcc.dg/c2x-float-10.c +++ b/gcc/testsuite/gcc.dg/c2x-float-10.c @@ -21,13 +21,13 @@ _Static_assert (FLT_IS_IEC_60559 == 0); _Static_assert (DBL_IS_IEC_60559 == 0); _Static_assert (LDBL_IS_IEC_60559 == 0); #else -_Static_assert (FLT_IS_IEC_60559 == 2); -_Static_assert (DBL_IS_IEC_60559 == 2); +_Static_assert (FLT_IS_IEC_60559 == 1); +_Static_assert (DBL_IS_IEC_60559 == 1); #if LDBL_MANT_DIG == 106 || LDBL_MIN_EXP == -16382 /* IBM long double and m68k extended format do not meet the definition of an IEC 60559 interchange or extended format. */ _Static_assert (LDBL_IS_IEC_60559 == 0); #else -_Static_assert (LDBL_IS_IEC_60559 == 2); +_Static_assert (LDBL_IS_IEC_60559 == 1); #endif #endif -- Joseph S. Myers joseph@codesourcery.com