Commit 9dd791c8 by Alexandre Oliva Committed by Alexandre Oliva

rtlanal.c (replace_rtx): Don't make a CONST_INT the operand of SUBREG or ZERO_EXTEND.

* rtlanal.c (replace_rtx): Don't make a CONST_INT the operand of
SUBREG or ZERO_EXTEND.

From-SVN: r49935
parent 287dd527
Thu Feb 21 16:20:46 2002 Alexandre Oliva <aoliva@redhat.com>
* rtlanal.c (replace_rtx): Don't make a CONST_INT the operand of
SUBREG or ZERO_EXTEND.
Thu Feb 21 15:35:46 2002 J"orn Rennecke <joern.rennecke@superh.com> Thu Feb 21 15:35:46 2002 J"orn Rennecke <joern.rennecke@superh.com>
* sh.h (current_function_anonymous_args): Remove. * sh.h (current_function_anonymous_args): Remove.
......
...@@ -2417,6 +2417,40 @@ replace_rtx (x, from, to) ...@@ -2417,6 +2417,40 @@ replace_rtx (x, from, to)
if (x == 0) if (x == 0)
return 0; return 0;
if (GET_CODE (x) == SUBREG)
{
rtx new = replace_rtx (SUBREG_REG (x), from, to);
if (GET_CODE (new) == CONST_INT)
{
x = simplify_subreg (GET_MODE (x), new,
GET_MODE (SUBREG_REG (x)),
SUBREG_BYTE (x));
if (! x)
abort ();
}
else
SUBREG_REG (x) = new;
return x;
}
else if (GET_CODE (x) == ZERO_EXTEND)
{
rtx new = replace_rtx (XEXP (x, 0), from, to);
if (GET_CODE (new) == CONST_INT)
{
x = simplify_unary_operation (ZERO_EXTEND, GET_MODE (x),
new, GET_MODE (XEXP (x, 0)));
if (! x)
abort ();
}
else
XEXP (x, 0) = new;
return x;
}
fmt = GET_RTX_FORMAT (GET_CODE (x)); fmt = GET_RTX_FORMAT (GET_CODE (x));
for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--) for (i = GET_RTX_LENGTH (GET_CODE (x)) - 1; i >= 0; i--)
{ {
......
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