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-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!newscon02.news.prodigy.net!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Curiosity about rage checking Date: Thu, 07 Feb 2008 11:45:46 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <29e89783-8802-474e-b3c7-9721407ce42e@s13g2000prd.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1202402747 3223 192.74.137.71 (7 Feb 2008 16:45:47 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 7 Feb 2008 16:45:47 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:udofg59h/Ai+SEnBi9eWpK684wE= Xref: g2news1.google.com comp.lang.ada:19731 Date: 2008-02-07T11:45:46-05:00 List-Id: "framefritti@gmail.com" writes: > My question is: is an Ada compiler allowed to move the check outside > the loop? Yes. However, if A > B (i.e. the loop will go around zero times), then the compiler must make sure the exception is not raised. > 2. Moving the check outside the loop changes the program behaviour RM-11.6 allows certain behavior changes. Exceptions can be moved around, for example, so long as the right handler applies. See AARM-1.1.2(39.c) for the difference between "behavior" and "semantics". > 3. It make debugging harder The RM says almost nothing about debugging. But Ada compilers typically have a no-optimize switch that suppresses optimizations that would harm debugging. - Bob