This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code
- From: "rguenther at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Mar 2008 14:52:19 -0000
- Subject: [Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code
- References: <bug-30911-13647@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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