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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernds at gcc dot gnu.org,
                   |                            |law at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
BTW, the reason why the costs are different is not something in backend's
control.
rtx_cost has:
    case SUBREG:
      total = 0;
      /* If we can't tie these modes, make this expensive.  The larger
         the mode, the more expensive it is.  */
      if (! MODES_TIEABLE_P (mode, GET_MODE (SUBREG_REG (x))))
        return COSTS_N_INSNS (2 + factor);
      break;
without the possibility of target to override this, and as for 32-bit arches
HARD_REGNO_MODE_NREGS is different between SImode and DImode, those are
required not to be tieable.
I fail to see why at least on i686/x86_64 for the word mode integral subregs of
integral double word mode there is any higher cost than of simple REG (i.e. 0)
though, if the pseudo the subreg is of is given a hard register, then reload
turns it into access of just one register of the GPR pair, and if it lives in a
stack slot, then reload can just load and/or store one half of the memory slot.

Reply via email to