https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123645
--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Andrew Pinski <[email protected]>: https://gcc.gnu.org/g:4c341e52bfaf6f534e9e3b0ac14ab64d5ddf1deb commit r15-10939-g4c341e52bfaf6f534e9e3b0ac14ab64d5ddf1deb 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)
