https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63862
--- Comment #1 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- If the middle-end handles arbitrary integer types for shift counts, it should be fine to remove this conversion (but check that the ubsan code will handle arbitrary integer types). I suspect this is also visible as an ubsan bug (that is, that these conversions will cause shifts by e.g. 0x100000000ULL not to be detected as undefined).