Commit f99391fe by Ulrich Weigand Committed by Ulrich Weigand

combine.c (force_to_mode): Avoid undefined behaviour due to negative shift amount.

	* combine.c (force_to_mode) [LSHIFTRT]: Avoid undefined behaviour
	due to negative shift amount.

From-SVN: r189347
parent 755e0546
2012-07-07 Ulrich Weigand <ulrich.weigand@linaro.org>
* combine.c (force_to_mode) [LSHIFTRT]: Avoid undefined behaviour
due to negative shift amount.
2012-07-07 Hans-Peter Nilsson <hp@axis.com> 2012-07-07 Hans-Peter Nilsson <hp@axis.com>
Fix configure test for "stack protector support in target C library". Fix configure test for "stack protector support in target C library".
......
...@@ -8433,6 +8433,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask, ...@@ -8433,6 +8433,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask,
in OP_MODE. */ in OP_MODE. */
if (CONST_INT_P (XEXP (x, 1)) if (CONST_INT_P (XEXP (x, 1))
&& INTVAL (XEXP (x, 1)) >= 0
&& INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT && INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT
&& HWI_COMPUTABLE_MODE_P (op_mode)) && HWI_COMPUTABLE_MODE_P (op_mode))
{ {
......
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