std::numeric_limits<T>::denorm_min

Richard Henderson rth@redhat.com
Wed Sep 4 17:56:00 GMT 2002


More numeric_limits cleanup.

I'd commit this now, except that this has revealed that
real.c cannot handle IEEE extended-precision denormals.
We insist on normalizing numbers in the internal representation, 
but the internal representation only has a 15-bit exponent,
which we promptly overflow.

I'll see if I can hack something for 3.3, but we *really* 
need a complete rewrite of real.c.  I'll delay committing
this patch until the issue is resolved.


r~


	* c-common.c (builtin_define_float_constants): Add __FLT_DENORM_MIN__.

	* include/std/std_limits.h (__glibcpp_f32_denorm_min_bytes,
	__glibcpp_f32_has_denorm, __glibcpp_f64_denorm_min_bytes,
	__glibcpp_f64_has_denorm, __glibcpp_f80_denorm_min_bytes,
	__glibcpp_f80_has_denorm, __glibcpp_f96_denorm_min_bytes,
	__glibcpp_f96_has_denorm, __glibcpp_f128_denorm_min_bytes,
	__glibcpp_f128_has_denorm, __glibcpp_float_denorm_min_bytes,
	__glibcpp_float_has_denorm, __glibcpp_double_denorm_min_bytes,
	__glibcpp_double_has_denorm, __glibcpp_long_double_denorm_min_bytes,
	__glibcpp_long_double_has_denorm): Remove.
	(__glibcpp_float_denorm_min, __glibcpp_double_denorm_min,
	__glibcpp_long_double_denorm_min): Remove.
	(std::numeric_limits<T>::has_denorm): Use __<T>_DENORM_MIN__.
	(std::numeric_limits<T>::denorm_min): Likewise.
	* src/limits.cc (__glibcpp_float_denorm_min,
	__glibcpp_double_denorm_min, __glibcpp_long_double_denorm_min): Remove.

Index: gcc/c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.372
diff -c -p -d -u -r1.372 c-common.c
--- gcc/c-common.c	4 Sep 2002 17:11:32 -0000	1.372
+++ gcc/c-common.c	5 Sep 2002 00:43:06 -0000
@@ -5048,6 +5048,13 @@ builtin_define_float_constants (name_pre
   sprintf (name, "__%s_EPSILON__", name_prefix);
   sprintf (buf, "0x1p%d", (1 - mant_dig) * log2_b);
   builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix);
+
+  /* For C++ std::numeric_limits<T>::denorm_min.  The minimum denormalized
+     positive floating-point number, b**(min_exp-p).  Winds up being zero
+     for targets that don't support denormals.  */
+  sprintf (name, "__%s_DENORM_MIN__", name_prefix);
+  sprintf (buf, "0x1p%d", (min_exp - mant_dig) * log2_b);
+  builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix);
 }
 
 /* Hook that registers front end and target-specific built-ins.  */
Index: libstdc++-v3/include/std/std_limits.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/std/std_limits.h,v
retrieving revision 1.10
diff -c -p -d -u -r1.10 std_limits.h
--- libstdc++-v3/include/std/std_limits.h	4 Sep 2002 23:22:17 -0000	1.10
+++ libstdc++-v3/include/std/std_limits.h	5 Sep 2002 00:43:10 -0000
@@ -156,8 +156,6 @@
 #  define __glibcpp_f32_has_QNaN true
 #  define __glibcpp_f32_SNaN_bytes { 0x7f800001 }
 #  define __glibcpp_f32_has_SNaN true
-#  define __glibcpp_f32_denorm_min_bytes { 0x00000001 }
-#  define __glibcpp_f32_has_denorm denorm_present
 #  define __glibcpp_f32_is_iec559  true
 #endif
 #ifndef __glibcpp_f32_QNaN_bytes
@@ -168,10 +166,6 @@
 #  define __glibcpp_f32_SNaN_bytes { }
 #  define __glibcpp_f32_has_SNaN false
 #endif
