At Fri, 30 Jun 2006 19:35:03 -0700, Michael P Friedlander wrote: > The behavior of a numerical code I'm working on varies > drastically depending on whether I've compiled it with > the -g or -O flags. > > The code's behavior under -g is much more stable, and I'm > wondering if the -O flag is exposing a bug that I need to > fix. Are there some gcc flags that I should try that might > guide me in finding the problem? (I've already tried the > obvious -Wall which gives no warnings.) A couple of other generally useful options for numerical programs: -W, -Wconversion Also test your code for memory errors with valgrind or -fmudflap. Most likely you'll have to look at the code itself and see where the differences come from. -- Brian Gough Network Theory Ltd, Publishing Free Software Manuals --- http://www.network-theory.co.uk/