From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4258 invoked by alias); 30 Mar 2008 14:53:02 -0000 Received: (qmail 4104 invoked by alias); 30 Mar 2008 14:52:19 -0000 Date: Sun, 30 Mar 2008 14:53:00 -0000 Message-ID: <20080330145219.4103.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenther at suse dot de" 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: 2008-03/txt/msg02440.txt.bz2 ------- Comment #57 from rguenther at suse dot de 2008-03-30 14:52 ------- Subject: Re: VRP fails to eliminate range checks in Ada code On Sun, 30 Mar 2008, baldrick at gcc dot gnu dot org wrote: > ------- Comment #55 from baldrick at gcc dot gnu dot org 2008-03-30 14:18 ------- > And here's a testcase that was supposed to check that > VRP is not removing checks that array accesses are in > range. Instead it shows that the Ada f-e is failing > to generate checks at all! > > function Overflow (X : Positive) return Integer is > Y : Positive; > A : array (Positive) of Integer; > pragma Import (Ada, A); > begin > return A (X) + A (Y); > end; Or that fold is clever enough (again) to remove the check - I'm sure it has special code dealing with >= 0 checks on unsigned types ;) Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30911