IBM Support

Documentation errata for IBM XL C/C++ for AIX, V12.1

Preventive Service Planning


Abstract

This page contains corrections and additions to the product documentation shipped with IBM XL C/C++ for AIX, V12.1.

Content

Installation Guide
The following corrections and additions apply to the IBM XL C/C++ for AIX, V12.1 Installation Guide:

Topic location: Before installing XL C/C++ > The installation image and filesets > filesets > Runtime debug memory routine filesets

This topic lists the runtime debug memory routine filesets V5.4.

Should read:

This topic lists the runtime debug memory routine filesets V5.5.


Topic location: Before installing XL C/C++ > The installation image and filesets > filesets > Utilization reporting tool fileset

This topic lists the utilization reporting tool filesets V1.1.

Should read:

This topic lists the utilization reporting tool filesets V1.2.

All references to the version of the utilization reporting tool (urt) in the Installation Guide should be changed to V1.2.


Topic location: Before installing XL C/C++ > System prerequisites

lslpp -L bos.adt.include bos.adt.lib bos.adt.libm bos.loc.* bos.rte bos.rte.libc

Should read:

lslpp -L bos.adt.include bos.adt.lib bos.adt.libm bos.loc.\* bos.rte bos.rte.libc


Compiler Reference
The following corrections and additions apply to the IBM XL C/C++ for AIX, V12.1 Compiler Reference:

Topic location: Configuring compiler defaults > Setting environment variables > Environment variables for parallel processing > Environment variables for OpenMP > OMP_STACKSIZE

The default value for 32-bit mode is 256M. For 64-bit mode, the default is up to the limit imposed by system resources.

Should read:

The default value is 4194304B. The maximum value for 32-bit mode is 256M. For 64-bit mode, the maximum is up to the limit imposed by system resources.


Topic location: Tracking and reporting compiler usage > Understanding the utilization reporting tool

The tool is located in the /opt/ibmurt/1.1/bin directory.

Should read:

The tool is located in the /opt/ibmurt/1.2/bin directory.

A default configuration file ibmurt.cfg is provided in the /opt/ibmurt/1.1/config directory.

Should read:

A default configuration file ibmurt.cfg is provided in the /opt/ibmurt/1.2/config directory.

All references to the version of the utilization reporting tool (urt) in the Compiler Reference should be changed to V1.2.


Topic location: Compiler options reference > Individual option descriptions > -qdfp

The following new information is added:

Note: To use decimal floating-point types and literals, you must also enable specific code in header files by defining the __STDC_WANT_DEC_FP__ macro at compiler time. See Examples.

Examples
To compile myprogram.c so that the compiler supports decimal floating-point types and literals, enter:
xlc myprogram.c -qarch=pwr7 -qdfp -D__STDC_WANT_DEC_FP__


Topic location: Compiler options reference > Individual option descriptions > -qdigraph

Purpose
Enables recognition of digraph key combinations or keywords to represent characters not found on some keyboards.

Should read:

Enables recognition of digraph key combinations C++ onlyand operator keywordsC++ only to represent characters that are not found on some keyboards. Digraph key combinations include <:, <%, and so on. C++ onlyOperator keywords include and, or, and so on.C++ only

Topic location: Compiler options reference > Individual option descriptions > -qinline

Defaults

  • -qnoinline
  • At an optimization level of -O0, the default is -qinline=noauto
  • At optimization levels of -O2 and higher, the default is -qinline=auto
  • -qinline=auto:level=5 is the default suboption of -qinline

Should read:
  • -qnoinline
  • At optimization levels of -O2 and higher, the default is -qinline=noauto
  • -qinline=auto:level=5 is the default suboption of -qinline

Note that the -qinline- and -qinline+ options are supported only by the XL C compiler.


Topic location: Compiler options reference > Individual option descriptions > -O, -qoptimize

The following statement should be added under "Usage":

If optimization level -O3 or higher is specified on the command line, the -qhot and -qipa options that are set by the optimization level cannot be overridden by #pragma option_override(identifier, "opt(level, 0)") or #pragma option_override(identifier, "opt(level, 2)").


Topic location: Compiler options reference > Individual option descriptions > -qtune

The following rows in the Acceptable -qarch/-qtune combinations table:

