public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/26729]  New: bogus 'comparison is always 0' message
@ 2006-03-17 16:47 apl at alum dot mit dot edu
  2006-03-17 16:48 ` [Bug c++/26729] " apl at alum dot mit dot edu
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: apl at alum dot mit dot edu @ 2006-03-17 16:47 UTC (permalink / raw)
  To: gcc-bugs

trivial function using POD constructors says "comparison is always 0".

If I remove any of the UInt16 constructors, the warning goes away.
This doesn't seem to happen in gcc-4.1.0


typedef unsigned short UInt16;
UInt16 pipe;

UInt16 cmp ()
{
  UInt16 answer;
  answer = 
    UInt16((((((pipe & UInt16(0x8800u))))))) == UInt16(0x8000u)
    & ((((((pipe & 0x4000)!= 0)
          ? (((((((((pipe & 0x2000u)!= 0))))
                &(((((((pipe & 0x400u)!= 0))
                     ?(((((((((((pipe & 0x1001u)))))
                            ^ 0x1000u))) != 0)))
                     :(((((((((pipe & 0x1001u))))) == 0x1001u))))))))))))
           // Next line is reported as always false
          :((((UInt16((((((pipe & 0x3700u)))))) == UInt16(0x3000u)))))))));
  return answer;
}


-- 
           Summary: bogus 'comparison is always 0' message
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: apl at alum dot mit dot edu
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26729


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2006-05-15 17:41 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-17 16:47 [Bug c++/26729] New: bogus 'comparison is always 0' message apl at alum dot mit dot edu
2006-03-17 16:48 ` [Bug c++/26729] " apl at alum dot mit dot edu
2006-03-17 17:00 ` [Bug c++/26729] [3.3/3.4 Regression] " pinskia at gcc dot gnu dot org
2006-03-17 17:05 ` apl at alum dot mit dot edu
2006-03-17 17:07 ` pinskia at gcc dot gnu dot org
2006-03-28 15:09 ` apl at alum dot mit dot edu
2006-03-28 15:21 ` apl at alum dot mit dot edu
2006-03-28 17:43 ` [Bug c++/26729] " pinskia at gcc dot gnu dot org
2006-03-28 18:41 ` apl at alum dot mit dot edu
2006-03-28 20:58 ` falk at debian dot org
2006-03-28 21:26 ` apl at alum dot mit dot edu
2006-03-28 21:28 ` apl at alum dot mit dot edu
2006-03-28 21:59 ` [Bug middle-end/26729] [4.0,4.1 regression] bad bitops folding falk at debian dot org
2006-03-29  1:13 ` [Bug middle-end/26729] [4.0/4.1/4.2 " pinskia at gcc dot gnu dot org
2006-04-12 21:29 ` steven at gcc dot gnu dot org
2006-04-13  0:54 ` pinskia at gcc dot gnu dot org
2006-04-16 19:03 ` mmitchel at gcc dot gnu dot org
2006-04-19 13:45 ` jakub at gcc dot gnu dot org
2006-04-19 14:21 ` falk at debian dot org
2006-04-27 11:21 ` [Bug middle-end/26729] [4.0/4.1 " rguenth at gcc dot gnu dot org
2006-05-14  4:19 ` sayle at gcc dot gnu dot org
2006-05-14 14:20 ` [Bug middle-end/26729] [4.0 " steven at gcc dot gnu dot org
2006-05-14 14:40 ` apl at alum dot mit dot edu
2006-05-14 17:20 ` sayle at gcc dot gnu dot org
2006-05-14 17:39 ` roger at eyesopen dot com
2006-05-15 16:15 ` sayle at gcc dot gnu dot org
2006-05-15 17:41 ` roger at eyesopen dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).