https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105142
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- If so, that must be still during ifcombine though. Because what I see is that we have effectively MIN_EXPR <a, MIN_EXPR <a, c> + large_cst> until threadfull1, which decides to thread it based on the a < c comparison, if a < c, then the result is just a and the addition is optimized away as unused, otherwise effectively MIN_EXPR <c + large_cst, a> is done. I believe that is a correct transformation, because for undefined overflow arithmetics (with no wrap around) a < c && a < c + large_cst is equivalent.