diff options
author | Ulrich Weigand <ulrich.weigand@linaro.org> | 2012-07-07 12:19:50 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2012-07-07 12:19:50 +0000 |
commit | f99391fe45e4e83291764234d491d31eb8bc3bf3 (patch) | |
tree | a76cf9cd464e775a8a81e55e7aefb1eb28db63a7 /gcc/combine.c | |
parent | 755e0546bc8e50efe181e594ec51062aa2267035 (diff) | |
download | gcc-f99391fe45e4e83291764234d491d31eb8bc3bf3.zip gcc-f99391fe45e4e83291764234d491d31eb8bc3bf3.tar.gz gcc-f99391fe45e4e83291764234d491d31eb8bc3bf3.tar.bz2 |
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
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 70b80bc..ed87f1c 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)) { |