public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/49183] New: gcc removes assert
@ 2011-05-27  1:44 overseers at suremail dot info
  2011-05-27  2:36 ` [Bug c/49183] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: overseers at suremail dot info @ 2011-05-27  1:44 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: gcc removes assert
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: overseers@suremail.info


gcc -O2 removes asserts like assert(i+10>i). Please fix.


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

* [Bug c/49183] gcc removes assert
  2011-05-27  1:44 [Bug c/49183] New: gcc removes assert overseers at suremail dot info
@ 2011-05-27  2:36 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2011-05-27  2:36 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-05-27 01:43:29 UTC ---
assert(i+10>i) is always true if i is signed as signed integer overflow is
undefined.  If i is MAX_INT then i+10 will overflow and the result is
undefined, so GCC assumes that the result will never be less than i.  If you
want signed integer to be defined as wrapping use -fwrapv.


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

end of thread, other threads:[~2011-05-27  1:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27  1:44 [Bug c/49183] New: gcc removes assert overseers at suremail dot info
2011-05-27  2:36 ` [Bug c/49183] " 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).