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
This commit is contained in:
Ulrich Weigand 2012-07-07 12:19:50 +00:00 committed by Ulrich Weigand
parent 755e0546bc
commit f99391fe45
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-07 Hans-Peter Nilsson <hp@axis.com>
Fix configure test for "stack protector support in target C library".

View File

@ -8433,6 +8433,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))
{