https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97628
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- Yes, I did mean 'if (num < 0) __builtin_unreachable ();' but as it turns out that doesn't help in this case. Casting to an unsigned type does and results in the expected range [0, 9].