On 7/22/2026 9:24 AM, [email protected] wrote:
From: Kyrylo Tkachov <[email protected]>

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.
It may be over-aggressive in rejecting (imagine if we only have one hard register assignment in the block within the set of multiple assignments).  But I wouldn't really want to chase that kind of case without some evidence it matters.

So, OK.

Jeff

Reply via email to