-#ifndef __glibcpp_f32_denorm_min_bytes
-#  define __glibcpp_f32_denorm_min_bytes { }
-#  define __glibcpp_f32_has_denorm denorm_indeterminate
-#endif
 #ifndef __glibcpp_f32_is_iec559
 #  define __glibcpp_f32_is_iec559 false
 #endif 
@@ -180,15 +174,12 @@
 #  if __TARGET_FLOAT_WORDS_ORDER__ == __GCC_BIG_ENDIAN__
 #    define __glibcpp_f64_QNaN_bytes { 0x7ff80000, 0x0 }
 #    define __glibcpp_f64_SNaN_bytes { 0x7ff00000, 0x1 }
-#    define __glibcpp_f64_denorm_min_bytes { 0x0, 0x1 }
 #  else
 #    define __glibcpp_f64_QNaN_bytes { 0x0, 0x7ff80000 }
 #    define __glibcpp_f64_SNaN_bytes { 0x1, 0x7ff00000 }
-#    define __glibcpp_f64_denorm_min_bytes { 0x1, 0x0 }
 #  endif
 #  define __glibcpp_f64_has_QNaN true
 #  define __glibcpp_f64_has_SNaN true
-#  define __glibcpp_f64_has_denorm denorm_present
 #  define __glibcpp_f64_is_iec559 true
 #endif
 #ifndef __glibcpp_f64_QNaN_bytes
@@ -199,10 +190,6 @@
 #  define __glibcpp_f64_SNaN_bytes { }
 #  define __glibcpp_f64_has_SNaN false
 #endif
-#ifndef __glibcpp_f64_denorm_min_bytes
-#  define __glibcpp_f64_denorm_min_bytes { }
-#  define __glibcpp_f64_has_denorm denorm_indeterminate
-#endif
 #ifndef __glibcpp_f64_is_iec559
 #  define __glibcpp_f64_is_iec559 false
 #endif 
@@ -213,19 +200,14 @@
        { 0x7f, 0xff, 0xC0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }
 #    define __glibcpp_f80_SNaN_bytes       \
        { 0x7f, 0xff, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1 }
-#    define __glibcpp_f80_denorm_min_bytes \
-       { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1 }
 #  else
 #    define __glibcpp_f80_QNaN_bytes       \
        { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xC0, 0xff, 0x7f }
 #    define __glibcpp_f80_SNaN_bytes       \
        { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0xff, 0x7f }
-#    define __glibcpp_f80_denorm_min_bytes \
-       { 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }
 #  endif
 #  define __glibcpp_f80_has_QNaN true
 #  define __glibcpp_f80_has_SNaN true
-#  define __glibcpp_f80_has_denorm denorm_present
 #  define __glibcpp_f80_is_iec559 true
 #endif
 #ifndef __glibcpp_f80_QNaN_bytes
@@ -236,10 +218,6 @@
 #  define __glibcpp_f80_SNaN_bytes { }
 #  define __glibcpp_f80_has_SNaN false
 #endif
-#ifndef __glibcpp_f80_denorm_min_bytes
-#  define __glibcpp_f80_denorm_min_bytes { }
-#  define __glibcpp_f80_has_denorm denorm_indeterminate
-#endif
 #ifndef __glibcpp_f80_is_iec559
 #  define __glibcpp_f80_is_iec559 false
 #endif 
@@ -248,15 +226,12 @@
 #  if __TARGET_BYTES_ORDER__ == __GCC_BIG_ENDIAN__
 #    define __glibcpp_f96_QNaN_bytes { 0x7ff80000, 0x0, 0x0 }
 #    define __glibcpp_f96_SNaN_bytes { 0x7ff00000, 0x0, 0x1 }
-#    define __glibcpp_f96_denorm_min_bytes { 0x0, 0x0, 0x1 }
 #  else
 #    define __glibcpp_f96_QNaN_bytes { 0x0, 0x0, 0x7ff80000 }
 #    define __glibcpp_f96_SNaN_bytes { 0x1, 0x0, 0x7ff00000 }
