diff options
author | Ulrich Weigand <ulrich.weigand@linaro.org> | 2012-07-07 12:19:50 +0000 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@linaro.org> | 2012-07-07 12:19:50 +0000 |
commit | a06977c3b43493c7148fec4943f3f97268a76943 (patch) | |
tree | a76cf9cd464e775a8a81e55e7aefb1eb28db63a7 /gcc/combine.c | |
parent | 36b519ff9692fa6f730b8cf0ad963785797b01e9 (diff) |
* combine.c (force_to_mode) [LSHIFTRT]: Avoid undefined behaviour
due to negative shift amount.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@189347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 70b80bca738..ed87f1caa56 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -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)) { |