[Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code

baldrick at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Mar 30 14:15:00 GMT 2008



------- Comment #54 from baldrick at gcc dot gnu dot org  2008-03-30 14:14 -------
Here's a test that VRP is not eliminating
validity checks.  "abort" should be called
if either X or Y is <= 0.  With Richard's
latest patch (from the gcc mailing list)
applied, everything is fine: the tests are
still done.

procedure Valid (X : Positive) is
   procedure Abrt;
   pragma Import(C, Abrt, "abort");

   Y : Positive;
begin
   if not X'Valid then
      Abrt;
   end if;
   if not Y'Valid then
      Abrt;
   end if;
end;


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30911



More information about the Gcc-bugs mailing list