This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/29335] transcendental functions with constant arguments should be resolved at compile-time
- From: "ghazi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 7 Oct 2006 02:04:49 -0000
- Subject: [Bug middle-end/29335] transcendental functions with constant arguments should be resolved at compile-time
- References: <bug-29335-578@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from ghazi at gcc dot gnu dot org 2006-10-07 02:04 -------
(In reply to comment #6)
> > > There is mpfr_get_ld(), which converts to a long double. If the data type
> > > never exceeds the properties of long double, then one may be able to
> > > use mpfr_get_ld() and then fold_convert() the result to the proper type.
> >
> > I think using long double defeats the whole purpose of using mpfr.
> It appears you misread what I wrote (or meant to write). "If the data
> type never exceeds the properties of long double" applies to a cross
> compiler as well where "data type" is on the target and "long double"
> is on the host.
> > We're
> > supposed to avoid relying on the properties of the host's floating point for
> > cross-compilers where the target format is different.
> The host's long double is simply an intermediate representation of the
> value. It is the responsibility of the fold_convert to get the right
> target representation. This is no different than using strings as the
> intermediate.
I want the optimization to work always, not just in certain host/target
combinations. So I'll use strings, no big deal.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29335