https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113894
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <[email protected]>: https://gcc.gnu.org/g:01d1d20266a4c1f02457dd9df1b25a733d701466 commit r17-2360-g01d1d20266a4c1f02457dd9df1b25a733d701466 Author: Odysseas Georgoudis <[email protected]> Date: Mon Jul 13 10:09:10 2026 -0600 match.pd: Recognize branchless conditional negate [PR113894] This patch teaches match.pd to recognize the branchless conditional negate idiom (x ^ -cmp) + cmp when cmp is known to be zero or one. The expression is folded to a conditional negate form. For the sign-test spelling based on x < 0, the patch exposes ABS_EXPR. PR tree-optimization/113894 gcc/ChangeLog: * match.pd: Add simplifications for branchless conditional negate and sign-test absolute value idioms. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr113894.c: New test.
