https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110269
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:827e208fa64771f15fc8e53970a2297e637277b5 commit r14-1880-g827e208fa64771f15fc8e53970a2297e637277b5 Author: Richard Biener <rguent...@suse.de> Date: Fri Jun 16 08:55:12 2023 +0200 tree-optimization/110269 - restore missed condition folding The following makes sure we optimize x != 0 using range info via tree_expr_nonzero_p via match.pd. PR tree-optimization/110269 * fold-const.cc (fold_binary_loc): Merge x != 0 folding with tree_expr_nonzero_p ... * match.pd (cmp (convert? addr@0) integer_zerop): With this pattern. * gcc.dg/tree-ssa/pr110269.c: New testcase.