On Thu, Apr 25, 2013 at 05:43:30PM +0200, Marek Polacek wrote:
> On Thu, Apr 25, 2013 at 05:31:29PM +0200, Jakub Jelinek wrote:
> > > + /* For logb(-Inf) we have to return +Inf. */
> > > + if (value->cl == rvc_inf && !tree_expr_nonnegative_p (arg))
> >
> > Why not
> > if (value->cl == rvc_inf && value->sign)
> > or
> > if (real_isinf (value) && real_isneg (value))
> > instead?
>
> That's better, yeah.
> I was searching for something that tells me whether *tree* is
> negative, and not REAL_VALUE_TYPE. I like the second variant more.
> Thanks.
>
> Ok for trunk/4.8/4.7?
>
> 2013-04-25 Marek Polacek <[email protected]>
>
> * builtins.c (fold_builtin_logb): Return +Inf for -Inf.
>
> * gcc.dg/torture/builtin-logb-1.c: Adjust testcase.
Yes, thanks.
Jakub