diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-cppbuiltin.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/c11-float-2.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/float128-floath.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/float128x-floath.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/float16-floath.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/float32-floath.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/float32x-floath.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/float64-floath.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/float64x-floath.c | 4 |
11 files changed, 27 insertions, 32 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 6256c4d..4bdd474 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2017-02-17 Joseph Myers <joseph@codesourcery.com> + + * c-cppbuiltin.c (builtin_define_float_constants): Define + __DECIMAL_DIG__ to the value for long double. + 2017-02-15 Marek Polacek <polacek@redhat.com> PR c/79515 diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index c114bbd..083d5fd 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -245,11 +245,10 @@ builtin_define_float_constants (const char *name_prefix, if (type_decimal_dig < type_d_decimal_dig) type_decimal_dig++; } - /* Arbitrarily, define __DECIMAL_DIG__ when defining macros for long - double, although it may be greater than the value for long - double. */ + /* Define __DECIMAL_DIG__ to the value for long double to be + compatible with C99 and C11; see DR#501 and N2108. */ if (type == long_double_type_node) - builtin_define_with_int_value ("__DECIMAL_DIG__", decimal_dig); + builtin_define_with_int_value ("__DECIMAL_DIG__", type_decimal_dig); sprintf (name, "__%s_DECIMAL_DIG__", name_prefix); builtin_define_with_int_value (name, type_decimal_dig); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5511f26..035cf47 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2017-02-17 Joseph Myers <joseph@codesourcery.com> + + * 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. + 2017-02-17 Bill Schmidt <wschmidt@linux.vnet.ibm.com> PR target/79261 diff --git a/gcc/testsuite/gcc.dg/c11-float-2.c b/gcc/testsuite/gcc.dg/c11-float-2.c new file mode 100644 index 0000000..345c2d3 --- /dev/null +++ b/gcc/testsuite/gcc.dg/c11-float-2.c @@ -0,0 +1,9 @@ +/* Test DECIMAL_DIG equals LDBL_DECIMAL_DIG; see DR#501 and N2108. */ +/* { dg-do preprocess } */ +/* { dg-options "-std=c11 -pedantic-errors" } */ + +#include <float.h> + +#if DECIMAL_DIG != LDBL_DECIMAL_DIG +# error "DECIMAL_DIG != LDBL_DECIMAL_DIG" +#endif diff --git a/gcc/testsuite/gcc.dg/torture/float128-floath.c b/gcc/testsuite/gcc.dg/torture/float128-floath.c index 7b5b046..6015903 100644 --- a/gcc/testsuite/gcc.dg/torture/float128-floath.c +++ b/gcc/testsuite/gcc.dg/torture/float128-floath.c @@ -53,10 +53,6 @@ # error "FLT128_TRUE_MIN undefined" #endif -#if FLT128_DECIMAL_DIG > DECIMAL_DIG -# error "FLT128_DECIMAL_DIG > DECIMAL_DIG" -#endif - #if FLT128_MANT_DIG != 113 || FLT128_MAX_EXP != 16384 || FLT128_MIN_EXP != -16381 # error "_Float128 bad format" #endif diff --git a/gcc/testsuite/gcc.dg/torture/float128x-floath.c b/gcc/testsuite/gcc.dg/torture/float128x-floath.c index 3ac96ce..5c0d94f 100644 --- a/gcc/testsuite/gcc.dg/torture/float128x-floath.c +++ b/gcc/testsuite/gcc.dg/torture/float128x-floath.c @@ -53,10 +53,6 @@ # error "FLT128X_TRUE_MIN undefined" #endif -#if FLT128X_DECIMAL_DIG > DECIMAL_DIG -# error "FLT128X_DECIMAL_DIG > DECIMAL_DIG" -#endif - #if FLT128X_MANT_DIG < 128 || FLT128X_MAX_EXP < 65536 || FLT128X_MIN_EXP + FLT128X_MAX_EXP != 3 # error "_Float128x bad format" #endif diff --git a/gcc/testsuite/gcc.dg/torture/float16-floath.c b/gcc/testsuite/gcc.dg/torture/float16-floath.c index 3748f41..91c84e7 100644 --- a/gcc/testsuite/gcc.dg/torture/float16-floath.c +++ b/gcc/testsuite/gcc.dg/torture/float16-floath.c @@ -53,10 +53,6 @@ # error "FLT16_TRUE_MIN undefined" #endif -#if FLT16_DECIMAL_DIG > DECIMAL_DIG -# error "FLT16_DECIMAL_DIG > DECIMAL_DIG" -#endif - #if FLT16_MANT_DIG != 11 || FLT16_MAX_EXP != 16 || FLT16_MIN_EXP != -13 # error "_Float16 bad format" #endif diff --git a/gcc/testsuite/gcc.dg/torture/float32-floath.c b/gcc/testsuite/gcc.dg/torture/float32-floath.c index dd503be..cada00a 100644 --- a/gcc/testsuite/gcc.dg/torture/float32-floath.c +++ b/gcc/testsuite/gcc.dg/torture/float32-floath.c @@ -53,10 +53,6 @@ # error "FLT32_TRUE_MIN undefined" #endif -#if FLT32_DECIMAL_DIG > DECIMAL_DIG -# error "FLT32_DECIMAL_DIG > DECIMAL_DIG" -#endif - #if FLT32_MANT_DIG != 24 || FLT32_MAX_EXP != 128 || FLT32_MIN_EXP != -125 # error "_Float32 bad format" #endif diff --git a/gcc/testsuite/gcc.dg/torture/float32x-floath.c b/gcc/testsuite/gcc.dg/torture/float32x-floath.c index ef2005c..6baabf3 100644 --- a/gcc/testsuite/gcc.dg/torture/float32x-floath.c +++ b/gcc/testsuite/gcc.dg/torture/float32x-floath.c @@ -53,10 +53,6 @@ # error "FLT32X_TRUE_MIN undefined" #endif -#if FLT32X_DECIMAL_DIG > DECIMAL_DIG -# error "FLT32X_DECIMAL_DIG > DECIMAL_DIG" -#endif - #if FLT32X_MANT_DIG < 32 || FLT32X_MAX_EXP < 1024 || FLT32X_MIN_EXP + FLT32X_MAX_EXP != 3 # error "_Float32x bad format" #endif diff --git a/gcc/testsuite/gcc.dg/torture/float64-floath.c b/gcc/testsuite/gcc.dg/torture/float64-floath.c index 3fb443b..f10e58e 100644 --- a/gcc/testsuite/gcc.dg/torture/float64-floath.c +++ b/gcc/testsuite/gcc.dg/torture/float64-floath.c @@ -53,10 +53,6 @@ # error "FLT64_TRUE_MIN undefined" #endif -#if FLT64_DECIMAL_DIG > DECIMAL_DIG -# error "FLT64_DECIMAL_DIG > DECIMAL_DIG" -#endif - #if FLT64_MANT_DIG != 53 || FLT64_MAX_EXP != 1024 || FLT64_MIN_EXP != -1021 # error "_Float64 bad format" #endif diff --git a/gcc/testsuite/gcc.dg/torture/float64x-floath.c b/gcc/testsuite/gcc.dg/torture/float64x-floath.c index 7fce730..00c36f4 100644 --- a/gcc/testsuite/gcc.dg/torture/float64x-floath.c +++ b/gcc/testsuite/gcc.dg/torture/float64x-floath.c @@ -53,10 +53,6 @@ # error "FLT64X_TRUE_MIN undefined" #endif -#if FLT64X_DECIMAL_DIG > DECIMAL_DIG -# error "FLT64X_DECIMAL_DIG > DECIMAL_DIG" -#endif - #if FLT64X_MANT_DIG < 64 || FLT64X_MAX_EXP < 16384 || FLT64X_MIN_EXP + FLT64X_MAX_EXP != 3 # error "_Float64x bad format" #endif |