]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c: Do not use *_IS_IEC_60559 == 2
authorJoseph Myers <joseph@codesourcery.com>
Thu, 13 Oct 2022 01:13:36 +0000 (01:13 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 13 Oct 2022 01:13:36 +0000 (01:13 +0000)
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
<float.h> 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.

gcc/c-family/c-cppbuiltin.cc
gcc/ginclude/float.h
gcc/testsuite/gcc.dg/c2x-float-10.c

index 4b8486c8879bfc700de96a50ae911f71fb872eff..2e39acb923943df971a58c9929e414f3f8e59c6c 100644 (file)
@@ -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. */
index afe4a712878cfbe661f41e6e855e7af45af2bb75..bc5439d664faa5f0f6783ebd37c65fb9243e673d 100644 (file)
@@ -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
index 7b53a6ab050307f1096de5a0480d9dd6ec5e643b..7206921db876fa4ce0c81137a0bf08fa0a589e59 100644 (file)
@@ -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