diff options
author | Marc Glisse <glisse@gcc.gnu.org> | 2014-09-11 20:55:37 +0000 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2014-09-11 20:55:37 +0000 |
commit | 179b5a554c64bbcd8cdbdd5acc9cda92bd5f9d84 (patch) | |
tree | 132aa47f8b5f8cea4bba7a54fa01012b8a9a1a10 /gcc/c-family | |
parent | a827d9b1943e966713fbc5cd8f56722791f524aa (diff) | |
download | gcc-179b5a554c64bbcd8cdbdd5acc9cda92bd5f9d84.tar.gz |
re PR target/58757 (Advertise the lack of denormal support on alpha without -mieee)
2014-09-11 Marc Glisse <marc.glisse@inria.fr>
PR target/58757
gcc/c-family/
* c-cppbuiltin.c (builtin_define_float_constants): Correct
__*_DENORM_MIN__ without denormals.
gcc/
* ginclude/float.h (FLT_TRUE_MIN, DBL_TRUE_MIN, LDBL_TRUE_MIN):
Directly forward to __*_DENORM_MIN__.
gcc/testsuite/
* gcc.dg/c11-true_min-1.c: New testcase.
From-SVN: r215191
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); |