www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/03/10/01:16:08

Date: Sun, 10 Mar 1996 08:11:24 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Michael Schuster <SCHUSTER AT merlin DOT e-technik DOT uni-erlangen DOT de>
Cc: djgpp AT delorie DOT com
Subject: Re: Strange Optimization
In-Reply-To: <MAILQUEUE-101.960308133754.416@merlin.e-technik.uni-erlangen.de>
Message-Id: <Pine.SUN.3.91.960310080553.2390I-100000@is>
Mime-Version: 1.0

On Fri, 8 Mar 1996, Michael Schuster wrote:

> I' ve realized a strange(?) behaviour of the optimization switch in GNU 
> C/C++.
> I wrote a program to convert binary files to ASCII files (nothing 
> _really_exiting, I know) and after a few days, it worked really fine. 
> 
> After all I decided to compile with the -O3 option (no error 
> message at all) but when executing suddenly it chrashed. So I 've 
> a simple question: Is that what you 'ld call a bug - or is it quite normal?

Are you sure it isn't a bug in your program that just surfaces when you 
compile with optimizations?  The -O3 switch enables functions inlining; 
maybe this triggers some bug that won't show otherwise.  Does this happen 
with -O or -O2?  I'd suggest to try to debug the optimized program a bit 
before you decide that's a compiler bug.  You can use the `symify' 
program to translate the stack trace printed at the time of crash to a 
list of source filenames and line numbers which will point to the place 
where it crashed.  You can also compile with -O3 *and* -g and debug an 
optimized program with any debugger--in GCC, these two don't contradict.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019