https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127000
--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Richard Biener <[email protected]>: https://gcc.gnu.org/g:82b5610085b3b5e4d19d864d8f2a151461ce49a8 commit r17-3592-g82b5610085b3b5e4d19d864d8f2a151461ce49a8 Author: Richard Biener <[email protected]> Date: Mon Aug 24 13:54:44 2026 +0200 tree-optimization/127000 - ICE with bogus match pattern The following fixes up the (T *)(ptr - ptr_cst) pattern to not rely on build_fold_addr_expr_with_type which can add unwanted casts. It also guards VN against such (sofar unexpected) results of simplification. PR tree-optimization/127000 * match.pd ((T *)(ptr - ptr_cst)): Use build1 to build an ADDR_EXPR. * tree-ssa-sccvn.cc (vn_nary_build_or_lookup_1): Avoid creating GIMPLE_SINGLE_RHS to insert stmts. * gcc.dg/torture/pr127000.c: New testcase.
