Re: [PATCH] fold-const: Fix up CLZ handling in tree_call_nonnegative_warnv_p [PR115337]

2024-06-04 Thread Richard Biener
On Tue, 4 Jun 2024, Jakub Jelinek wrote: > Hi! > > The function currently incorrectly assumes all the __builtin_clz* and .CLZ > calls have non-negative result. That is the case of the former which is UB > on zero and has [0, prec-1] return value otherwise, and is the case of the > single argumen

[PATCH] fold-const: Fix up CLZ handling in tree_call_nonnegative_warnv_p [PR115337]

2024-06-04 Thread Jakub Jelinek
Hi! The function currently incorrectly assumes all the __builtin_clz* and .CLZ calls have non-negative result. That is the case of the former which is UB on zero and has [0, prec-1] return value otherwise, and is the case of the single argument .CLZ as well (again, UB on zero), but for two argume