public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/55616] New: bogus warning about undefined overflow after overflow check
@ 2012-12-07 14:03 fweimer at redhat dot com
  2012-12-07 14:39 ` [Bug tree-optimization/55616] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: fweimer at redhat dot com @ 2012-12-07 14:03 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55616
           Summary: bogus warning about undefined overflow after overflow
                    check
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: fweimer@redhat.com
                CC: nils@redhat.com


Created attachment 28893
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28893
overflow-check.c

Code which performs proper overflow checking results in a compiler warning (at
-O2, without -fwrapv):

overflow-check.c:9:6: warning: assuming signed overflow does not occur when
assuming that (X + c) < X is always false [-Wstrict-overflow]
   if (a > b)
      ^

I'm surprised that the call to something from f is not optimized away with
-fwrapv.  Shouldn't VRP catch this?  Addressing this missed optimization
opportunity might also fix the warning.

The g function in the test case intends to make the if statement in r actually
relevant.

This is not a regression, it happens with 4.7.2 as well.


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

end of thread, other threads:[~2021-09-28  9:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-07 14:03 [Bug tree-optimization/55616] New: bogus warning about undefined overflow after overflow check fweimer at redhat dot com
2012-12-07 14:39 ` [Bug tree-optimization/55616] " rguenth at gcc dot gnu.org
2013-01-31  9:50 ` fweimer at redhat dot com
2013-01-31 10:09 ` jakub at gcc dot gnu.org
2013-01-31 10:26 ` fweimer at redhat dot com
2013-01-31 10:48 ` rguenth at gcc dot gnu.org
2013-01-31 10:52 ` jakub at gcc dot gnu.org
2013-01-31 11:06 ` fweimer at redhat dot com
2013-01-31 11:14 ` than at redhat dot com
2013-01-31 11:21 ` jakub at gcc dot gnu.org
2021-09-28  9:37 ` pinskia at gcc dot gnu.org

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