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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-08-02
     Ever confirmed|0                           |1

--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> ---
So the code coming out of ext-dce looks quite sensible.   The key insns:

(insn 7 4 8 2 (set (reg:DI 31 [ _1 ])
        (subreg:DI (reg/v:SI 37 [ __major ]) 0)) "j.c":7:32 75 {*m68k.md:1568}
     (nil))
(insn 8 7 10 2 (set (reg:DI 39 [ _2 ])
        (ashift:DI (reg:DI 31 [ _1 ])
            (const_int 8 [0x8]))) "j.c":7:48 322 {*ashldi3}
     (expr_list:REG_DEAD (reg:DI 31 [ _1 ])
        (nil)))

Insn 7 had previously been a extension, but the upper bits aren't used and we
could safely turn it into a paradoxical subreg.

Combine's actions are sensible, combining insns 7 and 8 into:

(insn 8 7 10 2 (set (reg:DI 39 [ _2 ])
        (ashift:DI (subreg:DI (reg/v:SI 37 [ __major ]) 0)
            (const_int 8 [0x8]))) "j.c":7:48 322 {*ashldi3}
     (nil))

Still quite sensible.  IRA allocates (reg:SI 37) to d0.  Still quite sensible. 
We ultimately have this inside reload:

(insn 8 7 10 2 (set (reg:DI 8 %a0 [orig:39 _2 ] [39])
        (ashift:DI (subreg:DI (reg/v:SI 0 %d0 [orig:37 __major ] [37]) 0)
            (const_int 8 [0x8]))) "j.c":7:48 322 {*ashldi3}
     (nil))

Then reload blows up trying to ensure that op0/op1 match.  Looks like a reload
issue to me.

Reply via email to