Re: Debugging of optimized code

jqb@netcom.com (Jim Balter)
Thu, 2 Feb 1995 06:13:58 GMT

          From comp.compilers

Related articles
[12 earlier articles]
Re: Debugging of optimized code urs@engineering.ucsb.edu (1995-01-27)
Re: Debugging of optimized code miker@metaware.com (1995-01-24)
Re: Debugging of optimized code cef@geodesic.com (Charles Fiterman) (1995-01-25)
Re: Debugging of optimized code danhicks@aol.com (1995-01-27)
Re: Debugging of optimized code danhicks@aol.com (1995-01-29)
Re: Debugging of optimized code monnier@di.epfl.ch (Stefan Monnier) (1995-01-27)
Re: Debugging of optimized code jqb@netcom.com (1995-02-02)
Debugging of optimized code ssimmons@convex.convex.com (1995-02-02)
Re: Debugging of optimized code copperma@grenoble.rxrc.xerox.com (1995-01-30)
Re: Debugging of optimized code wicklund@Intellistor.COM (1995-01-30)
Re: Debugging of optimized code copperma@grenoble.rxrc.xerox.com (1995-01-30)
Debugging of optimized code cliffc@hpl.hp.com (1995-02-02)
Re: Debugging of optimized code bill@amber.ssd.csd.harris.com (1995-02-01)
[3 later articles]
| List of all articles for this month |
Newsgroups: comp.compilers
From: jqb@netcom.com (Jim Balter)
Keywords: debug, optimize
Organization: NETCOM On-line Communication Services (408 261-4700 guest)
References: 95-01-036 95-01-101
Date: Thu, 2 Feb 1995 06:13:58 GMT

Charles Fiterman <cef@geodesic.com> wrote:
>The first question about debugging optimized code is "Why does the user
>want to do it?" The answer may be "Because the bug doesn't show up with
>the optimizer turned off."


It seems to me that this turns things around, since I would ask the question
"Why does the user want to turn off optimization?". The usual reasons are 1)
compilation speed, 2) the optimizer is buggy, 3) the optimized code isn't
debuggable. As processors and compilers become faster, compilation speed
becomes less of an issue. And optimizer bugs should be no different from
other compiler bugs and in fact tend to propagate where optimization is
considered an add-on. Ideally, one would like to have a single method for
compilation, rather two different methods, one for development and one for
production. Not being able to debug optimized code may mean a) inconvenience
for the developer b) duplication of build scripts or complications in
Makefiles c) dual versions of libraries, one optimized and one not d) an
otherwise unnecessary distinction between performance issues and other code
quality issues, possibly leading to ignoring performance altogether e)
difficulty in distinguishing between optimized and unoptimized objects
produced from the same sources, possibly leading to tracking problems and even
the erroneous distribution of unoptimized executables.


>This means various forms of turning off optimization or hideing its
>effects are useless or worse.


Indeed. We should move toward optimization as the norm. The notion of
turning on optimization only to produce a "production" version should become
obsolete.
--
<J Q B>
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.