aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@cygnus.com>1999-09-23 14:58:54 +0000
committerNick Clifton <nickc@gcc.gnu.org>1999-09-23 14:58:54 +0000
commit7ce787fe030a2bf16a49cb5a30e6bb521e6507e7 (patch)
tree2344a439cc8ccd4a2cce268c1bd8e94780f71e05
parentf8540d767f7e9fcd91b13f883cd2681929e94901 (diff)
downloadgcc-7ce787fe030a2bf16a49cb5a30e6bb521e6507e7.zip
gcc-7ce787fe030a2bf16a49cb5a30e6bb521e6507e7.tar.gz
gcc-7ce787fe030a2bf16a49cb5a30e6bb521e6507e7.tar.bz2
Use unsigned shift instead of signed shift.
From-SVN: r29621
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/combine.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4cec47e..aee30b9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Thu Sep 23 15:54:12 1999 Nick Clifton <nickc@cygnus.com>
+
+ * combine.c (simplify_comparison): Use an unsigned shift to adjust
+ the constant.
+
Thu Sep 23 08:46:21 1999 Guy Harris <guy@netapp.com>
* gcc.1: Fix a formatting error.
diff --git a/gcc/combine.c b/gcc/combine.c
index 6c24caa..0e556db 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -10362,8 +10362,12 @@ simplify_comparison (code, pop0, pop1)
& ~ (mask >> (INTVAL (XEXP (op0, 1))
+ ! equality_comparison_p))) == 0)
{
- const_op >>= INTVAL (XEXP (op0, 1));
- op1 = GEN_INT (const_op);
+ /* We must perform a logical shift, not an arithmetic one,
+ as we want the top N bits of C to be zero. */
+ unsigned HOST_WIDE_INT temp = const_op;
+
+ temp >>= INTVAL (XEXP (op0, 1));
+ op1 = GEN_INT (temp);
op0 = XEXP (op0, 0);
continue;
}