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

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

https://gcc.gnu.org/g:7f83719c13e9c8521a08ecba4cb8e3a6f6f48e2d

commit r17-2881-g7f83719c13e9c8521a08ecba4cb8e3a6f6f48e2d
Author: Andrea Pinski <[email protected]>
Date:   Sat Aug 1 16:17:25 2026 -0700

    phiopt: Factor loads, reject if the pointer types are not compatiable
[PR126571]

    In some cases (different address space and/or function pointers) pointers
are considered
    non-compatible. This means creating a phi with non-compatible pointers will
fail.
    This takes the easy way out and rejecting this case. This could be refined
to support
    the only case where address spaces are different but that case will show up
much less
    than the address space being different so it is not worth the trouble right
now.

    Pushed as obvious after bootstrap/test on x86_64-linux-gnu.

            PR tree-optimization/126571

    gcc/ChangeLog:

            * tree-ssa-phiopt.cc (factor_out_conditional_load): Reject
            when the pointer types are not compatible when creating a phi.

    gcc/testsuite/ChangeLog:

            * gcc.dg/torture/pr126571-1.c: New test.
            * gcc.target/i386/pr126571-1.c: New test.

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

Reply via email to