Re: [PATCH] fold-const: Handle CTZ like CLZ in tree_call_nonnegative_warnv_p [PR115337]

2024-06-04 Thread Richard Biener
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. > >

[PATCH] fold-const: Handle CTZ like CLZ in tree_call_nonnegative_warnv_p [PR115337]

2024-06-04 Thread Jakub Jelinek
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?