We are experiencing bad code generation for a source file using IBM XL C/C++ at -O3
on PowerPC platforms. Its surfaces as a hang and it appears a particular loop is not broken.
The problem only surfaces under XL C/C++. Our testing regime indicates the source file is clean of undefined behavior, memory errors and other errata. We also don't receive strict/nostrict warnings from the compiler for the source file.
We want to compile the source file at -O2
instead of -O3
. We want to add instrumentation, like a pragma, to the source file so it can be guarded appropriately for the compiler. The instrumentation allows others to wire-in other build systems like Cmake and Autotools and things will "just work" for them. (The necessary information is available in the source and not our makefile).
The IBM manual for the compiler is located at IBM XL C/C++ for AIX, V13.1, but damn if I can find the option.
What is the IBM XL C/C++ equivalent to #pragma GCC optimize
? How do we instrument the source code to tell XL C/C++ to use -O2
instead of -O3
?