summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-06 13:36:16 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2011-07-06 13:36:16 +0000
commit6f061208fc5d6d1cdb668fb56b84249d1c96b3a1 (patch)
treedac9f2b9f9f4e057938eba339861f1b99af29cc2 /gcc/simplify-rtx.c
parent321583cbf3a8135b2d17cdb1eae83e66c60ac689 (diff)
downloadgcc-6f061208fc5d6d1cdb668fb56b84249d1c96b3a1.tar.gz
* simplify-rtx.c (simplify_const_binary_operation): Use the
shift_truncation_mask hook instead of performing modulo by width. Compare against mode precision, not bitsize. * combine.c (combine_simplify_rtx, simplify_shift_const_1): Use shift_truncation_mask instead of constructing the value manually. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175913 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 5894f74257b..f7669b1ebc9 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3726,8 +3726,8 @@ simplify_const_binary_operation (enum rtx_code code, enum machine_mode mode,
shift_truncation_mask, since the shift might not be part of an
ashlM3, lshrM3 or ashrM3 instruction. */
if (SHIFT_COUNT_TRUNCATED)
- arg1 = (unsigned HOST_WIDE_INT) arg1 % width;
- else if (arg1 < 0 || arg1 >= GET_MODE_BITSIZE (mode))
+ arg1 &= targetm.shift_truncation_mask (mode);
+ else if (arg1 < 0 || arg1 >= GET_MODE_PRECISION (mode))
return 0;
val = (code == ASHIFT