This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: As-if Infinitely Ranged Integer Model
On Mon, 2009-07-27 at 09:34 +0200, Gabriel Paubert wrote:
> On Fri, Jul 24, 2009 at 06:25:12PM +0200, Laurent GUERBY wrote:
> > for I in T'First .. Dynamic_N loop
> > T (I) := 0.0; -- generate check I in T'First .. T'Last
> > end loop;
> >
> > =>
> >
> > if Dynamic_N >= T'First and Dynamic_N > T'Last then
>
> Huh? I can't understand the first comparison.
>
> Actually Ada is not Fortran-66 and allows empty loops, no?
Ada for loop over "A .. B" will be empty if "A > B" and we obviously
must not raise an exception if the loop is empty hence the first
comparison is equivalent to "not (T'First > Dynamic_N)" which is true
when the loop is not empty.
> I don't think so. And the code quality when checking for
> overflows was abysmal last time I tried.
We're talking about range checking here, not arithmetic overflow
checking (which is another topic where GCC infrastructure change
could help Ada of course).
Sincerely,
Laurent