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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,48942bcd105c88c6 X-Google-Attributes: gid103376,public From: dewar@cs.nyu.edu (Robert Dewar) Subject: Re: Computer beats Kasparov Date: 1996/02/27 Message-ID: #1/1 X-Deja-AN: 141388579 references: <4g29e2$ea0$1@mhadg.production.compuserve.com> <4gmbdi$rib@toads.pgh.pa.us> <4gqufh$m71@cliffy.lfwc.lockheed.com> <4gt4hv$m03@cliffy.lfwc.lockheed.com> organization: Courant Institute of Mathematical Sciences newsgroups: comp.lang.ada Date: 1996-02-27T00:00:00+00:00 List-Id: "As for inhibiting optimizations, I can't afford to turn off optimizations (e.g., code hoisting techniques) simply to make my Ada/assembly interspersed listing easier to read. Although supporting "reviewable" greatly improves our ability to identify unsafe code, the proof that a program is actually safe still requires tests on the execution of the code." Fine, you prefer to keep optimizations turned on, but for a LOT of safety critical code, the request that is constantly heard from the community is to turn off all optimization to make the code easier to track. Now it is always hard to know what exactly this means. If you really turn off ALL optimization, then you makee code harder to read (for exaple, I usually find GCC generated code harder to read at -O0 than -O2). However, GCC does not do much in the way of elaborate global optimization which results in scrambling your code severely, and it is this kind of scrambling that many practitioners in the area find severely hinders the process of careful code certification at the object level. Note that in my original article, I only suggested that there may be circumstances in which optimziations may need to be suppressed to get acceptable levels of reviewability. I did not say that everyone will want this. So, unless you are claiming that everyone agrees with your position in the first paragraph, you are not disagreeing with my point. If you really think everyone agres that one cannot afford to turn off code hoisting, then I am sure you are wrong, since I have heard so many people energetically insist on the opposite position. It is indeed hard to know what reviewability means, and indeed it is unlikely that "one size fits all" will be viable. Note incidentally that GCC is an interesting compiler from this point of view. It demonstrates that remarkably good code can be obtained simply by local optimizations and simple loop optimizations. Even though GCC lacks sophisticated global optimziations, it often turns in better performance than compilers which have these global optimziations but don't do such a good job of local optimization. It may be that for many purposes, gcc's -O2 represents a good compromise between no optimization and "excessive" global optimization. Certainly I have not found that the -O2 code is hard to read, even though the assembly language output by GCC is pretty poor from a point of view of human readability (e.g. no interpersed source, and only debugging directives to provide symbol names etc).