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

--- Comment #8 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:a4afea80fce5f1aafdd1174e48e9ebfc9ec8155d

commit r17-1537-ga4afea80fce5f1aafdd1174e48e9ebfc9ec8155d
Author: Andrew Pinski <[email protected]>
Date:   Sat Jun 13 09:38:08 2026 -0700

    phiopt: Fix is_factor_profitable for debug stmts [PR125776]

    This is a latent bug in is_factor_profitable where we would
    consider a debug statement as an use for lifetime usage
    afterwards. So you would get a compare debug failure in some
    cases. pr125776-2.c fails since r15-4503-g8d6d6d537fdc75.

    Pushed as obvious after a bootstrap/test.

            PR tree-optimization/125776

    gcc/ChangeLog:

            * tree-ssa-phiopt.cc (is_factor_profitable): An
            usage in a debug stmt should be ignored.

    gcc/testsuite/ChangeLog:

            * gcc.dg/torture/pr125776-1.c: New test.
            * gcc.dg/torture/pr125776-2.c: New test.

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

Reply via email to