https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89317
--- Comment #13 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:2dc5d6b1e7ec8822f5bd78761962ca2c85d4a2b4 commit r13-4607-g2dc5d6b1e7ec8822f5bd78761962ca2c85d4a2b4 Author: Richard Biener <rguent...@suse.de> Date: Mon Dec 12 08:13:33 2022 +0100 tree-optimization/89317 - another pattern for &p->x != p + 4 As seen in the original testcase for PR89317 we are missing comparison simplification patterns for &p->x != p + 4. Fixed by making an existing one apply. To make the pattern apply during CCP we need to simplify ccp_fold to not use GENERIC folding of conditions but also use GIMPLE folding. PR tree-optimization/89317 * tree-ssa-ccp.cc (ccp_fold): Handle GIMPLE_COND via gimple_fold_stmt_to_constant_1. * match.pd (&a != &a + c): Apply to pointer_plus with non-ADDR_EXPR base as well. * gcc.dg/tree-ssa/pr89317.c: Amend.