https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123645
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-13 branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:2c374a328ec3c666069257bb0a0465500d4e44c8 commit r13-10131-g2c374a328ec3c666069257bb0a0465500d4e44c8 Author: Andrew Pinski <[email protected]> Date: Sat Jan 17 12:55:04 2026 -0800 phiopt: Rewrite cond_removal_in_builtin_zero_pattern canonicalization args code [PR123645] The canonicalization of args code was originally thinking edges e1/e2 were edges out going from the cond block but they were the edges coming into the join block. This rewrites the canonicalization of arg0/1 args to correct that mistake. And it fixes the wrong code that would happen in this case. PR tree-optimization/123645 gcc/ChangeLog: * tree-ssa-phiopt.cc (cond_removal_in_builtin_zero_pattern): Rewrite the canonicalization of the args code based on e1/e2 being edges into the join block. gcc/testsuite/ChangeLog: * gcc.dg/torture/pr123645-1.c: New test. * gcc.dg/torture/pr123645-2.c: New test. Signed-off-by: Andrew Pinski <[email protected]> (cherry picked from commit 92044aadb3037c59ea124c0b23f8437c9e48b2fd)
