Commit 15941d29 by Richard Henderson Committed by Jeff Law

combine.c (simplify_rtx): Obey CLASS_CANNOT_CHANGE_SIZE when simplifying a subreg of a hard reg.

        * combine.c (simplify_rtx): Obey CLASS_CANNOT_CHANGE_SIZE when
        simplifying a subreg of a hard reg.
        (expand_compound_operation): Likewise.
        (force_to_mode): Likewise.

From-SVN: r18052
parent d84a12e2
Tue Feb 17 22:56:14 1998 Richard Henderson <rth@cygnus.com>
* combine.c (simplify_rtx): Obey CLASS_CANNOT_CHANGE_SIZE when
simplifying a subreg of a hard reg.
(expand_compound_operation): Likewise.
(force_to_mode): Likewise.
Tue Feb 17 22:37:22 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> Tue Feb 17 22:37:22 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (gcc.o): Depend on system.h, in accordance with last * Makefile.in (gcc.o): Depend on system.h, in accordance with last
......
...@@ -3483,6 +3483,13 @@ simplify_rtx (x, op0_mode, last, in_dest) ...@@ -3483,6 +3483,13 @@ simplify_rtx (x, op0_mode, last, in_dest)
if (GET_CODE (SUBREG_REG (x)) == REG if (GET_CODE (SUBREG_REG (x)) == REG
&& REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER && REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER
#ifdef CLASS_CANNOT_CHANGE_SIZE
&& (! (TEST_HARD_REG_BIT
(reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE],
REGNO (SUBREG_REG (x))))
|| (GET_MODE_SIZE (mode)
== GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
#endif
&& REGNO (SUBREG_REG (x)) != FRAME_POINTER_REGNUM && REGNO (SUBREG_REG (x)) != FRAME_POINTER_REGNUM
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM #if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
&& REGNO (SUBREG_REG (x)) != HARD_FRAME_POINTER_REGNUM && REGNO (SUBREG_REG (x)) != HARD_FRAME_POINTER_REGNUM
...@@ -5106,6 +5113,20 @@ expand_compound_operation (x) ...@@ -5106,6 +5113,20 @@ expand_compound_operation (x)
int modewidth; int modewidth;
rtx tem; rtx tem;
#ifdef CLASS_CANNOT_CHANGE_SIZE
/* When dealing with hard regs that cannot change size, don't even try
expanding to shifts, since we wind up violating the rule. */
if (GET_RTX_CLASS (GET_CODE (x)) == '1'
&& GET_CODE (XEXP (x, 0)) == REG
&& REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER
&& (TEST_HARD_REG_BIT
(reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE],
REGNO (SUBREG_REG (x))))
&& (GET_MODE_SIZE (GET_MODE (x))
!= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
return x;
#endif
switch (GET_CODE (x)) switch (GET_CODE (x))
{ {
case ZERO_EXTEND: case ZERO_EXTEND:
...@@ -6222,6 +6243,17 @@ force_to_mode (x, mode, mask, reg, just_select) ...@@ -6222,6 +6243,17 @@ force_to_mode (x, mode, mask, reg, just_select)
break; break;
case SUBREG: case SUBREG:
#ifdef CLASS_CANNOT_CHANGE_SIZE
if (GET_CODE (SUBREG_REG (x)) == REG
&& REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER
&& (TEST_HARD_REG_BIT
(reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE],
REGNO (SUBREG_REG (x))))
&& (GET_MODE_SIZE (GET_MODE (x))
!= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))))
return x;
#endif
if (subreg_lowpart_p (x) if (subreg_lowpart_p (x)
/* We can ignore the effect of this SUBREG if it narrows the mode or /* We can ignore the effect of this SUBREG if it narrows the mode or
if the constant masks to zero all the bits the mode doesn't if the constant masks to zero all the bits the mode doesn't
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment