This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix folding of logb (-Inf) (PR tree-optimization/57066)
- From: Marc Glisse <marc dot glisse at inria dot fr>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 25 Apr 2013 15:37:35 +0200 (CEST)
- Subject: Re: [PATCH] Fix folding of logb (-Inf) (PR tree-optimization/57066)
- References: <20130425132350 dot GM13346 at redhat dot com>
- Reply-to: GCC Patches <gcc-patches at gcc dot gnu dot org>
On Thu, 25 Apr 2013, Marek Polacek wrote:
This is an attempt to fix PR57066, where when folding logb call,
we returned -Inf for logb(-Inf), which is not correct.
I had to adjust one testcase, because it checked for a wrong value.
What I don't know yet is what we should return for -Nan, it should be
in C9X standard, but I don't have it by hand.
Doesn't matter:
"Recommended practice
If a function with one or more NaN arguments returns a NaN result, the
result should be the same as one of the NaN arguments (after possible type
conversion), except perhaps for the sign."
"F.9.3.11 The logb functions
â logb(Â0) returns ââ and raises the ââdivide-by-zeroââ floating-point
exception.
â logb(Ââ) returns â."
--
Marc Glisse