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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Philipp Tomsich <ptoms...@gcc.gnu.org>:

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

commit r15-3138-ga9f5e23aba1a6f4ec32f1147b340a8145d827da9
Author: Manolis Tsamis <manolis.tsa...@vrull.eu>
Date:   Tue Aug 20 09:16:29 2024 +0200

    ifcvt: Do not overwrite results in noce_convert_multiple_sets [PR116372,
PR116405]

    Now that more operations are allowed for noce_convert_multiple_sets,
    it is possible that the same register appears multiple times as target
    in a basic block.  After noce_convert_multiple_sets_1 is called we
    potentially also emit register moves from temporaries back to the
    original targets.  In some cases where the target registers overlap
    with the block's condition, these register moves may overwrite
    intermediate variables because they're emitted after the if-converted
    code.  To address this issue we now iterate backwards and keep track
    of seen registers when emitting these final register moves.

            PR rtl-optimization/116372
            PR rtl-optimization/116405

    gcc/ChangeLog:

            * ifcvt.cc (noce_convert_multiple_sets): Iterate backwards and
track
            target registers.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr116372.c: New test.
            * gcc.dg/pr116405.c: New test.

Reply via email to