Quote:
Originally Posted by porter
Often optimizations are incompatible with debuggers because optimizers will re-organize variables on the stack for efficiency, um, basically optimizing the thing.
Optimizers are more aggressive and less forgiving of dodgy code.
Also, if you are using C++ libraries, have these been built with the same optimizations?
Use maximum warning and errors during compilation, for HPUX compilers I use "-Aa -D_HPUX_SOURCE +e +We".
Try GCC and see if that exposes anything, again use "-Wall -Werror".
|
Thank you, porter!
I tried -Aa option. The code won't compile, it complains about the inline statements we have in our code. Apparently, there's a reason why the -AA flag is used. All libraries are built with the same options.
It's weird to see that -g option is not compatible with -O (a typical optimization option).
The aCC man page says that +O2 optimization option is the same as +O1 optimization plus global optimization. What the "global optimization" means in this case? Are there any specific things I have to check in my code for that cause the crash with +O2 option, but not +O1?
Thank you in advance.