This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/26729] bogus 'comparison is always 0' message



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]