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

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #7)
> The problematic insn is "xor 4(%rsp), %edx". LRA should *not* simplify
> paradoxical memory subreg to a load in a wide mode. It should reload the
> value to a temporary QImode register in a narrow mode and use temporary
> register as SImode register in XOR.
> 
> So, this exposes LRA issue. Any other fix will paper over it.

Yes it is LRA. Before LRA we have:

(insn 219 218 220 3 (parallel [
            (set (reg:SI 146 [ _47 ])
                (xor:SI (reg:SI 343 [ df_91 ])
                    (subreg:SI (reg/v:QI 160 [ dl ]) 0)))
            (clobber (reg:CC 17 flags))
        ]) "pr127606.c":180:13 860 {*xorsi_1}
     (expr_list:REG_DEAD (reg:SI 343 [ df_91 ])
        (expr_list:REG_UNUSED (reg:CC 17 flags)
            (nil))))

Which LRA transforms to:

(insn 380 381 365 3 (set (mem/c:QI (plus:DI (reg/f:DI 7 sp)
                (const_int 4 [0x4])) [11 %sfp+-52 S1 A32])
        (reg/v:QI 4 si [orig:160 dl ] [160])) "pr127606.c":180:13 102
{*movqi_internal}
     (nil))
(insn 365 380 219 3 (set (reg:SI 2 cx [410])
        (mem/c:SI (plus:DI (reg/f:DI 7 sp)
                (const_int 4 [0x4])) [11 %sfp+-52 S4 A32])) "pr127606.c":180:13
100 {*movsi_internal}
     (nil))
(insn 219 365 220 3 (parallel [
            (set (reg:SI 1 dx [orig:146 _47 ] [146])
                (xor:SI (reg:SI 1 dx [orig:343 df_91 ] [343])
                    (reg:SI 2 cx [410])))
            (clobber (reg:CC 17 flags))
        ]) "pr127606.c":180:13 860 {*xorsi_1}
     (nil))

Please note spill in QImode and fill in SImode.

Reply via email to