https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112752
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I made a small mistake into what it should be optimized to: The MIN should be MAX (oops): that is: tmp = MAX(r, g); k = MAX(b, tmp);