Commit 0365ba7c by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/54862 (error: comparison between signed and unsigned integer…

re PR middle-end/54862 (error: comparison between signed and unsigned integer expressions in simplify-rtx.c)

	PR middle-end/54862
	* simplify-rtx.c (simplify_truncation): Compare UINTVAL instead of
	INTVAL of second argument with precision resp. op_precision.

From-SVN: r192302
parent f739e97a
2012-10-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/54862
* simplify-rtx.c (simplify_truncation): Compare UINTVAL instead of
INTVAL of second argument with precision resp. op_precision.
2012-10-10 Dodji Seketeli <dodji@redhat.com> 2012-10-10 Dodji Seketeli <dodji@redhat.com>
PR middle-end/54860 - Make sure attributes hash table is created PR middle-end/54860 - Make sure attributes hash table is created
......
...@@ -668,7 +668,7 @@ simplify_truncation (enum machine_mode mode, rtx op, ...@@ -668,7 +668,7 @@ simplify_truncation (enum machine_mode mode, rtx op,
&& CONST_INT_P (XEXP (op, 1)) && CONST_INT_P (XEXP (op, 1))
&& GET_CODE (XEXP (op, 0)) == SIGN_EXTEND && GET_CODE (XEXP (op, 0)) == SIGN_EXTEND
&& GET_MODE (XEXP (XEXP (op, 0), 0)) == mode && GET_MODE (XEXP (XEXP (op, 0), 0)) == mode
&& INTVAL (XEXP (op, 1)) < precision) && UINTVAL (XEXP (op, 1)) < precision)
return simplify_gen_binary (ASHIFTRT, mode, return simplify_gen_binary (ASHIFTRT, mode,
XEXP (XEXP (op, 0), 0), XEXP (op, 1)); XEXP (XEXP (op, 0), 0), XEXP (op, 1));
...@@ -680,7 +680,7 @@ simplify_truncation (enum machine_mode mode, rtx op, ...@@ -680,7 +680,7 @@ simplify_truncation (enum machine_mode mode, rtx op,
&& CONST_INT_P (XEXP (op, 1)) && CONST_INT_P (XEXP (op, 1))
&& GET_CODE (XEXP (op, 0)) == ZERO_EXTEND && GET_CODE (XEXP (op, 0)) == ZERO_EXTEND
&& GET_MODE (XEXP (XEXP (op, 0), 0)) == mode && GET_MODE (XEXP (XEXP (op, 0), 0)) == mode
&& INTVAL (XEXP (op, 1)) < precision) && UINTVAL (XEXP (op, 1)) < precision)
return simplify_gen_binary (LSHIFTRT, mode, return simplify_gen_binary (LSHIFTRT, mode,
XEXP (XEXP (op, 0), 0), XEXP (op, 1)); XEXP (XEXP (op, 0), 0), XEXP (op, 1));
...@@ -692,7 +692,7 @@ simplify_truncation (enum machine_mode mode, rtx op, ...@@ -692,7 +692,7 @@ simplify_truncation (enum machine_mode mode, rtx op,
&& (GET_CODE (XEXP (op, 0)) == ZERO_EXTEND && (GET_CODE (XEXP (op, 0)) == ZERO_EXTEND
|| GET_CODE (XEXP (op, 0)) == SIGN_EXTEND) || GET_CODE (XEXP (op, 0)) == SIGN_EXTEND)
&& GET_MODE (XEXP (XEXP (op, 0), 0)) == mode && GET_MODE (XEXP (XEXP (op, 0), 0)) == mode
&& INTVAL (XEXP (op, 1)) < precision) && UINTVAL (XEXP (op, 1)) < precision)
return simplify_gen_binary (ASHIFT, mode, return simplify_gen_binary (ASHIFT, mode,
XEXP (XEXP (op, 0), 0), XEXP (op, 1)); XEXP (XEXP (op, 0), 0), XEXP (op, 1));
...@@ -705,8 +705,7 @@ simplify_truncation (enum machine_mode mode, rtx op, ...@@ -705,8 +705,7 @@ simplify_truncation (enum machine_mode mode, rtx op,
&& 2 * precision <= op_precision && 2 * precision <= op_precision
&& CONST_INT_P (XEXP (op, 1)) && CONST_INT_P (XEXP (op, 1))
&& (INTVAL (XEXP (op, 1)) & (precision - 1)) == 0 && (INTVAL (XEXP (op, 1)) & (precision - 1)) == 0
&& INTVAL (XEXP (op, 1)) >= 0 && UINTVAL (XEXP (op, 1)) < op_precision)
&& INTVAL (XEXP (op, 1)) < op_precision)
{ {
int byte = subreg_lowpart_offset (mode, op_mode); int byte = subreg_lowpart_offset (mode, op_mode);
int shifted_bytes = INTVAL (XEXP (op, 1)) / BITS_PER_UNIT; int shifted_bytes = INTVAL (XEXP (op, 1)) / BITS_PER_UNIT;
......
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