From aef2b1d1f03eacdad6ec5fac97a04eea7cc68174 Mon Sep 17 00:00:00 2001 From: Kenneth Zadeck Date: Sat, 9 Jun 2012 12:40:40 +0000 Subject: [PATCH] simplify-rtx.c (simplify_const_binary_operation): Fixed shift count trucation. 2012-06-09 Kenneth Zadeck * simplify-rtx.c (simplify_const_binary_operation): Fixed shift count trucation. From-SVN: r188359 --- gcc/ChangeLog | 5 +++++ gcc/simplify-rtx.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62f67f441fd..5c6cc022f02 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2012-06-09 Kenneth Zadeck + + * simplify-rtx.c (simplify_const_binary_operation): Fixed shift + count trucation. + 2012-06-08 Richard Henderson PR c++/53602 diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index e43ee5bdf38..e1bd3cf2e3b 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3653,7 +3653,10 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode, unsigned HOST_WIDE_INT cnt; if (SHIFT_COUNT_TRUNCATED) - o1 = double_int_zext (o1, GET_MODE_PRECISION (mode)); + { + o1.high = 0; + o1.low &= GET_MODE_PRECISION (mode) - 1; + } if (!double_int_fits_in_uhwi_p (o1) || double_int_to_uhwi (o1) >= GET_MODE_PRECISION (mode)) -- 2.30.2