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

--- Comment #20 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by H.J. Lu <h...@gcc.gnu.org>:

https://gcc.gnu.org/g:14879ba89a4f9d2263472dca1423b584c1236586

commit r15-6728-g14879ba89a4f9d2263472dca1423b584c1236586
Author: H.J. Lu <hjl.to...@gmail.com>
Date:   Wed Jan 8 20:50:04 2025 +0800

    ree: Skip extension on fixed register

    Skip extension on fixed register since we can't turn

    (insn 27 26 139 2 (parallel [
                (set (reg/f:SI 7 sp)
                    (plus:SI (reg/f:SI 7 sp)
                        (const_int 16 [0x10])))
                (clobber (reg:CC 17 flags))
            ]) "x.ii":14:17 discrim 1 283 {*addsi_1}
         (expr_list:REG_ARGS_SIZE (const_int 0 [0])
            (nil)))
    ...
    (insn 43 125 74 2 (set (reg/f:DI 6 bp [145])
            (zero_extend:DI (reg/f:SI 7 sp))) "x.ii":15:9 175
{*zero_extendsidi2}
         (nil))

    into

    (insn 27 26 155 2 (parallel [
                (set (reg:DI 6 bp)
                    (zero_extend:DI (plus:SI (reg/f:SI 7 sp)
                            (const_int 16 [0x10]))))
                (clobber (reg:CC 17 flags))
            ]) "x.ii":14:17 discrim 1 296 {addsi_1_zext}
         (expr_list:REG_ARGS_SIZE (const_int 0 [0])
            (nil)))
    (insn 155 27 139 2 (set (reg:DI 7 sp)
            (reg:DI 6 bp)) "x.ii":14:17 discrim 1 -1
         (nil))

    without updating stack frame info.

    gcc/

            PR rtl-optimization/118266
            * ree.cc (add_removable_extension): Skip extension on fixed
            register.

    gcc/testsuite/

            PR rtl-optimization/118266
            * gcc.target/i386/pr118266.c: New test.

    Signed-off-by: H.J. Lu <hjl.to...@gmail.com>

Reply via email to