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

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

https://gcc.gnu.org/g:f9a6efa7a71e80a0989ac91fb7f282468471bb46

commit r16-1724-gf9a6efa7a71e80a0989ac91fb7f282468471bb46
Author: Alexandre Oliva <[email protected]>
Date:   Thu Jun 26 21:01:29 2025 -0300

    [lra] catch all to-sp eliminations with nonzero offsets [PR120424]

    An x86_64-linux-gnu native with ix86_frame_pointer_required modified
    to return true for nonzero frames, to exercize
    lra_update_fp2sp_elimination, reveals in stage1 testing that wrong
    code is generated for gcc.c-torture/execute/ieee/fp-cmp-8l.c:
    argp-to-sp eliminations are used for one_test to pass its arguments on
    to *pos, and the sp offsets survive the disabling of that elimination.

    We didn't really have to disable that elimination, but the x86 backend
    disables eliminations to sp if frame_pointer_needed.

    This change extends the catching of fp2sp eliminations to all (?)
    eliminations to sp with nonzero offsets, since none of them can be
    properly reversed and would silently lead to wrong code.

    By accepting nonzero offsets, we bootstrap with
    -maccumulate-outgoing-args on x86_64-linux-gnu (with
    ix86_frame_pointer_required modified to return true on nonzero frame
    size).


    for  gcc/ChangeLog

            PR rtl-optimization/120424
            * lra-eliminations.cc (elimination_2sp_occurred_p): Rename
            from...
            (elimination_fp2sp_occured_p): ... this.  Adjust all uses.
            (lra_eliminate_regs_1): Don't require a from-frame-pointer
            elimination to set it.
            (update_reg_eliminate): Likewise to test it.

Reply via email to