[PATCH] Making double precision constants work with -fsingle-precision-constant

Richard Henderson rth@redhat.com
Wed Dec 7 20:35:00 GMT 2005


On Wed, Dec 07, 2005 at 02:25:08PM -0500, Carlos O'Donell wrote:
> 	* gcc/c-cppbuiltin.c (builtin_define_float_constants): Add
> 	fp_cast parameter, pass to builtin_define_with_hex_fp_value.
> 	(builtin_define_with_hex_fp_value): Use fp_cast when building macro.
> 	(c_cpp_builtins): If flag_single_precision_constant then set fp_cast
> 	to "((double)%sL)" otherwise "%s".

This part looks ok, as far as it goes.

> 	* libstdc++-v3/include/std/std_limits.h
> 	[__DBL_DENORM_MIN__] (struct numeric_limits): Set denorm_present.
> 	[!__DBL_DENORM_MIN__] (struct numeric_limits): Set denorm_absent.

This part is wrong.  __DBL_DENORM_MIN__ will be defined, but 
evaluate to zero, if denormals are not supported.

Personally I think this option is very deeply flawed, for the
reasons shown by this patch.  And thus it should simply be
removed instead of hacked around in this way.


r~



More information about the Gcc-patches mailing list