https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118499
--- Comment #21 from anlauf at gcc dot gnu.org --- When doing x ** n in unsigned binary arithmetic, and x is an unsigned with k bits, and we do arithmetic modulo 2^k, then x ** n = x ** min (n, k) (mod 2^k) so we can immediately saturate the exponent. Does this also help?