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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-12-30
             Status|UNCONFIRMED                 |NEW

--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> ---
The key insns (all in different blocks):


(insn 8 4 11 2 (set (reg:SI 137 [ _3 ])
        (subreg/s/u:SI (reg/v:DI 136 [ b ]) 0)) "j.c":4:20 284
{*movsi_internal}
     (nil))

(insn 12 22 13 3 (set (reg:SI 137 [ _3 ])
        (subreg/s/u:SI (reg/v:DI 135 [ a ]) 0)) "j.c":4:20 284
{*movsi_internal}
     (expr_list:REG_DEAD (reg/v:DI 135 [ a ])
        (nil)))

(insn 14 23 19 4 (set (reg:DI 141 [ _3 ])
        (sign_extend:DI (reg:SI 137 [ _3 ]))) "j.c":4:20 discrim 1 133
{*extendsidi2_internal}
     (expr_list:REG_DEAD (reg:SI 137 [ _3 ])
        (nil)))

There are two paths to insn 14.  One passes through insn 8, the other through
insn 12.  Point being those subreg copies actually sign extend for us.  So
while (reg:SI 137) is technically only 32 bits wide, we know in reality it'll
be sign extended out to 64 bits.  Meaning that all paths to insn 14 have
already extended the value and the extension is unnecessary.

Reply via email to