From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18871 invoked by alias); 21 Jan 2007 12:49:53 -0000 Received: (qmail 18838 invoked by uid 48); 21 Jan 2007 12:49:43 -0000 Date: Sun, 21 Jan 2007 12:49:00 -0000 Message-ID: <20070121124943.18837.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: "andreas at andreas 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/msg01651.txt.bz2 ------- Comment #32 from andreas at andreas dot org 2007-01-21 12:49 ------- Oh, and besides, proper range analysis could optimize the above code, even in the presence of correct (and I mean LIA-1) overflow behaviour of signed ints. It seems you still didn't even manage to come up with an example where is optimization matters which is not "eliminate bounds checks during array access". And the single reason bounds checks are done is to prevent buffer overflow exploits. So if you optimize that away in a situation where a LIA-1 compliant compiler would not, you're creating a security problem. I don't see why making make_range in fold-const.c behave in compliance with LIA-1 should be a problem, especially not performance-wise. It would really make a lot of people sleep better in the night. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30475