https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102134
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Roger Sayle from comment #6) > Many thanks to Jakub for the speedy fix. The diagnosis is quite right; I'd > assumed that if sgn is UNSIGNED, then arg would be zero extended. Alas, > that's not quite how widest_int represents things internally, so Jakub's "if > (lzcount)" is, I think, the correct fix. Sorry for the inconvenience. Yes, widest_ints are always signed (and sign-extended), you can view them as arbitrary precision signed integers.