Monday, May 11, 2009

xlc Compiler options to be used with debugger

While doing source code debugging, one generally compiles with -g option, and assumes that all compiler optimizations have been turned off. However, as far as the xlc compiler is concerned, this might not necessarily be true. With -g the compiler puts in line-number information and turns off some optimizations, but not all optimizations. To tell the compiler to turn off ALL optimizations, the -qnoopt option should be employed.