comp.lang.ada
 help / color / mirror / Atom feed
From: Jean-Pierre Rosen <rosen@adalog.fr>
Subject: Re: Curiosity about rage checking
Date: Thu, 07 Feb 2008 10:55:24 +0100
Date: 2008-02-07T10:55:24+01:00	[thread overview]
Message-ID: <fikeof.nrj.ln@hunter.axlog.fr> (raw)
In-Reply-To: <29e89783-8802-474e-b3c7-9721407ce42e@s13g2000prd.googlegroups.com>

framefritti@gmail.com a �crit :
> [..]
> 
> My question is: is an Ada compiler allowed to move the check outside
> the loop?

This question is addressed in the (in)famous paragraph 11.6. If you 
don't understand exactly what it says, don't worry, you are not alone...

But the important issue is that compilers are unlikely to perform that 
optimization. Why? Because optimization is a matter of improving what's 
normally used. And any decent Ada programmer should write that loop as:

for I in X'range loop...

Where the optimization becomes trivial
-- 
---------------------------------------------------------
            J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



  parent reply	other threads:[~2008-02-07  9:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07  8:17 Curiosity about rage checking framefritti
2008-02-07  8:45 ` Maciej Sobczak
2008-02-07  9:55 ` Jean-Pierre Rosen [this message]
2008-02-07 10:36   ` framefritti
2008-02-07 11:21     ` Dmitry A. Kazakov
2008-02-07 15:57   ` Adam Beneschan
2008-02-07 16:45 ` Robert A Duff
2008-02-07 16:54 ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox