From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1a6e940e9297b109 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Curiosity about rage checking Date: Thu, 07 Feb 2008 10:55:24 +0100 Organization: Adalog Message-ID: References: <29e89783-8802-474e-b3c7-9721407ce42e@s13g2000prd.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1202377178 30747 195.25.228.57 (7 Feb 2008 09:39:38 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 7 Feb 2008 09:39:38 +0000 (UTC) User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: <29e89783-8802-474e-b3c7-9721407ce42e@s13g2000prd.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:19725 Date: 2008-02-07T10:55:24+01:00 List-Id: 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