comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Computer beats Kasparov
Date: 1996/02/27
Date: 1996-02-27T00:00:00+00:00	[thread overview]
Message-ID: <dewar.825427948@schonberg> (raw)
In-Reply-To: 4gt4hv$m03@cliffy.lfwc.lockheed.com

"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).






  reply	other threads:[~1996-02-27  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4g29e2$ea0$1@mhadg.production.compuserve.com>
1996-02-17  0:00 ` Computer beats Kasparov Cordes MJ
1996-02-24  0:00 ` Tore Joergensen
1996-02-26  0:00   ` Cordes MJ
1996-02-25  0:00     ` Robert Dewar
1996-02-26  0:00       ` Cordes MJ
1996-02-27  0:00         ` Robert Dewar [this message]
1996-02-26  0:00       ` Ken Garlington
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox