New or changed compiler options and directives

New and changed compiler options and directives are described in this section.

Compiler options can be specified on the command line or through directives embedded in your application source files. See the XL C/C++ Compiler Reference for detailed descriptions and usage information for these and other compiler options.

Table 1. New or changed compiler options and directives
Option/directive Description
-qarch A new suboption has been added to -qarch, specifying -qarch=pwr7 produces object code that contains instructions that run on the POWER7 hardware platforms.
-qassert -qassert is a new option for XL C/C++. It is used to provide information about the characteristics of the files that can help to fine-tune optimizations.
-qconcurrentupdate If you are building kernel extensions, you must use -qconcurrentupdate to enable hot patching. For details, see -qconcurrentupdate in the XL C/C++ Compiler Reference.
-qfuncsect In previous releases,-qfuncsect had minimal size reductions for C++ programs. You can see a significant improvement in the current release.
-qfunctrace You can use -qfunctrace to trace the entry and exit points of functions in a compilation unit or only a specific list of functions.
-qhot

A new suboption has been added for -qhot. The -qhot compiler option is a powerful alternative to hand tuning that provides opportunities to optimize loops and array language.

The -qhot=fastmath option enables the replacement of math routines with available math routines from the XLOPT library only if -qstrict=nolibrary is enabled. -qhot=nofastmath disables the replacement of math routines by the XLOPT library. -qhot=fastmath is enabled by default if -qhot is specified regardless of the hot level.

-qinline Attempts to inline functions instead of generating calls to those functions, for improved performance.
-qipa You can generate relinkable objects while preserving IPA information by specifying -r -qipa=relink.
-qkeepinlines A new suboption exports has been added to the -qkeepinlines option. You can use -qkeepinlines=exports to make sure that the compiler keeps the list of symbols and their definitions from the shared object file compiled with an earlier version of the compiler.
-qlanglvl C++0x New suboptions have been added to -qlanglvl:
  • -qlanglvl=autotypededuction: Controls whether the auto type deduction feature is enabled. This feature can be used to delegate the task of type deduction of an auto variable to the compiler from the type of its initializer expression.
  • -qlanglvl=c99longlong: Controls whether the C99 long long feature is enabled. This feature improves source compatibility between the C and C++ languages.
  • -qlanglvl=c99preprocessor: Controls whether the C99 preprocessor features adopted in C++0x are enabled. This feature can be used to provide a more common preprocessor interface for C and C++ compilers.
  • -qlanglvl=decltype: Controls whether the decltype feature is enabled. This feature can be used to get a type that is based on the resultant type of a possibly type-dependent expression.
  • -qlanglvl=delegatingctors: Controls whether the delegating constructors feature is enabled. This feature can be used to concentrate common initializations in one constructor.
  • -qlanglvl=extendedfriend: Controls whether the extended friend declarations feature is enabled. This feature can be used to accept additional forms of non-function friend declarations.
  • IBM extension -qlanglvl=extendedintegersafe: Controls whether or not unsigned long long int can be used as the type for decimal integer literals that do not have a suffix containing u or U and cannot be represented by the long long int type. This option takes effect only when the -qlanglvl=c99longlong option is specified.
  • -qlanglvl=externtemplate: Controls whether the explicit instantiation declarations feature is enabled. This feature can be used to suppress the implicit instantiation of a template specialization or its members.
  • -qlanglvl=inlinenamespace: Controls whether the inline namespace definitions feature is enabled. This feature can be used to define and specialize members of an inline namespace as if they were also members of the enclosing namespace.
  • -qlanglvl=static_assert: Controls whether the static assertions feature is enabled. This feature can be used to produce compile-time assertions for which a severe error message is issued on failure.
  • -qlanglvl=variadic[templates]: Controls whether the variadic templates feature is enabled. This feature can be used to define class or function templates that have any number (including zero) of parameters.
-qlibmpi You can use -qlibmpi to tune code based on the known behavior of the Message Passing Interface (MPI) functions.
-qlistfmt Generates a report in an XML 1.0 format containing information about some optimizations performed by the compiler and some missed optimization opportunities for inlining, loop transformations, data reorganization and profile-directed feedback.
-qnamemangling There is a new namemangling scheme for this release.
-qpdf1,-qpdf2 New options have been added to -qpdf1,-qpdf2.
-qprefetch A new suboption has been added to -qprefetch. When you work with applications that generate a high cache-miss rate, you can use -qprefectch=assistthread to exploit assist threads for data prefetching.
-qsaveopt The existing -qsaveopt option is enhanced to also include the user's configuration file name and the options specified in the configuration files.
-qsimd Controls whether the compiler can automatically take advantage of vector instructions for processors that support them.
-qskipsrc

When a listing file is generated using the -qsource option, you can use -qskipsrc to control whether the source statements skipped by the compiler are shown in the source section of the listing file. Alternatively, you can use the -qskipsrc=hide option to hide the source statements skipped by the compiler.

-qstackprotect

You can use -qstackprotect to protect your applications against malicious code or programming errors that overwrite or corrupt the stack.

-qstrict

A new suboption has been added to the -qstrict option to allow more control over optimizations and transformations that violate strict program semantics.

-qstrict=vectorprecision disables vectorization in loops where it might produce different results in vectorized iterations than in nonvectorized ones.

-qtune A new suboption has been added to -qtune. If you specify -qtune=pwr7, optimizations are tuned for the POWER7 hardware platforms.
Table 2. Deprecated directives and options
Option/directive Description
#pragma ibm critical This directive is deprecated and might be removed in a future release. You can use the OpenMP equivalent.
#pragma ibm parallel_loop This directive is deprecated and might be removed in a future release. You can use the OpenMP equivalent.
#pragma ibm schedule This directive is deprecated and might be removed in a future release. You can use the OpenMP equivalent.
-Q This option is deprecated and replaced with -qinline.
-qenablevmx This option is deprecated and replaced with the -qsimd=auto option.
-qhot=simd | nosimd -qhot=simd | nosimd are deprecated and might be removed in a future release. You can use -qsimd.
-qinfo=private -qinfo=private is deprecated and replaced with -qreport.
-qinfo=reduction -qinfo=reduction is deprecated and replaced with -qreport.
-qipa=inline | noinline -qipa=inline | noinline are deprecated and might be removed in a future release. You can use -qinline.
-qipa=clonearch | noclonearch -qipa=clonearch | noclonearch is no longer supported. You can use -qtune=balanced.
-qipa=cloneproc | nocloneproc -qipa=cloneproc | nocloneproc is no longer supported. You can use -qtune=balanced.