Commit 4613543f by Richard Sandiford Committed by Richard Sandiford

simplify-rtx.c (simplify_unary_operation_1): Extend the handling of…

simplify-rtx.c (simplify_unary_operation_1): Extend the handling of SUBREG_PROMOTED_VAR_P to cope with cases where the...

gcc/
	* simplify-rtx.c (simplify_unary_operation_1): Extend the handling
	of SUBREG_PROMOTED_VAR_P to cope with cases where the extended value
	is smaller than the original promoted value.
	(simplify_subreg): If OP is a SUBREG, try to preserve its
	SUBREG_PROMOTED_VAR_P information.

From-SVN: r132755
parent 43e7fd21
2008-02-28 Richard Sandiford <rsandifo@nildram.co.uk>
* simplify-rtx.c (simplify_unary_operation_1): Extend the handling
of SUBREG_PROMOTED_VAR_P to cope with cases where the extended value
is smaller than the original promoted value.
(simplify_subreg): If OP is a SUBREG, try to preserve its
SUBREG_PROMOTED_VAR_P information.
2008-02-28 Steven Bosscher <stevenb.gcc@gmail.com> 2008-02-28 Steven Bosscher <stevenb.gcc@gmail.com>
* tree-ssa-sccvn (vn_ssa_aux_obstack): New obstack. * tree-ssa-sccvn (vn_ssa_aux_obstack): New obstack.
......
...@@ -859,8 +859,8 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op) ...@@ -859,8 +859,8 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
if (GET_CODE (op) == SUBREG if (GET_CODE (op) == SUBREG
&& SUBREG_PROMOTED_VAR_P (op) && SUBREG_PROMOTED_VAR_P (op)
&& ! SUBREG_PROMOTED_UNSIGNED_P (op) && ! SUBREG_PROMOTED_UNSIGNED_P (op)
&& GET_MODE (XEXP (op, 0)) == mode) && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (GET_MODE (XEXP (op, 0))))
return XEXP (op, 0); return rtl_hooks.gen_lowpart_no_emit (mode, op);
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) #if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
if (! POINTERS_EXTEND_UNSIGNED if (! POINTERS_EXTEND_UNSIGNED
...@@ -881,8 +881,8 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op) ...@@ -881,8 +881,8 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
if (GET_CODE (op) == SUBREG if (GET_CODE (op) == SUBREG
&& SUBREG_PROMOTED_VAR_P (op) && SUBREG_PROMOTED_VAR_P (op)
&& SUBREG_PROMOTED_UNSIGNED_P (op) > 0 && SUBREG_PROMOTED_UNSIGNED_P (op) > 0
&& GET_MODE (XEXP (op, 0)) == mode) && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (GET_MODE (XEXP (op, 0))))
return XEXP (op, 0); return rtl_hooks.gen_lowpart_no_emit (mode, op);
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend) #if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
if (POINTERS_EXTEND_UNSIGNED > 0 if (POINTERS_EXTEND_UNSIGNED > 0
...@@ -5021,7 +5021,22 @@ simplify_subreg (enum machine_mode outermode, rtx op, ...@@ -5021,7 +5021,22 @@ simplify_subreg (enum machine_mode outermode, rtx op,
return newx; return newx;
if (validate_subreg (outermode, innermostmode, if (validate_subreg (outermode, innermostmode,
SUBREG_REG (op), final_offset)) SUBREG_REG (op), final_offset))
return gen_rtx_SUBREG (outermode, SUBREG_REG (op), final_offset); {
newx = gen_rtx_SUBREG (outermode, SUBREG_REG (op), final_offset);
if (SUBREG_PROMOTED_VAR_P (op)
&& SUBREG_PROMOTED_UNSIGNED_P (op) >= 0
&& GET_MODE_CLASS (outermode) == MODE_INT
&& IN_RANGE (GET_MODE_SIZE (outermode),
GET_MODE_SIZE (innermode),
GET_MODE_SIZE (innermostmode))
&& subreg_lowpart_p (newx))
{
SUBREG_PROMOTED_VAR_P (newx) = 1;
SUBREG_PROMOTED_UNSIGNED_SET
(newx, SUBREG_PROMOTED_UNSIGNED_P (op));
}
return newx;
}
return NULL_RTX; return NULL_RTX;
} }
......
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