This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR32083 - Use correct sign for -Inf in real.c's mpfr_from_real
- From: Tobias Burnus <burnus at net-b dot de>
- To: Brooks Moses <brooks dot moses at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Sun, 27 May 2007 10:20:49 +0200
- Subject: Re: PR32083 - Use correct sign for -Inf in real.c's mpfr_from_real
- References: <4658ACDB.7040604@net-b.de> <4658C56E.4000902@codesourcery.com>
Brooks Moses schrieb:
>> + mpfr_set_inf (m, r->sign == 1 ? -1 : 1);
> It looks like all of the other uses of "sign" in real.c leave off the
> "== 1", and just have "r->sign ? -1 : 1", so this should probably be
> changed to that form.
I think the other are ok and this is the only place where
REAL_VALUE_TYPE and mpfr are used in the same command. As long as one
has only REAL_VALUE_TYPE's signs or only mpfr signs, one remains consistent.
(The other place where mpfr and REAL_VALUE_TYPE are used together is
real_from_mpfr, but that one is ok:
if (mpfr_sgn (m) < 0)
*r = REAL_VALUE_NEGATE (*r);
)
> I'm obviously not a middle-end maintainer, but I _did_ write the code
> in question, and this correction seems obvious to me, so I think it's
> okay to commit on that basis.
I committed it now as obvious (r125108).
Tobias