-#    define __glibcpp_f96_denorm_min_bytes { 0x1, 0x0, 0x0 }
 #  endif
 #  define __glibcpp_f96_has_QNaN true
 #  define __glibcpp_f96_has_SNaN true
-#  define __glibcpp_f96_has_denorm denorm_present
 #  define __glibcpp_f96_is_iec559 true
 #endif
 #ifndef __glibcpp_f96_QNaN_bytes
@@ -267,24 +242,17 @@
 #  define __glibcpp_f96_SNaN_bytes { }
 #  define __glibcpp_f96_has_SNaN false
 #endif
-#ifndef __glibcpp_f96_denorm_min_bytes
-#  define __glibcpp_f96_denorm_min_bytes { }
-#  define __glibcpp_f96_has denorm_indeterminate
-#endif
 #define __glibcpp_f128_round_error 1.0L
 #if __GCC_FLOAT_FORMAT__ == __IEEE_FORMAT__
 #  if __TARGET_FLOAT_WORDS_ORDER__ == __GCC_BIG_ENDIAN__
 #    define __glibcpp_f128_QNaN_bytes { 0x7fff0800, 0x0, 0x0, 0x0 }
 #    define __glibcpp_f128_SNaN_bytes { 0x7fff0000, 0x0, 0x0, 0x1 }
-#    define __glibcpp_f128_denorm_min_bytes { 0x0, 0x0, 0x0, 0x1 }
 #  else
 #    define __glibcpp_f128_QNaN_bytes { 0x0, 0x0, 0x0, 0x7fff0800 }
 #    define __glibcpp_f128_SNaN_bytes { 0x1, 0x0, 0x0, 0x7fff0000 }
-#    define __glibcpp_f128_denorm_min_bytes { 0x1, 0x0, 0x0, 0x0 }
 #  endif
 #  define __glibcpp_f128_has_QNaN true
 #  define __glibcpp_f128_has_SNaN true
-#  define __glibcpp_f128_has_denorm denorm_present
 #endif
 #ifndef __glibcpp_f128_QNaN_bytes
 #  define __glibcpp_f128_QNaN_bytes { }
@@ -294,10 +262,6 @@
 #  define __glibcpp_f128_SNaN_bytes { }
 #  define __glibcpp_f128_has_SNaN false
 #endif
-#ifndef __glibcpp_f128_denorm_min_bytes
-#  define __glibcpp_f128_denorm_min_bytes { }
-#  define __glibcpp_f128_has_denorm denorm_indeterminate
-#endif
 #ifndef __glibcpp_f128_is_iec559
 #  define __glibcpp_f128_is_iec559 false
 #endif
@@ -625,28 +589,22 @@
 #  define __glibcpp_float_round_error __glibcpp_f32_round_error
 #  define __glibcpp_float_QNaN_bytes  __glibcpp_f32_QNaN_bytes
 #  define __glibcpp_float_SNaN_bytes  __glibcpp_f32_SNaN_bytes
-#  define __glibcpp_float_denorm_min_bytes  __glibcpp_f32_denorm_min_bytes
 #  define __glibcpp_float_has_QNaN __glibcpp_f32_has_QNaN
 #  define __glibcpp_float_has_SNaN __glibcpp_f32_has_SNaN
-#  define __glibcpp_float_has_denorm __glibcpp_f32_has_denorm
 #  define __glibcpp_float_is_iec559 __glibcpp_f32_is_iec559
 #elif __FLOAT_BIT__ == 64
 #  define __glibcpp_float_round_error __glibcpp_f64_round_error
 #  define __glibcpp_float_QNaN_bytes  __glibcpp_f64_QNaN_bytes
 #  define __glibcpp_float_SNaN_bytes  __glibcpp_f64_SNaN_bytes
-#  define __glibcpp_float_denorm_min_bytes  __glibcpp_f64_denorm_min_bytes
 #  define __glibcpp_float_has_QNaN __glibcpp_f64_has_QNaN
 #  define __glibcpp_float_has_SNaN __glibcpp_f64_has_SNaN
