On 02/07/2017 09:08 AM, Matthew Fortune wrote:
Hi,

This patch is a minimal change to prevent (subreg(mem)) from being
simplified to use the outer mode for WORD_REGISTER_OPERATIONS.  There
is high probability of refining and/or re-implementing this for GCC 8
but such a change would be too invasive.  This change at least ensures
correctness but may prevent simplification of some acceptable cases.

No testcase here but I will try to make one using the RTL frontend
later.  This fix is required for mips64el-linux-gnu bootstrap
to succeed (in conjunction with patch 1 of this series). The specific
file affected by this bug is building gcc/predict.c where a bad reload
is created in predict_paths_for_bb.  Register 300 in the following
example is spilled to memory in SImode but reloaded as DImode.

(insn 247 212 389 3 (set (reg:SI 300)
         (ne:SI (subreg/s/u:SI (reg/v:DI 231 [ taken ]) 0)
             (const_int 0 [0]))) "/home/mfortune/gcc/gcc/predict.c":2904 504 
{*sne_zero_sisi}
      (nil))
...

(insn 250 256 251 40 (set (reg:DI 6 $6)
         (subreg:DI (reg:SI 300) 0)) "/home/mfortune/gcc/gcc/predict.c":2904 
310 {*movdi_64bit}
      (nil))

gcc/
        PR target/78660
        * lra-constraints.c (simplify_operand_subreg): Handle
        WORD_REGISTER_OPERATIONS targets.

This patch is OK too.  Thanks again.

Reply via email to