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,c4cb2c432feebd9d X-Google-Thread: 1094ba,c4cb2c432feebd9d X-Google-Attributes: gid103376,gid1094ba,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada,comp.lang.fortran Subject: Re: Bounds Check Overhead Date: 30 May 2006 15:13:29 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <0ugu4e.4i7.ln@hunter.axlog.fr> <%P_cg.155733$eR6.26337@bgtnsc04-news.ops.worldnet.att.net> <6H9dg.10258$S7.9150@news-server.bigpond.net.au> <1hfv5wb.1x4ab1tbdzk7eN%nospam@see.signature> <4475DA61.3080001@comcast.net> <44762F55.4050106@cits1.stanford.edu> <87hd3d1472.fsf@ludovic-brenta.org> <1hfxsjh.t88mchrssv9cN%nospam@see.signature> <1hfxy4r.1sv2j76l6cgg1N%nospam@see.signature> <1hfy2t0.g0sxtp1srj7r3N%nospam@see.signature> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1149016415 28048 192.74.137.71 (30 May 2006 19:13:34 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 30 May 2006 19:13:34 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news2.google.com comp.lang.ada:4679 comp.lang.fortran:10658 Date: 2006-05-30T15:13:29-04:00 List-Id: nospam@see.signature (Richard Maine) writes: > Nasser Abbasi wrote: > > > I do not think this is too hard for the compiler to check, but I can be > > wrong. I would have to assume then that this is a g95 issue where it just > > does not do this extra check if it is supposed to be part of the Fortran > > standard to try to check against loop counters updates. > > I seem to be having some trouble communicating here. No it is not > "supposed to be part of the Fortran standard to try to check against > loop counters updates". > > I will repeat for the 3rd time. > > >> Compilers are not required to enforce that rule, > > Am I not making this clear?... Well, it seems clear enough to me. ;-) I'm not a Fortran expert, but I think you're saying that (according to the Fortran standard) it is an error to modify a DO-loop variable, but Fortran compilers are not required to detect this error. They are allowed to, and in fact do so in some cases. But a separate issue is whether it is possible or feasible for compilers to detect this error in all cases. Apparently (please correct me if I'm wrong), it is not feasible for Fortran compilers to detect this error in all cases. In Ada, the same error can be detected in all cases (and in fact the Ada standard requires it) -- even with separate compilation. My point is that it's not just an issue of whether certain errors are required to be detected. The language design has some influence over whether they _can_ be detected (given separate compilation). Apparently, the INTENT(in) thing is a more modern addition to Fortran, which could solve the problem if compilers choose to have strict rules about it. (Sorry, I have not programmed in Fortran for years, and was never an expert.) >... I cannot come up with a simpler way of > stating it. As I also said > > >> In terms of the standard, that is basically all there is to say. > > Anything else on the subject is outside of the standard. Really. There > are other things to say on the subject, but not in the standard. > > Also, there is almost nothing that the standard says that compilers are > supposed to "try" to do. To quote Yoda > > "Do or do not... there is no try." Right. The Ada standard is the same way -- it rarely says "try". It requires certain errors to be detected (either at compile time, or at link time, or at run time), and allows other errors to go undetected. > There are plenty of things that the market (i.e. users) say that > compilers should try to do, but it is quite rare for the standard to say > things like that. ... Quite true, but the Standard (for whatever language) determines to some extent whether such error-detection market-demands can be met. >... There are a few cases where the standard has a > "recommendation", which could reasonably be interpreted as a suggestion > to try to do something that is not strictly required. But those are rare > and none of them are in this area. - Bob