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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-02-05
     Ever confirmed|0                           |1

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
LRA generates reload:

(insn 45 0 0 (set (reg:V2DI 111)
        (subreg:V2DI (reg/v:DI 95 [ p2 ]) 0)) -1
     (nil))

With movdi_to_v2di, we get

(insn 45 40 15 3 (set (reg:V2DI 23 xmm2 [111])
        (subreg:V2DI (mem/c:DI (reg/f:SI 7 sp) [3 %sfp+-16 S8 A64]) 0)) x.i:13
1288 {*movdi_to_v2di}
     (nil))

Without movdi_to_v2di, simplify_operand_subreg in lra-constraints.c:

 /* If we change address for paradoxical subreg of memory, the
     address might violate the necessary alignment or the access might
     be slow.  So take this into consideration.  We should not worry
     about access beyond allocated memory for paradoxical memory
     subregs as we don't substitute such equiv memory (see processing
     equivalences in function lra_constraints) and because for spilled
     pseudos we allocate stack memory enough for the biggest
     corresponding paradoxical subreg.  */
  if (MEM_P (reg)
      && (! SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (reg))
          || MEM_ALIGN (reg) >= GET_MODE_ALIGNMENT (mode)))
    {
      rtx subst, old = *curr_id->operand_loc[nop];

      alter_subreg (curr_id->operand_loc[nop], false);
      subst = *curr_id->operand_loc[nop];
      lra_assert (MEM_P (subst));
      if (! valid_address_p (innermode, XEXP (reg, 0),
                             MEM_ADDR_SPACE (reg))
          || valid_address_p (GET_MODE (subst), XEXP (subst, 0),
                              MEM_ADDR_SPACE (subst)))
        return true;

turns

(subreg:V2DI (reg/v:DI 95 [ p2 ]) 0)

into

(mem/c:V2DI (reg/f:SI 7 sp) [3 %sfp+-16 S16 A128]

It looks that it is done on purpose.

Reply via email to