From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30589 invoked by alias); 21 Jan 2007 08:58:40 -0000 Received: (qmail 30551 invoked by uid 48); 21 Jan 2007 08:58:31 -0000 Date: Sun, 21 Jan 2007 08:58:00 -0000 Message-ID: <20070121085831.30550.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/30475] assert(int+100 > int) optimized away In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-01/txt/msg01642.txt.bz2 ------- Comment #30 from pinskia at gcc dot gnu dot org 2007-01-21 08:58 ------- GCC is not going to change. There is no reason why you can't either use -fwrapv or change the security checks to be before the overflow happens. There are now good reasons why -fwrapv is not on by default, if you look at: int f(int max, int *t) { int i; for(i = 0;i<=max;i++) { if (i<0) return 1; t[i]++; } return 0; } The "if (i<0)" should always be removed as i can never be negative. -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |WONTFIX http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475