aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-cppbuiltin.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-cppbuiltin.c')
-rw-r--r--gcc/c-cppbuiltin.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 1619279cc64..3e01dc191fa 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.
@@ -285,7 +285,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. */
@@ -298,8 +298,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
@@ -308,8 +309,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--)
{
@@ -318,7 +319,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);
}