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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,25aa3c7e1b59f7b5 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-07 12:32:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!dispose.news.demon.net!demon!diablo.netcom.net.uk!netcom.net.uk!news-hub.cableinet.net!blueyonder!newspeer.clara.net!news.clara.net!news5-gui.server.ntli.net!ntli.net!news6-win.server.ntlworld.com.POSTED!not-for-mail Sender: mjw@golux Newsgroups: comp.lang.ada Subject: Re: A case where Ada defaults to unsafe? References: <3C39E62F.3020504@look.ca> <3C39E726.8000408@mail.com> From: Matthew Woodcraft Message-ID: <87advpdi0f.fsf@chiark.greenend.org.uk> User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 07 Jan 2002 20:26:56 +0000 NNTP-Posting-Host: 213.107.104.73 X-Complaints-To: abuse@ntlworld.com X-Trace: news6-win.server.ntlworld.com 1010435224 213.107.104.73 (Mon, 07 Jan 2002 20:27:04 GMT) NNTP-Posting-Date: Mon, 07 Jan 2002 20:27:04 GMT Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:18623 Date: 2002-01-07T20:26:56+00:00 List-Id: Hyman Rosen writes: > What many of you seem to forget is that the commutative form requires > that both operands are evaluated. Of course the compiler can elide by > the as-if rule, but not if there is a chance of overflow: > > if a + b > 3 and x + y < 4 -- case 1 > if a + b > 3 and then x + y < 4 -- case 2 > > In the first case, if there is a chance that evaluating x + y could > lead to overflow, the compiler cannot forgo the evaluation even in > the case of a + b <= 3, becuase the exception must be generated. Doesn't RM 11.6 allow the compiler to ignore this exception? -M-