https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127000

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Richard Biener
<[email protected]>:

https://gcc.gnu.org/g:c6a3791ccb1b46bfd6a353b8750ab57ab6f0a169

commit r16-9666-gc6a3791ccb1b46bfd6a353b8750ab57ab6f0a169
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.

    (cherry picked from commit 82b5610085b3b5e4d19d864d8f2a151461ce49a8)

Reply via email to