diff options
author | Andreas Schwab <schwab@issan.cs.uni-dortmund.de> | 1999-05-26 20:33:58 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1999-05-26 20:33:58 -0600 |
commit | 2bd21a021ed7d763a7be92cfa1048f3e95e9a3a6 (patch) | |
tree | cd3b72efd1a1522b9b9fe7ddbb5cd35b511242e9 /gcc/fold-const.c | |
parent | 8eba681fa548a27e42fa7a97a6ae06cff81824f6 (diff) | |
download | gcc-2bd21a021ed7d763a7be92cfa1048f3e95e9a3a6.zip gcc-2bd21a021ed7d763a7be92cfa1048f3e95e9a3a6.tar.gz gcc-2bd21a021ed7d763a7be92cfa1048f3e95e9a3a6.tar.bz2 |
fold-const.c (fold_truthop): Make the field reference unsigned when converting a single bit compare.
h
* fold-const.c (fold_truthop): Make the field reference unsigned
when converting a single bit compare.
From-SVN: r27202
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index b67ff82..7d63ea8 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3806,11 +3806,10 @@ fold_truthop (code, truth_type, lhs, rhs) { if (l_const && integer_zerop (l_const) && integer_pow2p (ll_mask)) { - /* Do not sign extend the constant here. The left operand - is either always unsigned or there is a BIT_AND_EXPR that - masks out the extension bits. */ - if (! (ll_unsignedp || ll_and_mask != 0)) - abort (); + /* Make the left operand unsigned, since we are only interested + in the value of one bit. Otherwise we are doing the wrong + thing below. */ + ll_unsignedp = 1; l_const = ll_mask; } else @@ -3822,8 +3821,7 @@ fold_truthop (code, truth_type, lhs, rhs) { if (r_const && integer_zerop (r_const) && integer_pow2p (rl_mask)) { - if (! (rl_unsignedp || rl_and_mask != 0)) - abort (); + rl_unsignedp = 1; r_const = rl_mask; } else |