On 5/4/2026 4:15 AM, Eikansh Gupta wrote:
Adds a pattern to fold (x - (x<0)) ^ -(x<0) into ABS_EXPR<x>.

        PR 123514

gcc/ChangeLog:

        * match.pd (x - (x<0)) ^ -(x<0) into ABS_EXPR<x>): New pattern.

gcc/testsuite/ChangeLog:

        * gcc.dg/tree-ssa/pr123514.c: New test.
OK and I've pushed this to the trunk.  I was concerned about what happens around INT_MIN, but ultimately convinced myself they both have the same behavior WRT INT_MIN.

Thanks,

jeff

Reply via email to