gnu/gcc/4c341e52bfaf6f534e9e3b0ac14ab64d5ddf1deb 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 <andrew.pinski@oss.qualcomm.com>
(cherry picked from commit 92044aadb3037c59ea124c0b23f8437c9e48b2fd)
3 files changed