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: [PATCH] Fix folding of logb (-Inf) (PR tree-optimization/57066)


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  <polacek@redhat.com>
>  
>         * builtins.c (fold_builtin_logb): Return +Inf for -Inf.
>  
>         * gcc.dg/torture/builtin-logb-1.c: Adjust testcase.

Yes, thanks.

	Jakub


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