Michael P Friedlander writes: > Hi Folks, > > 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.) If your code does something different with/without -g, then that's a bug in gcc. -g shouldn't make any difference to the behaviour of your program. If your code does somethig different with -O, that's possibly a gcc bug but it's probably a bug in your code. If you use -fno-strict-aliasing and that makes a difference with -O, then that's definitely a bug in your code. Andrew.