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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

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

commit r16-4239-ga7d8eca7244028990725ba01dd8a4ec6ebdac689
Author: Andrew Pinski <[email protected]>
Date:   Fri Oct 3 09:54:45 2025 -0700

    Introduce fold_before_rtl_expansion_p [PR122142]

    As requested in
https://inbox.sourceware.org/gcc-patches/CAFiYyc1jzZSZNhTas-DdMBFOzH1p96oGN=ovj6fyjt8hzdu...@mail.gmail.com/T/#u.
    This introduces fold_before_rtl_expansion_p to replace
    `(cfun->curr_properties & PROP_last_full_fold) != 0`.
    I am not a fan of include tree-pass.h in gimple-fold.h but that was the
    only way to reduce the number of changes.

    Bootrapped and tested on x86_64-linux-gnu.

            PR tree-optimization/122142
    gcc/ChangeLog:

            * generic-match-head.cc: Include gimple-iterator.h
            and gimple-fold.h.
            * gimple-fold.cc (gimple_fold_builtin_constant_p): Use
            fold_before_rtl_expansion_p.
            (gimple_fold_builtin_assume_aligned): Likewise.
            (gimple_fold_builtin_stdarg): Likewise.
            (gimple_fold_call): Likewise.
            * gimple-fold.h: Include "tree-pass.h".
            (fold_before_rtl_expansion_p): New function.
            * match.pd: Use fold_before_rtl_expansion_p
            instead of `cfun->curr_properties & PROP_last_full_fold`.
            * tree-ssa-forwprop.cc (simplify_builtin_memcmp): Likewise.
            (optimize_stack_restore): Likewise.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to