-#  define __glibcpp_float_has_denorm __glibcpp_f64_has_denorm
 #  define __glibcpp_float_is_iec559 __glibcpp_f64_is_iec559
 #elif __FLOAT_BIT__ == 80
 #  define __glibcpp_float_round_error __glibcpp_f80_round_error
 #  define __glibcpp_float_QNaN_bytes  __glibcpp_f80_QNaN_bytes
 #  define __glibcpp_float_SNaN_bytes  __glibcpp_f80_SNaN_bytes
-#  define __glibcpp_float_denorm_min_bytes  __glibcpp_f80_denorm_min_bytes
 #  define __glibcpp_float_has_QNaN __glibcpp_f80_has_QNaN
 #  define __glibcpp_float_has_SNaN __glibcpp_f80_has_SNaN
-#  define __glibcpp_float_has_denorm __glibcpp_f80_has_denorm
 #  define __glibcpp_float_is_iec559 __glibcpp_f80_is_iec559
 #else
 // You must define these macros in the configuration file.
@@ -664,11 +622,6 @@
 #  define __glibcpp_float_has_SNaN false
 #endif
 
-#ifndef __glibcpp_float_denorm_min_bytes
-#  define __glibcpp_float_denorm_min_bytes { }
-#  define __glibcpp_float_has_denorm denorm_indeterminate
-#endif
-
 #ifndef __glibcpp_float_has_denorm_loss
 #  define __glibcpp_float_has_denorm_loss false
 #endif
@@ -703,28 +656,22 @@
 #  define __glibcpp_double_round_error __glibcpp_f32_round_error
 #  define __glibcpp_double_QNaN_bytes __glibcpp_f32_QNaN_bytes
 #  define __glibcpp_double_SNaN_bytes __glibcpp_f32_SNaN_bytes
-#  define __glibcpp_double_denorm_min_bytes __glibcpp_f32_denorm_min_bytes
 #  define __glibcpp_double_has_QNaN __glibcpp_f32_has_QNaN
 #  define __glibcpp_double_has_SNaN __glibcpp_f32_has_SNaN
-#  define __glibcpp_double_has_denorm __glibcpp_f32_has_denorm
 #  define __glibcpp_double_is_iec559 __glibcpp_f32_is_iec559
 #elif __DOUBLE_BIT__ == 64
 #  define __glibcpp_double_round_error __glibcpp_f64_round_error
 #  define __glibcpp_double_QNaN_bytes __glibcpp_f64_QNaN_bytes
 #  define __glibcpp_double_SNaN_bytes __glibcpp_f64_SNaN_bytes
-#  define __glibcpp_double_denorm_min_bytes __glibcpp_f64_denorm_min_bytes
 #  define __glibcpp_double_has_QNaN __glibcpp_f64_has_QNaN
 #  define __glibcpp_double_has_SNaN __glibcpp_f64_has_SNaN
-#  define __glibcpp_double_has_denorm __glibcpp_f64_has_denorm
 #  define __glibcpp_double_is_iec559 __glibcpp_f64_is_iec559
 #elif __DOUBLE_BIT__ == 80
 #  define __glibcpp_double_round_error __glibcpp_f80_round_error
 #  define __glibcpp_double_QNaN_bytes __glibcpp_f80_QNaN_bytes
 #  define __glibcpp_double_SNaN_bytes __glibcpp_f80_SNaN_bytes
-#  define __glibcpp_double_denorm_min_bytes __glibcpp_f80_denorm_min_bytes
 #  define __glibcpp_double_has_QNaN __glibcpp_f80_has_QNaN
 #  define __glibcpp_double_has_SNaN __glibcpp_f80_has_SNaN
-#  define __glibcpp_double_has_denorm __glibcpp_f80_has_denorm
 #  define __glibcpp_double_is_iec559 __glibcpp_f80_is_iec559
 #else
 // You must define these macros in the configuration file.
