| Cray C/C++ Reference Manual | ||
|---|---|---|
| Prev Section | Chapter 2. Compiler Commands | Next Section |
The following sections describe general language options.
When the -h keep=file option is specified, the static constructor/destructor object (.o) file is retained as file. This option is useful when linking .o files on a system that does not have a C++ compiler. The use of this option requires that the main function must be compiled by C++ and the static constructor/destructor function must be included in the link. With these precautions, mixed object files (files with .o suffixes) from C and C++ compilations can be linked into executables by using the loader command instead of the CC command.
The -h restrict=args option globally instructs the compiler to treat certain classes of pointers as restricted pointers. You can use this option to enhance optimizations. This includes vectorization on Cray PVP systems.
Classes of affected pointers are determined by the value contained in args, as follows:
The args arguments instruct the compiler to assume that, in the current compilation unit, each pointer (=a), or each pointer that is a function parameter (=f), or each this pointer (=t) points to a unique object. This assumption eliminates those pointers as sources of potential aliasing, and may allow additional vectorization or other optimizations. These options cause only data dependencies from pointer aliasing to be ignored, rather than all data dependencies, so they can be used safely for more programs than the -h ivdep option.
Caution![]() | Like -h ivdep, the arguments make assertions about your program that, if incorrect, can introduce undefined behavior. You should not use -h restrict=a if, during the execution of any function, an object is modified and that object is referenced through either of the following:
The -h restrict=f and -h restrict=t options are subject to the analogous restriction, with "function parameter pointer" replacing "pointer." |
| Default option: | -h nocalchars |
The -h calchars option allows the use of the @ and $ characters in identifier names. This option is useful for porting codes in which identifiers include these characters. With -h nocalchars, these characters are not allowed in identifier names.
Caution![]() | Use this option with extreme care, because identifiers with these characters are within Cray Research name space and are included in many Cray Research library identifiers, internal compiler labels, objects, and functions. You must prevent conflicts between any of these uses, current or future, and identifier declarations or references in your code; any such conflict is an error. |
| Default option: | -h signedshifts |
(UNICOS/mk systems) The -h [no]signedshifts option affects the result of the right shift operator. For the expression e1 >> e2 where e1 has a signed type, when -h signedshifts is in effect, the vacated bits are filled with the sign bit of e1. When -h nosignedshifts is in effect, the vacated bits are filled with zeros, identical to the behavior when e1 has an unsigned type. The -h nosignedshifts option forces the >> operator to have the same behavior on UNICOS/mk operating systems as on UNICOS operating systems.
| Default option: | -h stack |
(UNICOS systems) The -h stack option specifies the stack calling sequence. The -h nostack option specifies the standard UNICOS static calling sequence and prevents the use of reentrant or recursive functions. The -h nostack option disables autotasking, all tasking directives, and the -h taskcommon and -h taskprivate options.
| Prev Section | Table of Contents | Title Page | Next Section |
| Language (Virtual Functions) | Up one level | Optimization (General) |