https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85406
--- Comment #1 from Allan Jensen <linux at carewolf dot com> --- Note it might be hard to figure out for the compiler that the result for a==255 will leave the input unchanged, but you can observe the same if you instead test for a == 0 (and return 0). In that case the compiler should have enough math deduction to be able to tell that the result of a==0 is always 0.