This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR32083 - Use correct sign for -Inf in real.c's mpfr_from_real


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]