https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96232
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:8c23434fdadcf4caa1f0e966294c5f67ccf4bcf9 commit r11-5805-g8c23434fdadcf4caa1f0e966294c5f67ccf4bcf9 Author: Jakub Jelinek <ja...@redhat.com> Date: Sun Dec 6 10:58:10 2020 +0100 [PATCH] phiopt: Handle bool in two_value_replacement [PR796232] The following patch improves code generation on the included testcase by enabling two_value_replacement on booleans. It does that only for arg0/arg1 values that conditional_replacement doesn't handle. Additionally it limits two_value_replacement optimization to the late phiopt like conditional_replacement. 2020-12-06 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/96232 * tree-ssa-phiopt.c (two_value_replacement): Optimize even boolean lhs cases as long as arg0 has wider precision and conditional_replacement doesn't handle that case. (tree_ssa_phiopt_worker): Don't call two_value_replacement during early phiopt. * gcc.dg/tree-ssa/pr96232-2.c: New test. * gcc.dg/tree-ssa/pr88676-2.c: Check phiopt2 dump rather than phiopt1.