HP Compilers for HP Integrity Servers (September 2011)

You can specify large pages using the linker +pd and +pi options, or using the
chatr(1) command. It is often worth testing a wide range of page sizes, as application
performance can vary unpredictably.
Describing application characteristics
HP compilers support several options and function attributes that describe the coding
style used by the application. These options allow the compiler to make assumptions
about the behavior of the application. Following these coding guidelines can be
time-consuming but rewarding because these options often yield substantial performance
gains.
The option +Otype_safety={off|limited|ansi|strong} describes the type
of safety rules used by the code being compiled.
off is the default. It indicates aliasing can occur freely across types.
limited specifies an observance of the ANSI aliasing rules with unnamed
objects treated for aliasing as though they are of unknown type.
ansi specifies an observance of ANSI aliasing rules with unnamed objects
treated as named objects.
strong specifies the ANSI aliasing rules, except that accesses through values
of character types are not permitted to touch other non-character objects and the
compiler assumes field addresses are not taken.
The option +Onoptrs_to_globals declares to the compiler statically-allocated
data (including file-scoped globals, file-scoped statics, and function-scoped statics)
will not be accessed through pointers. Conversely, the option +Optrs_to_globals
assumes that statically-allocated data can be accessed through pointers.
The options +Oparmsoverlap and +Onoparmsoverlap declare whether or not
function parameters may overlap with others. For Fortran, the default is
+Onoparmsoverlap, which says that arguments will not overlap with one another
or with any variables in common blocks. The option +Oparmsoverlap allows such
overlap. For C and C++, the default is +Oparmsoverlap, which allows memory
accessed indirectly through a pointer argument to overlap memory accessed indirectly
through another pointer argument, or to overlap statically-allocated data. The option
+Onoparmsoverlap declares that no such overlap will occur. The __restrict
keyword (or restrict in C99 mode) may also be used.
The malloc attribute indicates that the return value of the given function either points
to a memory location or is a null pointer, that the returned memory can be pointed
to only by the returned pointer (not, e.g., by any global variable), and that no other
malloc calls can return the same memory location or a pointer to it. This enables the
compiler to make more aggressive aliasing assumptions about addresses returned
by the given function. For example:
void *mymalloc(int i) __attribute__((malloc));
26 HP compilers for HP Integrity servers