Cope with down shifting a 32 bit constant on a 64 bit host.
authorNick Clifton <nickc@cygnus.com>
Fri, 24 Sep 1999 16:12:44 +0000 (16:12 +0000)
committerNick Clifton <nickc@gcc.gnu.org>
Fri, 24 Sep 1999 16:12:44 +0000 (16:12 +0000)
From-SVN: r29655

gcc/ChangeLog
gcc/combine.c

index 587c95053395eff210b56b8b3e5449b73799ec7e..b6723ea9039b5216445f8d96aa7c683f973a95d7 100644 (file)
@@ -1,3 +1,9 @@
+Fri Sep 24 17:10:56 1999  Nick Clifton  <nickc@cygnus.com>
+
+       * combine.c (simplify_comparison): Cope with downshifting a 32 bit
+       constant on a 64 bit host.  Patch supplied by Geoffrey Keating
+       <geoffk@cygnus.com>.
+
 Fri Sep 24 10:48:10 1999  Bernd Schmidt  <bernds@cygnus.co.uk>
 
        * builtins.c (expand_builtin): Use MD_EXPAND_BUILTIN if defined.
index 0e556db4ab9ba703f679a1a8a3a75d7a5e503f43..61d55d0c893e2b07a9662d2d2394c1ae88d86ced 100644 (file)
@@ -10364,10 +10364,10 @@ simplify_comparison (code, pop0, pop1)
            {
              /* 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;
+             unsigned HOST_WIDE_INT temp = const_op & GET_MODE_MASK (mode);
              
              temp >>= INTVAL (XEXP (op0, 1));
-             op1 = GEN_INT (temp);
+             op1 = GEN_INT (trunc_int_for_mode (temp, mode));
              op0 = XEXP (op0, 0);
              continue;
            }