| United States-English |
|
|
|
![]() |
HP Integrity Servers: HP aC++/HP ANSI C Release Notes > Chapter 2 What’s New in This VersionNew Features in Version A.06.15 |
|
Version A.06.15 of the HP aC++ compiler supports the following new features:
For optimization level+O2or above, printf() and fprintf() calls are now optimized into fputc() or fputs() calls, in trivial cases.Restrictions for the optimization to occur:
To disable this feature for +O2and above, use: +Onolibcalls="fprintf" (or "printf"). To have the compiler list the lines where the optimization was performed, use +Oinfo. +Wmacro:MACRONAME:d1,d2,...,dn The +Wmacrooption disables warning diagnostics d1,d2,...,dn in the expansion of macro MACRONAME. If -1 is given as the warning number, then all warnings are suppressed. This option is not applicable to warning numbers greater than 20000. +Wmacro gets higher priority than the other diagnostic control command-line options that are applicable to the whole source. Diagnostic control pragmas take priority based on where they are placed. This option limits the number of instantiation contexts output by the compiler for diagnostics involving template instantiations. At most num outermost contexts and num innermost contexts are shown. If there are more than 2 * num relevant contexts, the additional contexts are omitted. Omitted contexts are replaced by a single line separating the outermost num contexts from the innermost num contexts, and indicating the number of contexts omitted. The default value for num is 5. A value of 0 removes the limit. This option enables performance advisory messages. The optional level 1, 2, 3, or 4 controls how verbosely the performance advisory messages are emitted. The higher the level, the more messages are generated. Level 1 emits only the most important messages, while level 4 emits all the messages. If the optional level is not specified, it defaults to 2. The new +Wvoption displays the description for diagnostic message numbers d1,d2,...,dn. Specifying this option causes HP Code Advisor to emit the descriptive text for the specified diagnostics to stderr. This option must not be used with any other compiler options. If the description for a diagnostic is not available, HP Code Advisor emits only the diagnostic with a note that the description is not available. This option enables compile-time diagnostic messages for potential errors in using lock/unlock calls in programs that use pthread library based lock/unlock functions. Warnings are emitted for acquiring an already acquired lock, releasing an already released lock, and unconditionally releasing a lock that has been conditionally acquired. This diagnostic checking is based on cross-module analysis performed by the compiler. Therefore, the +wlockoption implicitly enables a limited form of cross-module analysis, even if -ipo or+O4options are not specified. This can lead to a significant increase in the compile time compared to a build without the +wlockoption. Using this option could result in the compiler invoking optimizations other than those that are part of the user-specified optimization level. If +wlockis used in addition to -ipoor +O4, the generated code is not affected, and the compile time does not increase much. This release adds support on the Itanium platform for a new optimization -auto-parallelization - which is enabled by adding the +Oautoparoption to the command-line. This optimization allows applications to exploit otherwise idle resources on multicore or multiprocessor systems by automatically transforming serial loops into multithreaded parallel code. When the +Oautoparoption is used at optimization levels +O3and above, the compiler will automatically parallelize those loops that are deemed safe and profitable by the loop transformer. The default is +Onoautopar, which disables automatic parallelization of loops. Automatic parallelization can be combined with manual parallelization through the use of OpenMP directives and the +Oopenmp option. When both +Oopenmp and +Oautopar options are specified, the compiler honors the OpenMP directives first, and then looks for loops that have not been parallelized manually with OpenMP directives. For these loops, the compiler automatically parallelizes each loop that is both safe and likely to have improved performance when executed in parallel. Programs compiled with the +Oautopar option require the libcps, libomp, and libpthreads runtime support libraries to be present at both compilation and runtime. When linking with the HP-UX B.11.61 linker (patch PHSS_36342 or PHSS_36349), compiling with the +Oautoparoption causes them to be automatically included. Older linkers require those libraries to be specified explicitly or by compiling with +Oopenmp. At present, +Oautoparis only supported when compiling C or Fortran files, and not C++ files. If you use +Oautopar with C or Fortran code in a mixed-language application that also includes C++ files, you must use -mt when compiling and linking the C++ files, similar to the current requirements for +Oopenmp. Please refer to the documentation of the aCC compiler's-mt option for additional information and restrictions. Loop blocking is a combination of strip mining and interchange that improves data cache locality. It is provided primarily to deal with nested loops that manipulate arrays that are too large to fit into the data cache. Under certain circumstances, loop blocking allows reuse of these arrays by transforming the loops that manipulate them so that they manipulate strips of the arrays that fit into the cache. At optimization levels 3 and 4, using +Oloop_block (the default) allows automatic loop blocking. Specifying +Onoloop_block disables loop blocking. At optimization levels 3 and 4, the default for this option has changed from +Onoloop_unroll_jam to +Oloop_unroll_jam, which allows automatic loop unroll-and-jam. The default in C mode of the compiler is now +Olit=all, placing string constants in read-only memory by default. This change over previous versions of the compiler (which defaulted to +Olit=const) improves performance and is in keeping with similar changes in the industry. Note that this may cause a runtime signal 11 if an attempt is made to modify string literals. To force the string to be read/write, you can change the source as follows:
The +macro_debug option controls the emission of macro debug information into the object file: Set +macro_debug to one of the following required values: One of the -g options (-g, -g0, or -g1) must be used to enable the +macro_debugoption. +nomacro_debug suppresses emission of macro debug information into the object file. The +pathtraceoption provides a mechanism to record program execution control flow into global and/or local path tables. The saved information can be used by the HP WDB debugger to assist with crash path recovery from the core files, or to assist when debugging the program by showing the executed branches. The defined values for kind are:
The values can be combined by joining them with a colon. For example: The global_fixed_size and global values are mutually exclusive. If more than one of them are specified on the command line, the last one takes precedence. The same is true for the none value. +pathtracewith no values is equivalent to +pathtrace=global_fixed_size:local. The use of this option and the -mt option must be consistent for all compilation and link steps. That means if -mt is used with +pathtrace at compile time, it should also be used at link time; if -mt is not used with +pathtrace at compile time, it should not used at link time. Otherwise, a link-time error can occur. The following new suboptions have been added to the +check option:
The following new suboptions have been added to the +check=bounds option:
This option is the same as -Bhidden, but only locally defined (non-tentative) symbols, without __declspec(dllexport), are assigned the hidden export class. As with any -B option, -Bhidden_def can be overridden by subsequent -B options on the command line or any binding pragmas in the source. The -dM option requires that-P or -E also be specified. When -dM is present, instead of normal preprocessor output the compiler lists the #define directives it encounters as it preprocesse the file, thus providing a list of all macros that are in effect at the start of the compilation. A common use of this option is to determine the compiler's predefined macros. For example: #pragma OPT_LEVEL has been enhanced to accept an additional keyword, INITIAL. When used with a numeric argument, the OPT_LEVEL pragma sets the optimization level to 0, 1, 2, 3, or 4. The INITIAL argument causes the optimization level in effect at the start of the compilation, whether by default or specified on the command line, to be restored. Previously, #pragma [NO]INLINEwas supported only on HP C and aC++ C-mode. With this release, #pragma [NO]INLINEis now supported in C++ mode as well. The following new assembly intrinsics have been added to the compiler: For more information, see the "Inline assembly for Itanium(R)-based HP-UX" link off http://www.hp.com/go/cpp. Debugging code compiled with optimization levels above +O1is now supported, as described in section 14.22 ("Debugging optimized code") of the Debugging with GDB manual under the "Documentation" link at: http://www.hp.com/go/wdb. The visibility attributes "default", "protected", and "hidden", are equivalent to the options -Bdefault, -Bprotected, and -Bhidden, and the pragmas DEFAULT_BINDING, EXTERN, and HIDDEN, respectively. The warn_unused_result attribute tells the compiler to emit a warning if a caller of a function with this attribute does not use its return value. This is useful for functions where not checking the result can be a security problem or always a program bug, as with realloc()(). A user-defined assignment operator that is a const or volatile member function, is not considered a copy assignment operator, and the compiler will not suppress the declaration of an implicit copy assignment operator. As a result, the implicitly generated version might be chosen during overload resolution, if it is a better match. For example:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||