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

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

https://gcc.gnu.org/g:05e4bdd9390ce456301f007dd51baac29b07359f

commit r16-8944-g05e4bdd9390ce456301f007dd51baac29b07359f
Author: Jakub Jelinek <[email protected]>
Date:   Wed May 20 09:18:15 2026 +0200

    i386: Fix up peephole2s with const359_operand [PR125373]

    The following testcase ICEs, because the const359_operand peephole2s
    optimize multiplication of %rsp by 5 (or could by 3 or 9) into a lea.
    Which is not valid, because sp is not a valid index register.

    The following patch makes sure to use index_reg_operand predicate instead
    so that it won't match for the stack pointer.

    2026-05-20  Jakub Jelinek  <[email protected]>

            PR target/125373
            * config/i386/i386.md
            (Convert imul by three, five and nine into lea define_peephole2s):
Use
            index_reg_operand instead of register_operand.

            * gcc.c-torture/compile/pr125373.c: New test.

    Reviewed-by: Uros Bizjak <[email protected]>
    (cherry picked from commit 568d439f1d1f65eabed55a54da812a865dc5c946)

Reply via email to