[Bug target/57088] Register allocator has an issue with subreg in some cases

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Apr 27 01:06:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57088

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-27
            Summary|Post-reload instruction     |Register allocator has an
                   |splitting clobbers live     |issue with subreg in some
                   |register                    |cases
     Ever Confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-04-27 01:06:12 UTC ---
We start out with:
(insn 25 24 26 2 (set (mem:SI (plus:SI (reg/f:SI 7 sp)
                (const_int 4 [0x4])) [0 S4 A32])
        (subreg:SI (reg:DI 78 [ n ]) 0)) t.cc:41 85 {*movsi_internal}
     (expr_list:REG_DEAD (reg:DI 78 [ n ])
        (nil)))
(insn 26 25 27 2 (set (mem:SI (reg/f:SI 7 sp) [0 S4 A32])
        (reg/v/f:SI 59 [ save_buf ])) t.cc:41 85 {*movsi_internal}
     (nil))

which is fine but after reload we have:
(insn 59 24 25 2 (set (reg:DI 1 dx [orig:78 n ] [78])
        (mem/c:DI (plus:SI (reg/f:SI 6 bp)
                (const_int -48 [0xffffffffffffffd0])) [9 %sfp+-48 S8 A64]))
t.cc:41 84 {*movdi_internal}
     (expr_list:REG_DEAD (reg:DI 92)
        (nil)))
(insn 25 59 26 2 (set (mem:SI (plus:SI (reg/f:SI 7 sp)
                (const_int 4 [0x4])) [0 S4 A32])
        (reg:SI 1 dx [orig:78 n ] [78])) t.cc:41 85 {*movsi_internal}
     (expr_list:REG_DEAD (reg:DI 1 dx [orig:78 n ] [78])
        (nil)))
(insn 26 25 56 2 (set (mem:SI (reg/f:SI 7 sp) [0 S4 A32])
        (reg/v/f:SI 2 cx [orig:59 save_buf ] [59])) t.cc:41 85
{*movsi_internal}
     (nil))
(insn 56 26 27 2 (set (mem/c:SI (plus:SI (reg/f:SI 6 bp)
                (const_int -52 [0xffffffffffffffcc])) [9 %sfp+-52 S4 A32])
        (reg/v/f:SI 2 cx [orig:59 save_buf ] [59])) t.cc:41 85
{*movsi_internal}
     (expr_list:REG_DEAD (reg/v/f:SI 2 cx [orig:59 save_buf ] [59])
        (nil)))


Which is broken as the set in insn 59 overwrites (reg 1) which is not used from
that part of the instruction.

Confirmed.



More information about the Gcc-bugs mailing list