https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101254
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Comment on attachment 51084 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51084 another patch Except for some consistency (max is in comments lowercase, but MIN is uppercase), it looks good to me. Slightly OT, wonder if something tries to handle even the swapped arguments, i.e. relation op1 < op2 and subtraction op2 - op1. But that can be done incrementally if not done yet...