This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Making double precision constants work with -fsingle-precision-constant
- From: Carlos O'Donell <carlos at codesourcery dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Thu, 8 Dec 2005 11:48:54 -0500
- Subject: Re: [PATCH] Making double precision constants work with -fsingle-precision-constant
- References: <20051129021133.GB14313@lios> <20051129051045.GA19722@redhat.com> <20051207192507.GA8702@lios> <20051207203422.GB10702@redhat.com>
On Wed, Dec 07, 2005 at 12:34:22PM -0800, Richard Henderson wrote:
> 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.
Ok.
> > * 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.
Would it be useful to define __DBL_HAS_DENORM__, it is already a
property of the format (gcc/gcc/real.h)?
> 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.
It makes poorly written code run faster. If that isn't a compelling
argument for keeping the flag then I don't know what is... :)
c.