This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/26729] bogus 'comparison is always 0' message
- From: "apl at alum dot mit dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Mar 2006 21:28:12 -0000
- Subject: [Bug c++/26729] bogus 'comparison is always 0' message
- References: <bug-26729-4387@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #10 from apl at alum dot mit dot edu 2006-03-28 21:28 -------
No, you misread the parentheses. I've removed all the EXCESS ONES, leaving
answer = (UInt16(word & 0x3700) == UInt16(0x3000))
& (UInt16(word & 0x8800) == UInt16(0x8000));
Showing that we're testing disjoint bits within word , e.g.
word & 0x3700 == 0x3000
and word & 0x8800 == 0x8000
which is NOT always zero....
I've added a simplified test case that still shows the problem and contains a
near minimal number of parentheses....
--
apl at alum dot mit dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26729