diff options
author | Bernd Schmidt <bernds@codesourcery.com> | 2011-07-06 13:36:16 +0000 |
---|---|---|
committer | Bernd Schmidt <bernds@gcc.gnu.org> | 2011-07-06 13:36:16 +0000 |
commit | ff3e08afdd5814f51dbe59332df690474de5f050 (patch) | |
tree | dac9f2b9f9f4e057938eba339861f1b99af29cc2 /gcc/simplify-rtx.c | |
parent | a369b6399c43d766cd7690753dbac32c4221354d (diff) | |
download | gcc-ff3e08afdd5814f51dbe59332df690474de5f050.zip gcc-ff3e08afdd5814f51dbe59332df690474de5f050.tar.gz gcc-ff3e08afdd5814f51dbe59332df690474de5f050.tar.bz2 |
simplify-rtx.c (simplify_const_binary_operation): Use the shift_truncation_mask hook instead of performing modulo by width.
* 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.
From-SVN: r175913
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index 5894f74..f7669b1 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 |