------- 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