|
VMS Help CXX, Qualifiers, /ASSUME *Conan The Librarian |
/ASSUME
/ASSUME=(option[,...])
Controls compiler assumptions. You may select the following
options:
Option Usage
[NO]WRITABLE_STRING_ Stores string constants in a writable
LITERALS psect. Otherwise, such constants are
placed in a nonwriteable psect. The
default is NOWRITABLE_STRING_LITERALS.
[NO]ACCURACY_ Specifies whether certain code
SENSITIVE transformations that affect floating-point
operations are allowed. These changes
may or may not affect the accuracy of the
program's results.
If you specify NOACCURACY_SENSITIVE, the
compiler is free to reorder floating-
point operations based on algebraic
identities (inverses, associativity, and
distribution). This allows the compiler to
move divide operations outside of loops,
which improves performance.
The default, ACCURACY_SENSITIVE, directs
the compiler to use only certain scalar
rules for calculations. This setting can
prevent some optimization.
[NO]ALIGNED_OBJECTS Controls an optimization for dereferencing
pointers.
Dereferencing a pointer to a longword- or
quadword-aligned object is more efficient
than dereferencing a pointer to a byte-
or word-aligned object. Therefore, the
compiler can generate more optimized code
if it makes the assumption that a pointer
object of an aligned pointer type does
point to an aligned object.
Because the compiler determines the
alignment of the dereferenced object
from the type of the pointer, and the
program is allowed to compute a pointer
that references an unaligned object (even
though the pointer type indicates that
it references an aligned object), the
compiler must assume that the dereferenced
object's alignment matches or exceeds the
alignment indicated by the pointer type.
The default, /ASSUME=ALIGNED_OBJECTS,
allows the compiler to make such an
assumption. With this assumption made,
the compiler can generate more efficient
code for pointer dereferences of aligned
pointer types.
To prevent the compiler from assuming
the pointer type's alignment for
objects to which it points, use the
/ASSUME=NOALIGNED_OBJECTS qualifier.
This option causes the compiler to
generate longer code sequences to perform
indirect load and store operations to
avoid hardware alignment faults for
arbitrarily aligned addresses. Although
/ASSUME=NOALIGNED_OBJECTS might generate
less efficient code than the default
/ASSUME=ALIGNED_OBJECTS option, by
avoiding hardware alignment faults, it
speeds the execution of programs that
reference unaligned data.
[NO]GLOBAL_ARRAY_NEW Controls whether calls to global array new
and delete are generated as specified by
ANSI. Pre-ANSI global array new generated
calls to operator new(). According to
ANSI, use of global array new generates
calls to operator new()[]. The GLOBAL_
ARRAY_NEW option also defines the macro
__GLOBAL_ARRAY_NEW.
GLOBAL_ARRAY_NEW generates calls to
operator new()[] for global array
new expressions such as new int[4];
this is the default when compiling
/STANDARD=RELAXED, /STANDARD=STRICT_ANSI,
/STANDARD=GNU, and /STANDARD=MS.
NOGLOBAL_ARRAY_NEW generates calls to
operator new() for global array new
expressions such as new int[4]; and
preserves compatibility with Version
5.n; this is the default when compiling
/STANDARD=ARM.
[NO]HEADER_TYPE_ Controls whether the compiler appends a
DEFAULT file extension to a file name. The default
is /ASSUME=NOHEADER_TYPE_DEFAULT. To
prevent the compiler from appending a file
extension to files (such as STL header
files that must not have file extensions)
use the /ASSUME=NOHEADER_TYPE_DEFAULT
qualifier.
[NO]MATH_ERRNO Controls whether intrinsic code is
generated for math functions that set
the errno variable. The default is
/ASSUME=MATH_ERRNO, which does not allow
intrinsic code for such math functions to
be generated, even if /OPTIMIZE=INTRINSICS
is in effect. Their prototypes and call
formats, however, are still checked.
[NO]POINTERS_TO_ Controls whether the compiler can safely
GLOBALS assume that global variables have not had
their addresses taken in code that is not
visible to the current compilation.
The default is /ASSUME=POINTERS_TO_
GLOBALS, which directs the compiler to
assume that global variables have had
their addresses taken in separately
compiled modules and that, in general,
any pointer dereference could be accessing
the same memory as any global variable.
This is often a significant barrier to
optimization.
While the /ANSI_ALIAS option allows
some resolution based on data type,
/ASSUME=POINTERS_TO_GLOBALS provides
significant additional resolution and
improved optimization in many cases.
The /ASSUME=NOPOINTERS_TO_GLOBALS option
tells the compiler that any global
variable accessed through a pointer
in the compilation must have had its
address taken within that compilation.
The compiler can see any code that takes
the address of an extern variable. If it
does not see the address of the variable
being taken, the compiler can assume that
no pointer points to the variable.
Note that /ASSUME=NOPOINTERS_TO_GLOBALS
does not tell the compiler that the
compilation never uses pointers to access
global variables.
Also note that on I64 systems, the
NOPOINTERS_TO_GLOBALS option is ignored
and should not cause any behavior changes.
[NO]STDNEW Controls whether calls are generated to
the ANSI or pre-ANSI implementation of
the operator new(). On memory allocation
failure, the ANSI implementation throws
std::bad_alloc, while the pre-ANSI
implementation returns 0.
/ASSUME=STDNEW generates calls to the ANSI
new() implementation; this is the default
when compiling with /STANDARD=RELAXED,
/STANDARD= STRICT_ANSI, and /STANDARD=GNU.
/ASSUME=NOSTDNEW generates calls to the
pre-ANSI new() implementation; this is the
default when compiling with /STANDARD=ARM
and /STANDARD=MS.
[NO]TRUSTED_SHORT_ Allows the compiler additional assumptions
ALIGNMENT about the alignment of short types that,
although thought to be naturally aligned,
might cross a quadword boundary.
The TRUSTED_SHORT_ALIGNMENT option
indicates that the compiler should assume
any datatype accessed through a pointer
is naturally aligned. This generates the
fastest code, but can silently generate
the wrong results when an unaligned short
object crosses a quadword boundary.
Note that on I64 systems, the TRUSTED_
SHORT_ALIGNMENT option is ignored and
should not cause any behavior changes.
The NOTRUSTED_SHORT_ALIGNMENT tells the
compiler that short objects might not be
naturally aligned. The compiler generates
slightly larger (and slower) code that
gives the correct result, regardless of
the actual alignment of the data. This is
the default.
Note that the NOTRUSTED_SHORT_ALIGNMENT
option does not override the __unaligned
type qualifier or the /ASSUME=NOALIGNED_
OBJECTS option.
[NO]WHOLE_PROGRAM Tells the compiler that except for well-
behaved library routines, the whole
program consists only of the single
object module being produced by this
compilation. The optimizations enabled
by /ASSUME=WHOLE_PROGRAM include all those
enabled by /ASSUME=NOPOINTERS_TO_GLOBALS
and possibly other optimizations.
Note that on I64 systems, the WHOLE_
PROGRAM option is ignored and should not
cause any behavior changes.
The default is /ASSUME=NOWHOLE_PROGRAM.
|
|