On Thu, 2 Nov 2023, Richard Biener via Gcc wrote: > Note the semantic of __builtin_clz is _not_ altered by > CLZ_DEFINED_VALUE_AT_ZERO, the behavior > of __builtin_clz (x) is that is has undefined result for x == 0.
Note also the discussion in bug 111309 of possible future type-generic versions of operations such as clz (under a different name because __builtin_clz is already taken), in order to support _BitInt, where there's a plausible argument for defining the result for all argument values rather than leaving it undefined at 0. -- Joseph S. Myers jos...@codesourcery.com