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: r189348
This commit is contained in:
Ulrich Weigand 2012-07-07 12:27:33 +00:00 committed by Ulrich Weigand
parent 66887e7839
commit 47c2c57f14
2 changed files with 6 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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-06 Kai Tietz <ktietz@redhat.com>
Backport from mainline.

View File

@ -8436,6 +8436,7 @@ force_to_mode (rtx x, enum machine_mode mode, unsigned HOST_WIDE_INT mask,
in OP_MODE. */
if (CONST_INT_P (XEXP (x, 1))
&& INTVAL (XEXP (x, 1)) >= 0
&& INTVAL (XEXP (x, 1)) < HOST_BITS_PER_WIDE_INT
&& HWI_COMPUTABLE_MODE_P (op_mode))
{