On Tue, 4 Jun 2024, Jakub Jelinek wrote:

> Hi!
> 
> I think we can handle CTZ exactly like CLZ in tree_call_nonnegative_warnv_p.
> Like CLZ, if it is UB at zero, the result range is [0, prec-1] and if it is
> well defined at zero, the second argument provides the value at zero.
> 
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

OK.

Richard.

> 2024-06-04  Jakub Jelinek  <ja...@redhat.com>
> 
>       PR tree-optimization/115337
>       * fold-const.cc (tree_call_nonnegative_warnv_p): Handle
>       CASE_CFN_CTZ like CASE_CFN_CLZ.
> 
> --- gcc/fold-const.cc.jj      2024-06-04 12:08:14.671262211 +0200
> +++ gcc/fold-const.cc 2024-06-04 10:56:57.575425348 +0200
> @@ -15250,6 +15250,7 @@ tree_call_nonnegative_warnv_p (tree type
>        return true;
>  
>      CASE_CFN_CLZ:
> +    CASE_CFN_CTZ:
>        if (arg1)
>       return RECURSE (arg1);
>        return true;
> 
>       Jakub
> 
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE Software Solutions Germany GmbH,
Frankenstrasse 146, 90461 Nuernberg, Germany;
GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)

Reply via email to