* fold-const.c (fold_truthop): Fix bug in last change.
authorJ"orn Rennecke <amylaar@cygnus.co.uk>
Fri, 14 Nov 1997 00:38:08 +0000 (00:38 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Fri, 14 Nov 1997 00:38:08 +0000 (00:38 +0000)
From-SVN: r16473

gcc/ChangeLog
gcc/fold-const.c

index 12cac79d33c2c651f259e56f2c31aab711a2fbaa..c7070529a9d3bac388a8d579c5989e5af07656d4 100644 (file)
@@ -1,3 +1,7 @@
+Thu Nov 13 23:33:50 1997  J"orn Rennecke <amylaar@cygnus.co.uk>
+
+       * fold-const.c (fold_truthop): Fix bug in last change.
+
 1997-11-13  Paul Eggert  <eggert@twinsun.com>
 
        Fix some confusion with IEEE minus zero.
index 4b4c5e184b4c55e96ba3beb08585d16657ab9f75..0f5a19f9e992d4dfc79233658948272cae5c2074 100644 (file)
@@ -3425,7 +3425,7 @@ fold_truthop (code, truth_type, lhs, rhs)
     {
       if (l_const && integer_zerop (l_const) && integer_pow2p (ll_mask))
        {
-         if (ll_unsignedp)
+         if (ll_unsignedp || tree_log2 (ll_mask) + 1 < ll_bitsize)
            l_const = ll_mask;
        else
          /* Since ll_arg is a single bit bit mask, we can sign extend
@@ -3443,7 +3443,7 @@ fold_truthop (code, truth_type, lhs, rhs)
     {
       if (r_const && integer_zerop (r_const) && integer_pow2p (rl_mask))
        {
-         if (rl_unsignedp)
+         if (rl_unsignedp || tree_log2 (rl_mask) + 1 < rl_bitsize)
            r_const = rl_mask;
        else
          /* This is analogous to the code for l_const above.  */