Re: Debug optimized code

George Neuner <gneuner2@comcast.net>
Tue, 23 Sep 2008 21:35:06 -0400

          From comp.compilers

Related articles
[4 earlier articles]
Re: Debug optimized code rcmetzger@grandecom.net (rcmetzger) (2008-09-17)
Re: Debug optimized code sh006d3592@blueyonder.co.uk (Stephen Horne) (2008-09-18)
Re: Debug optimized code barry.j.kelly@gmail.com (Barry Kelly) (2008-09-19)
Re: Debug optimized code gneuner2@comcast.net (George Neuner) (2008-09-20)
Re: Debug optimized code DrDiettrich1@aol.com (Hans-Peter Diettrich) (2008-09-21)
Re: Debug optimized code sh006d3592@blueyonder.co.uk (Stephen Horne) (2008-09-22)
Re: Debug optimized code gneuner2@comcast.net (George Neuner) (2008-09-23)
Was: Debug optimized code; Now: How many compiler bugs have you seen? cfc@shell01.TheWorld.com (Chris F Clark) (2008-09-24)
Re: Was: Debug optimized code; Now: How many compiler bugs have you se ArarghMail809@Arargh.com (2008-09-24)
Re: Debug optimized code; Now: How many compiler bugs have you seen? armelasselin@hotmail.com (Armel) (2008-09-24)
Re: Was: Debug optimized code; Now: How many compiler bugs have you se n.pipenbrinck@cubic.org (Nils) (2008-09-25)
Re: Was: Debug optimized code; Now: How many compiler bugs have you se sh006d3592@blueyonder.co.uk (Stephen Horne) (2008-09-25)
Re: Was: Debug optimized code; Now: How many compiler bugs have you se gneuner2@comcast.net (George Neuner) (2008-09-25)
[9 later articles]
| List of all articles for this month |

From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers
Date: Tue, 23 Sep 2008 21:35:06 -0400
Organization: A noiseless patient Spider
References: 08-09-076 08-09-105 08-09-110
Keywords: debug, optimize
Posted-Date: 24 Sep 2008 12:08:00 EDT

On Mon, 22 Sep 2008 04:43:42 +0100, Stephen Horne
<sh006d3592@blueyonder.co.uk> wrote:


>On Sat, 20 Sep 2008 04:28:36 -0400, George Neuner
><gneuner2@comcast.net> wrote:
>
>>And please don't debug code at one level and then crank up the
>>optimization for a production compile. Your ship code should always
>>be exactly what you've debugged.
>
>I disagree.
>
>Your ship code should always be what you've tested.
>You debug to diagnose bugs - not to detect them.


I agree with you, but you misunderstood me. I am in no way advocating
debugging over testing. My point is that a developer should never
test/debug code compiled with one set of optimizations and then ship
untested/undebugged code compiled using a different set of
optimizations. "It works, now compile it for speed and ship it." I
have seen people do this and it always backfires.




>Probably 99% of errors in new code are simple logic errors. Around
>99% of those behave identically whether the optimiser is on or off.


Depending on the language, there are common mistakes that can be
masked by debug compiles or which may only become apparent under
certain optimizations. And the reverse is also true - in certain
languages it is possible to write code that works fine optimized but
will break when unoptimized.


Not to mention that the compiler itself is more likely to have
strangely interacting bugs in its higher optimization levels.


George



Post a followup to this message

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