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

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

https://gcc.gnu.org/g:517d45af94f98f2c8c8bdf5231aa662c82b46c13

commit r17-1375-g517d45af94f98f2c8c8bdf5231aa662c82b46c13
Author: Konstantinos Eleftheriou <[email protected]>
Date:   Tue Mar 31 05:12:33 2026 -0700

    avoid-store-forwarding: Re-apply extension after bit insert sequence
[PR124713]

    The avoid-store-forwarding pass loses SIGN_EXTEND/ZERO_EXTEND
    semantics when the forwarding target is an extending load that is
    not fully eliminated.  The bit-field insert operates on the
    full-width destination register, but does not re-apply the
    extension, leaving stale upper bits from the original load.

    Fix by emitting the corresponding extension after the bit insert
    sequence for non-eliminated extending loads, mirroring what the
    load-elimination path already does.

            PR rtl-optimization/124713

    gcc/ChangeLog:

            * avoid-store-forwarding.cc (process_store_forwarding): Re-apply
            SIGN_EXTEND/ZERO_EXTEND after bit insert sequence when the load is
            not eliminated.

    gcc/testsuite/ChangeLog:

            * gcc.target/aarch64/pr124713.c: New test.

Reply via email to