[Bug rtl-optimization/126184] [16/17 Regression] wrong code with ifcvt since r16-3760

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126184

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

https://gcc.gnu.org/g:9226f469f9e19783ac2d7fbb7498d73f75e079ac

commit r16-9422-g9226f469f9e19783ac2d7fbb7498d73f75e079ac
Author: Kyrylo Tkachov <[email protected]>
Date:   Wed Jul 22 16:45:16 2026 +0200

    ifcvt: Reject hard-register destinations in multiple sets [PR126184]

    noce_convert_multiple_sets keys its dependency information by destination
    register number.  Hard registers can have overlapping definitions in
    different modes.  An exact RTL replacement cannot represent the value from
a
    partial or mode-changing definition.

    Reject hard-register destinations in the block eligibility check.  Assert
    the resulting pseudo-only invariant when dependency information is
    initialized.

    Add an RTL execution test with mixed-mode hard-register definitions.  It
    verifies that the block remains unconverted.

    Bootstrapped and regtested on aarch64-none-linux-gnu and
    x86_64-pc-linux-gnu.

    gcc/ChangeLog:

            PR rtl-optimization/126184
            * ifcvt.cc (init_noce_multiple_sets_info): Assert that destinations
            are pseudos.
            (bb_ok_for_noce_convert_multiple_sets): Reject hard-register
            destinations.

    gcc/testsuite/ChangeLog:

            PR rtl-optimization/126184
            * gcc.target/aarch64/pr126184-2.c: New test.

    Signed-off-by: Kyrylo Tkachov <[email protected]>
    (cherry picked from commit 7b4d5b42a78859b30c9b48fa0a426effbbd71ff7)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.