diff options
author | Janis Johnson <janis187@us.ibm.com> | 2009-01-06 19:02:41 +0000 |
---|---|---|
committer | Janis Johnson <janis@gcc.gnu.org> | 2009-01-06 19:02:41 +0000 |
commit | c52ec94809807483ddf593e370daabb68f57a772 (patch) | |
tree | 093f146d6705962c90265309fe92cd0dc9fd825e /gcc/c-cppbuiltin.c | |
parent | 300240e181a3dd4823f47cfd62be2b0c23dd4342 (diff) | |
download | gcc-c52ec94809807483ddf593e370daabb68f57a772.zip gcc-c52ec94809807483ddf593e370daabb68f57a772.tar.gz gcc-c52ec94809807483ddf593e370daabb68f57a772.tar.bz2 |
re PR c/34252 (DEC32_MIN_EXP, DEC32_MAX_EXP don't match TR 24732)
gcc/
PR c/34252
* ginclude/float.h: Rename DECnn_DEN to DECnn_SUBNORMAL_MIN.
* real.c (decimal_single_format): Correct values of emin and emax.
(decimal_double_format): Ditto.
(decimal_quad_format): Ditto.
* c-cppbuiltin.c (builtin_define_decimal_float_constants): Adjust
computation of DECnn_MIN and DECnn_MAX for corrected values of
emin and emax. Define __DECnn_SUBNORMAL_MIN__ instead of
__DECnn_MIN__, and adjust its computation for the corrected value
of emin.
gcc/testsuite/
PR c/34252
* gcc.dg/dfp/decfloat-constants.c: Check for DECnn_SUBNORMAL_MIN
instead of DECnn_DEN. Support -DDBG to list lines that fail.
From-SVN: r143128
Diffstat (limited to 'gcc/c-cppbuiltin.c')
-rw-r--r-- | gcc/c-cppbuiltin.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index f1a454f..58b1796 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -1,5 +1,5 @@ /* Define builtin-in macros for the C family front ends. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GCC. @@ -279,7 +279,7 @@ builtin_define_decimal_float_constants (const char *name_prefix, /* Compute the minimum representable value. */ sprintf (name, "__%s_MIN__", name_prefix); - sprintf (buf, "1E%d%s", fmt->emin, suffix); + sprintf (buf, "1E%d%s", fmt->emin - 1, suffix); builtin_define_with_value (name, buf, 0); /* Compute the maximum representable value. */ @@ -292,8 +292,9 @@ builtin_define_decimal_float_constants (const char *name_prefix, *p++ = '.'; } *p = 0; - /* fmt->p plus 1, to account for the decimal point. */ - sprintf (&buf[fmt->p + 1], "E%d%s", fmt->emax, suffix); + /* fmt->p plus 1, to account for the decimal point and fmt->emax + minus 1 because the digits are nines, not 1.0. */ + sprintf (&buf[fmt->p + 1], "E%d%s", fmt->emax - 1, suffix); builtin_define_with_value (name, buf, 0); /* Compute epsilon (the difference between 1 and least value greater @@ -302,8 +303,8 @@ builtin_define_decimal_float_constants (const char *name_prefix, sprintf (buf, "1E-%d%s", fmt->p - 1, suffix); builtin_define_with_value (name, buf, 0); - /* Minimum denormalized positive decimal value. */ - sprintf (name, "__%s_DEN__", name_prefix); + /* Minimum subnormal positive decimal value. */ + sprintf (name, "__%s_SUBNORMAL_MIN__", name_prefix); p = buf; for (digits = fmt->p; digits > 1; digits--) { @@ -312,7 +313,7 @@ builtin_define_decimal_float_constants (const char *name_prefix, *p++ = '.'; } *p = 0; - sprintf (&buf[fmt->p], "1E%d%s", fmt->emin, suffix); + sprintf (&buf[fmt->p], "1E%d%s", fmt->emin - 1, suffix); builtin_define_with_value (name, buf, 0); } |