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

--- Comment #23 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:fae0c626250563c1619cc10c6af18a0c4cae5a97

commit r16-5975-gfae0c626250563c1619cc10c6af18a0c4cae5a97
Author: Andrew Pinski <[email protected]>
Date:   Sat Dec 6 01:11:29 2025 -0800

    final_cleanup: Call make_forwarders_with_degenerate_phis [PR46555]

    This fixes a regression introduced with r16-5258-g1d8e2d51e5c5cb.
    With GCC 12+, we would not merge forwarders (with phis, vops included),
    this meant that after the last cddce, degenerate phis would stay not
    merged which allowed for better expansion. Now after my patch, the
forwarder
    block would be removed and get worse expansion. This fixes the problem
    by creating the forwarder blocks in "optimized" and no other cleanupcfg
    is called afterwards.

    Oh this also fixes the problem at -O1 which was missed because the
agressive
    version of dce was not done at -O1.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR tree-optimization/46555
    gcc/ChangeLog:

            * tree-cfgcleanup.cc (execute_cleanup_cfg_post_optimizing):
            Don't set todo to include cleanupcfg; do it manually.
            Call make_forwarders_with_degenerate_phis if optimizing.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/pr46555.c: New test.

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

Reply via email to