@@ -742,11 +689,6 @@
 #  define __glibcpp_double_has_SNaN false
 #endif
 
-#ifndef __glibcpp_double_denorm_min_bytes
-#  define __glibcpp_double_denorm_min_bytes { }
-#  define __glibcpp_double_has_denorm denorm_indeterminate
-#endif
-
 #ifndef __glibcpp_double_has_denorm_loss
 #  define __glibcpp_double_has_denorm_loss false
 #endif
@@ -781,46 +723,36 @@
 #  define __glibcpp_long_double_round_error __glibcpp_f32_round_error
 #  define __glibcpp_long_double_QNaN_bytes __glibcpp_f32_QNaN_bytes
 #  define __glibcpp_long_double_SNaN_bytes __glibcpp_f32_SNaN_bytes
-#  define __glibcpp_long_double_denorm_min_bytes __glibcpp_f32_denorm_min_bytes
 #  define __glibcpp_long_double_has_QNaN __glibcpp_f32_has_QNaN
 #  define __glibcpp_long_double_has_SNaN __glibcpp_f32_has_SNaN
-#  define __glibcpp_long_double_has_denorm __glibcpp_f32_has_denorm
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f32_is_iec559
 #elif __LONG_DOUBLE_BIT__ == 64
 #  define __glibcpp_long_double_round_error __glibcpp_f64_round_error
 #  define __glibcpp_long_double_QNaN_bytes __glibcpp_f64_QNaN_bytes
 #  define __glibcpp_long_double_SNaN_bytes __glibcpp_f64_SNaN_bytes
-#  define __glibcpp_long_double_denorm_min_bytes __glibcpp_f64_denorm_min_bytes
 #  define __glibcpp_long_double_has_QNaN __glibcpp_f64_has_QNaN
 #  define __glibcpp_long_double_has_SNaN __glibcpp_f64_has_SNaN
-#  define __glibcpp_long_double_has_denorm __glibcpp_f64_has_denorm
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f64_is_iec559
 #elif __LONG_DOUBLE_BIT__ == 80
 #  define __glibcpp_long_double_round_error __glibcpp_f80_round_error
 #  define __glibcpp_long_double_QNaN_bytes __glibcpp_f80_QNaN_bytes
 #  define __glibcpp_long_double_SNaN_bytes __glibcpp_f80_SNaN_bytes
-#  define __glibcpp_long_double_denorm_min_bytes __glibcpp_f80_denorm_min_bytes
 #  define __glibcpp_long_double_has_QNaN __glibcpp_f80_has_QNaN
 #  define __glibcpp_long_double_has_SNaN __glibcpp_f80_has_SNaN
-#  define __glibcpp_long_double_has_denorm __glibcpp_f80_has_denorm
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f80_is_iec559
 #elif __LONG_DOUBLE_BIT__ == 96
 #  define __glibcpp_long_double_round_error __glibcpp_f96_round_error
 #  define __glibcpp_long_double_QNaN_bytes __glibcpp_f96_QNaN_bytes
 #  define __glibcpp_long_double_SNaN_bytes __glibcpp_f96_SNaN_bytes
-#  define __glibcpp_long_double_denorm_min_bytes __glibcpp_f96_denorm_min_bytes
 #  define __glibcpp_long_double_has_QNaN __glibcpp_f96_has_QNaN
 #  define __glibcpp_long_double_has_SNaN __glibcpp_f96_has_SNaN
-#  define __glibcpp_long_double_has_denorm __glibcpp_f96_has_denorm
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f96_is_iec559
 #elif __LONG_DOUBLE_BIT__ == 128
 #  define __glibcpp_long_double_round_error __glibcpp_f128_round_error
 #  define __glibcpp_long_double_QNaN_bytes __glibcpp_f128_QNaN_bytes
 #  define __glibcpp_long_double_SNaN_bytes __glibcpp_f128_SNaN_bytes
