aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTorbjorn Granlund <tege@gnu.org>1993-12-24 11:46:16 +0000
committerTorbjorn Granlund <tege@gnu.org>1993-12-24 11:46:16 +0000
commit4d61f8c559377026ca2a8148d2f5b5b1fd4a81d5 (patch)
tree23d0592f2505dd867270d9f76f875ea7fc897e35 /gcc
parent792089b33e9b1f83b869b62bbcaacb99f9200d2d (diff)
downloadgcc-4d61f8c559377026ca2a8148d2f5b5b1fd4a81d5.zip
gcc-4d61f8c559377026ca2a8148d2f5b5b1fd4a81d5.tar.gz
gcc-4d61f8c559377026ca2a8148d2f5b5b1fd4a81d5.tar.bz2
(simplify_binary_operation, case *SHIFT*): Reduce arg1 as
defined by SHIFT_COUNT_TRUNCATED. From-SVN: r6296
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cse.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index d9bc7d4..936370e 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3844,12 +3844,9 @@ simplify_binary_operation (code, mode, op0, op1)
#ifdef SHIFT_COUNT_TRUNCATED
if (SHIFT_COUNT_TRUNCATED)
- arg1 &= (BITS_PER_WORD - 1);
+ arg1 %= width;
#endif
- if (arg1 >= width)
- return 0;
-
val = ((unsigned HOST_WIDE_INT) arg0) >> arg1;
break;
@@ -3860,12 +3857,9 @@ simplify_binary_operation (code, mode, op0, op1)
#ifdef SHIFT_COUNT_TRUNCATED
if (SHIFT_COUNT_TRUNCATED)
- arg1 &= (BITS_PER_WORD - 1);
+ arg1 %= width;
#endif
- if (arg1 >= width)
- return 0;
-
val = ((unsigned HOST_WIDE_INT) arg0) << arg1;
break;
@@ -3875,12 +3869,9 @@ simplify_binary_operation (code, mode, op0, op1)
#ifdef SHIFT_COUNT_TRUNCATED
if (SHIFT_COUNT_TRUNCATED)
- arg1 &= (BITS_PER_WORD - 1);
+ arg1 %= width;
#endif
- if (arg1 >= width)
- return 0;
-
val = arg0s >> arg1;
/* Bootstrap compiler may not have sign extended the right shift.