aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJ"orn Rennecke <amylaar@cygnus.co.uk>1997-11-14 00:38:08 +0000
committerJoern Rennecke <amylaar@gcc.gnu.org>1997-11-14 00:38:08 +0000
commit9f29ca789b773476c2a756542d0a0771edb2c047 (patch)
tree9dc2e4d442a211f08d462a97bd93d8789bca462c /gcc
parent41c9120baf04bf432d39a11298f2550292581922 (diff)
downloadgcc-9f29ca789b773476c2a756542d0a0771edb2c047.zip
gcc-9f29ca789b773476c2a756542d0a0771edb2c047.tar.gz
gcc-9f29ca789b773476c2a756542d0a0771edb2c047.tar.bz2
* fold-const.c (fold_truthop): Fix bug in last change.
From-SVN: r16473
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/fold-const.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 12cac79..c707052 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 4b4c5e1..0f5a19f 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -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. */