-#  define __glibcpp_long_double_denorm_min_bytes __glibcpp_f128_denorm_min_bytes
 #  define __glibcpp_long_double_has_QNaN __glibcpp_f128_has_QNaN
 #  define __glibcpp_long_double_has_SNaN __glibcpp_f128_has_SNaN
-#  define __glibcpp_long_double_has_denorm __glibcpp_f128_has_denorm
 #  define __glibcpp_long_double_is_iec559 __glibcpp_f128_is_iec559
 #else
 // You must define these macros in the configuration file.
@@ -838,11 +770,6 @@
 #  define __glibcpp_long_double_has_SNaN false
 #endif
 
-#ifndef __glibcpp_long_double_denorm_min_bytes
-#  define __glibcpp_long_double_denorm_min_bytes { }
-#  define __glibcpp_long_double_has_denorm denorm_indeterminate
-#endif
-
 #ifndef __glibcpp_long_double_has_denorm_loss
 #  define __glibcpp_long_double_has_denorm_loss false
 #endif
@@ -918,15 +845,12 @@ namespace std
 
   extern const __float_storage __glibcpp_float_QNaN;
   extern const __float_storage __glibcpp_float_SNaN;
-  extern const __float_storage __glibcpp_float_denorm_min;
   
   extern const __double_storage __glibcpp_double_QNaN;
   extern const __double_storage __glibcpp_double_SNaN;
-  extern const __double_storage __glibcpp_double_denorm_min;
 
   extern const __long_double_storage __glibcpp_long_double_QNaN;
   extern const __long_double_storage __glibcpp_long_double_SNaN;
-  extern const __long_double_storage __glibcpp_long_double_denorm_min;
   
   enum float_round_style 
   {
@@ -1758,7 +1682,8 @@ namespace std
 	= __builtin_huge_valf () / 2 == __builtin_huge_valf ();
       static const bool has_quiet_NaN = __glibcpp_float_has_QNaN;
       static const bool has_signaling_NaN = __glibcpp_float_has_SNaN;
-      static const float_denorm_style has_denorm = __glibcpp_float_has_denorm;
+      static const float_denorm_style has_denorm
+	= __FLT_DENORM_MIN__ ? denorm_present : denorm_absent;
       static const bool has_denorm_loss = __glibcpp_float_has_denorm_loss;
 
       static float infinity() throw()
@@ -1768,7 +1693,7 @@ namespace std
       static float signaling_NaN() throw()
       { return *reinterpret_cast<const float*>(__glibcpp_float_SNaN); }
       static float denorm_min() throw()
-      { return *reinterpret_cast<const float*>(__glibcpp_float_denorm_min); }
+      { return __FLT_DENORM_MIN__; }
 
       static const bool is_iec559 = __glibcpp_float_is_iec559;
       static const bool is_bounded = __glibcpp_float_is_bounded;
@@ -1782,7 +1707,6 @@ namespace std
 #undef __glibcpp_float_round_error
 #undef __glibcpp_float_has_QNaN
 #undef __glibcpp_float_has_SNaN
-#undef __glibcpp_float_has_denorm
 #undef __glibcpp_float_has_denorm_loss
 #undef __glibcpp_float_is_iec559
 #undef __glibcpp_float_is_bounded
@@ -1821,8 +1745,8 @@ namespace std
 	= __builtin_huge_val () / 2 == __builtin_huge_val ();
       static const bool has_quiet_NaN = __glibcpp_double_has_QNaN;
       static const bool has_signaling_NaN = __glibcpp_double_has_SNaN;
-      static const float_denorm_style has_denorm =
-              __glibcpp_double_has_denorm;
+      static const float_denorm_style has_denorm
+	= __DBL_DENORM_MIN__ ? denorm_present : denorm_absent;
       static const bool has_denorm_loss = __glibcpp_double_has_denorm_loss;
 
       static double infinity() throw()
@@ -1832,7 +1756,7 @@ namespace std
       static double signaling_NaN() throw()
       { return *reinterpret_cast<const double*>(__glibcpp_double_SNaN); }
       static double denorm_min() throw()
-      { return *reinterpret_cast<const double*>(__glibcpp_double_denorm_min); }
+      { return __DBL_DENORM_MIN__; }
 
       static const bool is_iec559 = __glibcpp_double_is_iec559;
       static const bool is_bounded = __glibcpp_double_is_bounded;
@@ -1847,7 +1771,6 @@ namespace std
 #undef __glibcpp_double_round_error
 #undef __glibcpp_double_has_QNaN
 #undef __glibcpp_double_has_SNaN
-#undef __glibcpp_double_has_denorm
 #undef __glibcpp_double_has_denorm_loss
 #undef __glibcpp_double_is_iec559
 #undef __glibcpp_double_is_bounded
@@ -1887,10 +1810,10 @@ namespace std
 	= __builtin_huge_vall () / 2 == __builtin_huge_vall ();
       static const bool has_quiet_NaN = __glibcpp_long_double_has_SNaN;
       static const bool has_signaling_NaN = __glibcpp_long_double_has_SNaN;
-      static const float_denorm_style has_denorm =
-                __glibcpp_long_double_has_denorm;
-      static const bool has_denorm_loss =
-                __glibcpp_long_double_has_denorm_loss;
+      static const float_denorm_style has_denorm
+	= __LDBL_DENORM_MIN__ ? denorm_present : denorm_absent;
+      static const bool has_denorm_loss
+	= __glibcpp_long_double_has_denorm_loss;
 
       static long double infinity() throw()
       { return __builtin_huge_vall (); } 
@@ -1908,10 +1831,7 @@ namespace std
       }
       
       static long double denorm_min() throw()