-qarch optionDefault -qtune settingAvailable -qtune settings
pwr4pwr4auto | pwr4 | pwr5 | pwr7 | ppc970 | balanced
pwr5pwr5auto | pwr5 | pwr7 | balanced
pwr5xpwr5auto | pwr5 | pwr7 | balanced

Should read:

-qarch optionDefault -qtune settingAvailable -qtune settings
pwr4pwr4auto | pwr4 | pwr5 | pwr6 | pwr7 | ppc970 | balanced
pwr5pwr5auto | pwr5 | pwr6 | pwr7 | balanced
pwr5xpwr5auto | pwr5 | pwr6 | pwr7 | balanced


Topic location: Compiler pragmas reference > Individual pragma descriptions > #pragma option_override

Syntax



Should read:



Parameters

#pragma option_override valueEquivalent compiler option
level, 0-O
level, 2-O2
level, 3-O3
level, 4-O4
level, 5-O5
registerspillsize, size-qspill=size
size-qcompact
size, yes
size, no-qnocompact
strict, all-qstrict, -qstrict=all
strict, no, none-qnostrict
strict, suboption_list-qstrict=suboption_list

Should read:

#pragma option_override valueEquivalent compiler option
level, 0-O1
level, 2-O21
level, 3-O32
registerspillsize, size-qspill=size
size-qcompact
size, yes
size, no-qnocompact
strict -qstrict, -qstrict=all
strict, yes
strict, no-qnostrict
strict, suboption_list-qstrict=suboption_list

Notes:
1. If optimization level -O3 or higher is specified on the command line, #pragma option_override(identifier, "opt(level, 0)" or #pragma option_override(identifier, "opt(level, 2)") does not turn off the implication of the -qhot and -qipa options.
2. Specifying -O3 implies -qhot=level=0. However, specifying #pragma option_override(identifier, "opt(level, 3)") in source code does not imply -qhot=level=0.


Topic location: Compiler pragmas reference > Individual pragma descriptions > #pragma reg_killed_by

fs
    Floating-point and status control register

Should read:

fsr
    Floating-point and status control register

Topic location: Compiler pragmas reference > Individual pragma descriptions > #pragma ibm independent_loop

This section should be moved out of the "Pragma directives for parallel processing" section and be put under the "Individual pragma descriptions" section directly.

The following statement should be added:

This pragma only takes effect if you specify the -qsmp or -qhot compiler option.


Topic location: Compiler built-in functions > Synchronization and atomic built-in functions > Synchronization functions > __lwsync, __iospace_lwsync

Load Word Synchronize

Should read:

Lightweight Synchronize


Topic location: Compiler built-in functions > GCC atomic memory access built-in functions

The data types of the parameters that are supported in these functions include Boolean type and any integral scalar type of 1, 2, 4 or 8 bytes, listed as follows.

Should read:

In the prototype of each function, the parameter types T, U, and V can be of pointer or integral type. U and Vcan also be of real floating-point type, but only when T is of integral type. The following tables list the integral and floating-point types that are supported by these built-in functions.

Table 1. Supported data types

Should read:

Table 1. Supported integral data types

The following table should be added:

Table 2. Supported floating-point data types
float
double
long double


Language Reference
The following corrections and additions apply to the IBM XL C/C++ for AIX, V12.1 Language Reference:

Topic location: Declarators > Pointers > Type-based aliasing

In the example:



Should read:




The compiler determines that the result of f += 1.0; is never used subsequently. Thus, the optimizer may discard the statement from the generated code.

Should read:

The compiler determines that the result of f += 1.0 does not affect the value of *p. Thus, the optimizer might move the assignment after the printf statement.


Topic location: Declarators > Initializers > Initialization of structures and unions

You do not have to initialize all members of a structure or union; the initial value of uninitialized structure members depends on the storage class associated with the structure or union variable. In a structure declared as static, any members that are not initialized are implicitly initialized to zero of the appropriate type; the members of a structure with automatic storage have no default initialization. The default initializer for a union with static storage is the default for the first component; a union with automatic storage has no default initialization.

The following definition shows a partially initialized structure:


struct address {
                int street_no;
                char *street_name;
                char *city;
                char *prov;
                char *postal_code;
              };
struct address temp_address =
              { 44, "Knyvet Ave.", "Hamilton", "Ontario" };


The values of temp_address are:

