diff options
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-cppbuiltin.c | 21 |
2 files changed, 13 insertions, 14 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index f24696db23b..ca22822649a 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2014-09-11 Marc Glisse <marc.glisse@inria.fr> + + PR target/58757 + * c-cppbuiltin.c (builtin_define_float_constants): Correct + __*_DENORM_MIN__ without denormals. + 2014-09-10 Jakub Jelinek <jakub@redhat.com> * c-ubsan.c (ubsan_instrument_division, ubsan_instrument_shift, diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 411ca194ada..da206766560 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -270,21 +270,14 @@ builtin_define_float_constants (const char *name_prefix, sprintf (buf, "0x1p%d", 1 - fmt->p); builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast); - /* For C++ std::numeric_limits<T>::denorm_min. The minimum denormalized - positive floating-point number, b**(emin-p). Zero for formats that - don't support denormals. */ + /* For C++ std::numeric_limits<T>::denorm_min and C11 *_TRUE_MIN. + The minimum denormalized positive floating-point number, b**(emin-p). + The minimum normalized positive floating-point number for formats + that don't support denormals. */ sprintf (name, "__%s_DENORM_MIN__", name_prefix); - if (fmt->has_denorm) - { - sprintf (buf, "0x1p%d", fmt->emin - fmt->p); - builtin_define_with_hex_fp_value (name, type, decimal_dig, - buf, fp_suffix, fp_cast); - } - else - { - sprintf (buf, "0.0%s", fp_suffix); - builtin_define_with_value (name, buf, 0); - } + sprintf (buf, "0x1p%d", fmt->emin - (fmt->has_denorm ? fmt->p : 1)); + builtin_define_with_hex_fp_value (name, type, decimal_dig, + buf, fp_suffix, fp_cast); sprintf (name, "__%s_HAS_DENORM__", name_prefix); builtin_define_with_value (name, fmt->has_denorm ? "1" : "0", 0); |