https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122518
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Uros Bizjak <[email protected]>: https://gcc.gnu.org/g:0eb6b0f474ff13f5e98d2c26a3669fdd17b40dd4 commit r16-4936-g0eb6b0f474ff13f5e98d2c26a3669fdd17b40dd4 Author: Uros Bizjak <[email protected]> Date: Sun Nov 2 20:30:55 2025 +0100 i386: Canonicalize (compare (minus (a b)) a) to (compare (a b)) [PR122518] SUB (a, b) underflows precisely when a < b. Convert (compare (minus (a b)) a) to (compare (a b)) to match *sub<mode>_3 pattern. PR target/122518 gcc/ChangeLog: * config/i386/i386.cc (ix86_canonicalize_comparison): Convert (compare (minus (a b)) a) to (compare (a b)) to match *sub<mode>_3 pattern. gcc/testsuite/ChangeLog: * gcc.target/i386/pr122518.c: New test.