Member
Value
temp_address.street_no44
temp_address.street_nameaddress of string "Knyvet Ave."
temp_address.cityaddress of string "Hamilton"
temp_address.provaddress of string "Ontario"
temp_address.postal_codeDepends on the storage class of the temp_address variable; if it is static, the value would be NULL.

Should read:

You do not have to initialize all members of structure variables. If a structure variable does not have an initializer, the initial values of the structure members depend on the storage class associated with the structure variable:
  • If a structure variable has static storage, its members are implicitly initialized to zero of the appropriate type.
  • If a structure variable has automatic storage, its members have no default initialization.

If a structure variable is partially initialized, all the uninitialized structure members are implicitly initialized to zero no matter what the storage class of the structure variable is. See the following example:

struct one {
   int a;
   int b;
   int c;
};
void main(){
   struct one z1;               // Members in z1 do not have default initial values.
   static struct one z2;        // z2.a=0, z2.b=0, and z2.c=0.
   struct one z3 = {1};         // z3.a=1, z3.b=0, and z3.c=0.
}


In this example, structure variable z1 has automatic storage, and it does not have an initializer, so all the members in z1 do not have default initial values. Structure variable z2 has static storage, and all its members are implicitly initialized to zero. Structure variable z3 is partially initialized, so all its uninitialized members are implicitly initialized to zero.

You do not have to initialize all members of a union. The default initializer for a union with static storage is the default for the first component. A union with automatic storage has no default initialization.


Optimization and Programming Guide
The following corrections and additions apply to the IBM XL C/C++ for AIX, V12.1 Optimization and Programming Guide:

Topic location: Handling floating-point operations > Compiling a decimal floating-point program

The following text:

If you are using decimal floating-point formats in your programs, use the -qdfp option when you compile them. For example, to compile the following Hello World program dfp_hello.c, the compiler invocation is:
xlc -qdfp dfp_hello.c

Should read:

If you are using decimal floating-point formats in your programs, use the -qdfp option and define the __STDC_WANT_DEC_FP__ macro when you compile them.

For example, to compile dfp_hello.c, use the following compiler invocation:


xlc dfp_hello.c -qdfp -qarch=pwr7 -D__STDC_WANT_DEC_FP__


Topic location: Using the C++ utilities > Demangling compiled C++ names > Demangling compiled C++ names with the demangle class library

The following note should be added:

Note: The demangle class library is not threadsafe. If the library functions are used in a multithreaded program, calls to these functions must be serialized.


Topic location: Optimizing your applications > Using profile-directed feedback

The following restriction note should be added under Step 1:

Restriction: When you run an application that is compiled with -qpdf1, you must end the application using normal methods, including reaching the end of the execution for the main function and calling the exit() function in libc (stdlib.h) for C/C++ programs. System calls exit() and _Exit() are considered abnormal termination methods and are not supported. Using abnormal program termination might result in incomplete instrumentation data generated by using the PDF file or PDF data not being generated at all.

Topic location: Coding your application to improve performance > Using rvalue references (C++11)

The following note about std::move and std::forward should be added:

Note:
1. The following sample implements functionality similar to std::move and std::forward:
namespace MyStd {
   template <typename T> struct remove_reference {
       typedef T type;
   };
   template <typename T> struct remove_reference<T&> {
       typedef T type;
   };
   template <typename T> struct remove_reference<T&&> {
       typedef T type;  
   };

   namespace Impl {
       template <typename T> struct NotAnLvalueReference {
           enum { value = 1 };
       };
       template <typename T> struct NotAnLvalueReference<T&> {
           enum { value = 0 };
       };
   }

   template <typename T> inline
   T &&forward(typename remove_reference<T>::type &t) {
       return static_cast<T &&>(t);
   }

   template <typename T> inline
   T &&forward(typename remove_reference<T>::type &&t) {
       static_assert(Impl::NotAnLvalueReference<T>::value,
                     "T cannot be an lvalue reference type when
                     calling this overload.");
       return static_cast<T &&>(t);
   }

   template <typename T> inline
   typename remove_reference<T>::type &&move(T &&t) {
       return static_cast<typename remove_reference<T>::type &&>(t);
   }
}

[{"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Documentation","Platform":[{"code":"PF002","label":"AIX"}],"Version":"12.1","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
06 December 2018

UID

swg21584859