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

--- Comment #2 from Ulrich Weigand <uweigand at gcc dot gnu.org> 2012-05-04 
16:03:35 UTC ---
Why do you consider this a reload/RA problem?  Code before ira looks like:

(insn 2 4 3 2 (set (reg/v:DI 62 [ i ])
        (mem/c:DI (reg/f:SI 16 argp) [2 i+0 S8 A32])) test.i:6 63
{*movdi_internal}
     (expr_list:REG_EQUIV (mem/c:DI (reg/f:SI 16 argp) [2 i+0 S8 A32])
        (nil)))

(insn 8 7 9 2 (clobber (reg:DI 60 [ D.1367 ])) test.i:7 -1
     (nil))

(insn 9 8 10 2 (set (subreg:SI (reg:DI 60 [ D.1367 ]) 0)
        (bswap:SI (subreg:SI (reg/v:DI 62 [ i ]) 4))) test.i:7 719
{*bswapsi2_movbe}
     (nil))

(insn 10 9 11 2 (set (subreg:SI (reg:DI 60 [ D.1367 ]) 4)
        (bswap:SI (subreg:SI (reg/v:DI 62 [ i ]) 0))) test.i:7 719
{*bswapsi2_movbe}
     (expr_list:REG_DEAD (reg/v:DI 62 [ i ])
        (nil)))

(insn 11 10 0 2 (set (mem/c:DI (symbol_ref:SI ("x") [flags 0x40]  <var_decl
0xb75e6a80 x>) [2 x+0 S8 A64])
        (reg:DI 60 [ D.1367 ])) test.i:7 63 {*movdi_internal}
     (expr_list:REG_DEAD (reg:DI 60 [ D.1367 ])
        (nil)))

with the memory accesses both in DImode, but the bswap already split into
SImode.  This causes the two DImode registers to be live at the same time, so
RA cannot allocate the same register for both.

Given the limited register availability on i386, which allocation would you
have suggested instead?

[ Note that I'd consider this a case where the moves certainly *ought* to have
been split into SImode, because:
- on i386 the moves will be split later on anyway
- accesses to subregs of the registers being moved already happens elsewhere. ]

Reply via email to