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: "baldrick at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Mar 2008 17:03:34 -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 #67 from baldrick at free dot fr 2008-03-30 17:03 -------
Subject: Re: VRP fails to eliminate range checks in Ada code
> Try first to compile it. :-)
I did! I didn't notice the compile error
after the -gnatG output. Indeed, when fixed
thusly
procedure Overflow (X : Positive) is
A : array (Positive) of Integer;
pragma Import (Ada, A);
begin
A (X) := X;
end;
then you do get a check:
with interfaces;
procedure overflow (x : positive) is
a : array (1 .. 16#7FFF_FFFF#) of integer;
pragma import (ada, a);
begin
[constraint_error when not (interfaces__unsigned_32!(x) >= 1 and then
interfaces__unsigned_32!(x) <= 16#7FFF_FFFF#) "invalid data"]
a (x) := x;
return;
end overflow;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30911