From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22501 invoked by alias); 21 Jan 2007 16:31:09 -0000 Received: (qmail 22475 invoked by uid 48); 21 Jan 2007 16:31:01 -0000 Date: Sun, 21 Jan 2007 16:31:00 -0000 Message-ID: <20070121163101.22474.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/msg01669.txt.bz2 ------- Comment #34 from pinskia at gcc dot gnu dot org 2007-01-21 16:31 ------- > The range analysis has nothing to do with just assuming integers can't wrap. Partly wrong, range analysis is helped by the fact assuming integers can't wrap. If range analysis dependent on pointer overflow being undefined, would you complain then, I bet you would. Intel's compiler assumes integer overflow is undefined but if you think it does not, then fine, most if not all commerial compilers assume that. Unlike them, we give you an option to assume otherwise. >I don't see why making make_range in fold-const.c It is already if you use -fwrapv. The problem here is that the people who added these security checks in the first place did not know C. So either GCC can be changed or these programs can be fixed by the way comp.lang.c faq recommends or by using -fwrapv. If we change GCC, you punish the people who actually write defined C so that is out of the question. I think the real issue that some of the security folks want to check after the fact that something happened instead of before it happend which is the correct way to do anything. -- 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