From: Richard Kenner Date: Mon, 1 Mar 1993 12:31:19 +0000 (-0500) Subject: (subst_constants): Use proper mode when getting equivalent constant for paradoxical... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e2eb57b721527a5e8740fe5a25a90bb63cb7ee86;p=gcc.git (subst_constants): Use proper mode when getting equivalent constant for paradoxical SUBREG in SET_DEST. (subst_constants): Use proper mode when getting equivalent constant for paradoxical SUBREG in SET_DEST. (mark_stores): Clean up and tighten to properly handle hard regs. From-SVN: r3574 --- diff --git a/gcc/integrate.c b/gcc/integrate.c index c324facd789..1b358e10e33 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -2411,7 +2411,8 @@ subst_constants (loc, insn, map) && GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest))) <= UNITS_PER_WORD && (GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest))) <= GET_MODE_SIZE (GET_MODE (dest))) - && (tem = gen_lowpart_if_possible (GET_MODE (dest), src))) + && (tem = gen_lowpart_if_possible (GET_MODE (SUBREG_REG (dest)), + src))) src = tem, dest = SUBREG_REG (dest); /* If storing a recognizable value save it for later recording. */ @@ -2537,11 +2538,29 @@ mark_stores (dest, x) rtx dest; rtx x; { - if (GET_CODE (dest) == SUBREG) - dest = SUBREG_REG (dest); + int regno = -1; + enum machine_mode mode; + + /* DEST is always the innermost thing set, except in the case of + SUBREGs of hard registers. */ if (GET_CODE (dest) == REG) - global_const_equiv_map[REGNO (dest)] = 0; + regno = REGNO (dest), mode = GET_MODE (dest); + else if (GET_CODE (dest) == SUBREG && GET_CODE (SUBREG_REG (dest)) == REG) + { + regno = REGNO (SUBREG_REG (dest)) + SUBREG_WORD (dest); + mode = GET_MODE (SUBREG_REG (dest)); + } + + if (regno >= 0) + { + int last_reg = (regno >= FIRST_PSEUDO_REGISTER ? regno + : regno + HARD_REGNO_NREGS (regno, mode) - 1); + int i; + + for (i = regno; i <= last_reg; i++) + global_const_equiv_map[i] = 0; + } } /* If any CONST expressions with RTX_INTEGRATED_P are present in the rtx