Compiler options and pragma directives

This section describes new or changed compiler options and pragma directives.

You can specify compiler options on the command line. You can also modify compiler behavior through pragma directives embedded in your application source files. For detailed descriptions and usage information for XL C/C++ compiler options, see the XL C/C++ Compiler Reference.

-qarch
The option default is updated to pwr4. Suboptions denoting old hardware families are silently upgraded to newer architectures.
The following suboptions are added or updated:
-qarch=pwr7
This suboption produces object code containing instructions that run on the POWER7®, POWER7+™, or POWER8™ hardware platforms.
-qarch=pwr8
This suboption produces object code containing instructions that run on the POWER8 hardware platforms.
-qcheck
The following suboptions are added or updated:
-qcheck=stackclobber
This suboption detects a certain type of stack corruption in your programs.
-qcheck=unset
This suboption checks for automatic variables that are used before they are set at run time.
-qdbgfmt=dwarf4
This suboption generates debugging information in DWARF 4 format.
-qhelp
This option displays the man page of the compiler.
-qinfo
The compiler does not issue informational messages for the following files:
  • Files in the standard search paths for compiler and system header files.
  • Files that are ultimately included by the files in the standard search paths for compiler and system header files.

The following suboptions are added or updated:

-qinfo=mt
This suboption notifies you about potential places where synchronization is needed.
-qinfo=unset
This suboption detects automatic variables that are used before they are set, and flags them with informational messages at compile time.
-qlanglvl
The following suboptions are added or updated:
C++11 begins-qlanglvl=defaultanddelete
This suboption enables the defaulted and deleted functions feature, with which you can define explicitly defaulted functions whose implementations are generated by the compiler to achieve higher efficiency. With this feature, you can also define deleted functions whose usages are disabled by the compiler to avoid calling unwanted functions.C++11 ends
C++11 begins-qlanglvl=nullptr
This suboption enables the nullptr feature. With this feature, you can initialize a null pointer with the nullptr constant. The null pointer can be converted to the pointer type, pointer-to-member type, or bool type. The nullptr constant can be distinguished from the integer 0 for overloaded functions.C++11 ends
-qnamemangling (C++ only)
The following suboption is added:
-qnamemangling=v13
This suboption enables the name mangling scheme that is compatible with IBM® XL C/C++ V13.1.
-qpdf1=unique
This suboption creates a unique PDF file for each process during run time.
-qprefetch=dscr
This suboption helps to improve the runtime performance of your applications. You can specify a value for dscr depending on your system architecture.
-qsimd=auto
This suboption controls the autosimdization, which was performed by the deprecated -qhot=simd option.
-qtune
The option default is updated.
The following suboptions are added or updated:
-qtune=pwr7
This suboption specifies that optimizations are tuned for the POWER7 or POWER7+ hardware platforms.
-qtune=pwr8
This suboption specifies that optimizations are tuned for the POWER8 hardware platforms.
SMT suboptions
The new -qtune simultaneous multithreading (SMT) suboptions allow you to specify a target SMT to direct optimization for best performance in that mode.
-qunroll=n
This suboption hints to the compiler to unroll loops by a factor of n. If the loop has fewer than n iterations, it is fully unrolled.
-qvisibility
This option specifies visibility attributes for entities. Entity visibility attributes describe whether and how entities defined in one module can be referenced or used in other modules. Visibility attributes affect entities with external linkage only, and cannot increase the visibility of other entities.

New or changed pragma directives

#pragma GCC visibility push, #pragma GCC visibility pop
This pair of pragma directives is the pragma equivalent of the -qvisibility option. The pragma directives are used to specify visibility attributes for external linkage symbols.
#pragma namemangling (C++ only)
This pragma directive is the pragma equivalent of the -qnamemangling option. The pragma directive #pragma namemangling(v13) is added to enable the name mangling scheme that is compatible with IBM XL C/C++ V13.1.