float64x-floath.c
1.09 KB
-
Restore DECIMAL_DIG macro to C99/C11 value. · 97fcf744
By extending the set of floating types, TS 18661-3 thereby affected the definition of DECIMAL_DIG, which is defined in terms of the "widest supported floating type". This is not conditional on whether __STDC_WANT_IEC_60559_TYPES_EXT__ is defined when <float.h> is included. I raised this possible incompatibility with C11 (an implementation should be able to conform simultaneously with C11, and with C11 + TS 18661) in DR#501. This is not yet resolved, but the latest proposal <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2108.pdf> would obsolete DECIMAL_DIG with the intention of limiting it to the C11 types (so making it equivalent to LDBL_DECIMAL_DIG). (This proposal is intended to go along with a corresponding change to TS 18661-3 to avoid the new types and non-arithmetic interchange encodings affecting the value of DECIMAL_DIG.) To avoid releasing GCC 7 with a wider-than-C11 value of DECIMAL_DIG and possibly reverting back to a C11 value in a future release, this patch reverts back to the C11 value now. If the proposed resolution to DR#501 changes again so that DECIMAL_DIG *should* have a wider-than-C11 value, we can move back to a wider-than-C11 value in GCC 8. Bootstrapped with no regressions on x86_64-pc-linux-gnu. gcc/c-family: * c-cppbuiltin.c (builtin_define_float_constants): Define __DECIMAL_DIG__ to the value for long double. gcc/testsuite: * gcc.dg/c11-float-2.c: New test. * gcc.dg/torture/float128-floath.c, gcc.dg/torture/float128x-floath.c, gcc.dg/torture/float16-floath.c, gcc.dg/torture/float32-floath.c, gcc.dg/torture/float32x-floath.c, gcc.dg/torture/float64-floath.c, gcc.dg/torture/float64x-floath.c: Do not test comparison of *_DECIMAL_DIG macros with DECIMAL_DIG. From-SVN: r245555
Joseph Myers committed