public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/30475]  New: assert(int+100 > int) optimized away
@ 2007-01-15 19:43 felix-gcc at fefe dot de
  2007-01-15 19:46 ` [Bug c/30475] " felix-gcc at fefe dot de
                   ` (54 more replies)
  0 siblings, 55 replies; 61+ messages in thread
From: felix-gcc at fefe dot de @ 2007-01-15 19:43 UTC (permalink / raw)
  To: gcc-bugs

The small test program at http://ptrace.fefe.de/int.c illustrated the problem.

The assert is there to prevent integer overflow, which would not happen in my
test program, but you get the idea.

There appears to be something wrong with integer promotion here.  The same code
with int changed to unsigned int (http://ptrace.fefe.de/unsignedint.c)
correctly fails the assertion at that point.  My understanding of C integer
promotion is that the 100 is an int unless anything else is said, so int+100
should still be an int, and so both sides should still be an int.  Is that not
correct?


-- 
           Summary: assert(int+100 > int) optimized away
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: felix-gcc at fefe dot de
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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


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

end of thread, other threads:[~2021-01-06 10:38 UTC | newest]

Thread overview: 61+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-30475-4@http.gcc.gnu.org/bugzilla/>
2014-02-16 10:00 ` [Bug c/30475] assert(int+100 > int) optimized away jackie.rosen at hushmail dot com
2021-01-05 12:26 ` daniel.marjamaki at gmail dot com
2021-01-05 12:56 ` daniel.marjamaki at gmail dot com
2021-01-05 13:30 ` jakub at gcc dot gnu.org
2021-01-05 13:37 ` jakub at gcc dot gnu.org
2021-01-06 10:37 ` daniel.marjamaki at gmail dot com
2007-01-15 19:43 [Bug c/30475] New: " felix-gcc at fefe dot de
2007-01-15 19:46 ` [Bug c/30475] " felix-gcc at fefe dot de
2007-01-15 19:47 ` pinskia at gcc dot gnu dot org
2007-01-15 19:50 ` felix-gcc at fefe dot de
2007-01-15 19:57 ` felix-gcc at fefe dot de
2007-01-15 20:04 ` pinskia at gcc dot gnu dot org
2007-01-16  4:47 ` pinskia at gcc dot gnu dot org
2007-01-16  7:00 ` pluto at agmk dot net
2007-01-16  7:24 ` gcc at mailinator dot com
2007-01-17 13:55 ` felix-gcc at fefe dot de
2007-01-17 14:26 ` rguenth at gcc dot gnu dot org
2007-01-17 14:31 ` rguenth at gcc dot gnu dot org
2007-01-17 15:21 ` felix-gcc at fefe dot de
2007-01-17 16:32 ` rguenth at gcc dot gnu dot org
2007-01-17 16:37 ` felix-gcc at fefe dot de
2007-01-17 16:54 ` erdgeist-gcc at erdgeist dot org
2007-01-17 16:57 ` pinskia at gcc dot gnu dot org
2007-01-17 17:03 ` felix-gcc at fefe dot de
2007-01-17 17:06 ` rguenth at gcc dot gnu dot org
2007-01-17 17:12 ` pinskia at gcc dot gnu dot org
2007-01-17 17:14 ` amacleod at redhat dot com
2007-01-17 17:20 ` felix-gcc at fefe dot de
2007-01-17 17:42 ` pinskia at gcc dot gnu dot org
2007-01-17 18:23 ` felix-gcc at fefe dot de
2007-01-17 18:43 ` pinskia at gcc dot gnu dot org
2007-01-17 19:04 ` felix-gcc at fefe dot de
2007-01-17 19:18 ` pinskia at gcc dot gnu dot org
2007-01-18 15:20 ` felix-gcc at fefe dot de
2007-01-18 15:24 ` felix-gcc at fefe dot de
2007-01-18 17:36 ` pinskia at gcc dot gnu dot org
2007-01-21  8:58 ` pinskia at gcc dot gnu dot org
2007-01-21 12:23 ` andreas at andreas dot org
2007-01-21 12:49 ` andreas at andreas dot org
2007-01-21 13:53 ` felix-gcc at fefe dot de
2007-01-21 16:31 ` pinskia at gcc dot gnu dot org
2007-01-21 17:30 ` andreas at andreas dot org
2007-01-21 17:47 ` felix-gcc at fefe dot de
2007-01-21 18:16 ` pluto at agmk dot net
2007-01-21 19:46 ` rguenth at gcc dot gnu dot org
2007-01-21 20:14 ` pinskia at gcc dot gnu dot org
2007-01-21 21:52 ` tromey at gcc dot gnu dot org
2007-01-22  2:18 ` felix-gcc at fefe dot de
2007-01-22  2:27 ` pinskia at gcc dot gnu dot org
2007-01-22 13:02 ` felix-gcc at fefe dot de
2007-01-22 17:15 ` pinskia at gcc dot gnu dot org
2007-01-22 18:26 ` steven at gcc dot gnu dot org
2007-01-22 18:33 ` pinskia at gcc dot gnu dot org
2007-01-22 18:36 ` andreas at andreas dot org
2007-01-22 19:50 ` felix-gcc at fefe dot de
2007-01-22 20:16 ` ian at airs dot com
2007-01-22 22:27 ` pinskia at gcc dot gnu dot org
2007-01-22 23:10 ` andreas at andreas dot org
2007-01-23  0:46 ` kargl at gcc dot gnu dot org
2007-03-08  1:03 ` js at linuxtv dot org
2007-03-08  1:14 ` pinskia at gcc dot gnu dot org
2007-03-08 16:23 ` js at linuxtv dot 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).