-      {
-        return *reinterpret_cast<const long double*>
-          (__glibcpp_long_double_denorm_min);
-      }
+      { return __LDBL_DENORM_MIN__; }
 
       static const bool is_iec559 = __glibcpp_long_double_is_iec559;
       static const bool is_bounded = __glibcpp_long_double_is_bounded;
@@ -1926,7 +1846,6 @@ namespace std
 #undef __glibcpp_long_double_round_error
 #undef __glibcpp_long_double_has_QNaN
 #undef __glibcpp_long_double_has_SNaN
-#undef __glibcpp_long_double_has_denorm
 #undef __glibcpp_long_double_has_denorm_loss
 #undef __glibcpp_long_double_is_iec559
 #undef __glibcpp_long_double_is_bounded
Index: libstdc++-v3/src/limits.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/src/limits.cc,v
retrieving revision 1.7
diff -c -p -d -u -r1.7 limits.cc
--- libstdc++-v3/src/limits.cc	4 Sep 2002 23:22:18 -0000	1.7
+++ libstdc++-v3/src/limits.cc	5 Sep 2002 00:43:10 -0000
@@ -40,20 +40,14 @@ namespace std 
 {
   const __float_storage __glibcpp_float_QNaN = __glibcpp_float_QNaN_bytes;
   const __float_storage __glibcpp_float_SNaN = __glibcpp_float_SNaN_bytes;
-  const __float_storage __glibcpp_float_denorm_min =
-    __glibcpp_float_denorm_min_bytes;
 
   const __double_storage __glibcpp_double_QNaN = __glibcpp_double_QNaN_bytes;
   const __double_storage __glibcpp_double_SNaN = __glibcpp_double_SNaN_bytes;
-  const __double_storage __glibcpp_double_denorm_min =
-    __glibcpp_double_denorm_min_bytes;
 
   const __long_double_storage __glibcpp_long_double_QNaN =
     __glibcpp_long_double_QNaN_bytes;
   const __long_double_storage __glibcpp_long_double_SNaN =
     __glibcpp_long_double_SNaN_bytes;
-  const __long_double_storage __glibcpp_long_double_denorm_min =
-    __glibcpp_long_double_denorm_min_bytes;
 
   const bool __numeric_limits_base::is_specialized;
   const int  __numeric_limits_base::digits;



More information about the Libstdc++ mailing list