| United States-English |
|
|
|
![]() |
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line OptionsOptions to Control Code Generation |
|
The following options allow you to control the kind of code that the compiler generates: You can use the -c option to compile one or more source files without entering the linking phase. When compiled, the compiler produces an object file (a file ending with .o) for each source file (a file ending with .c, .C, .s, or .i). Note that you must link object files before they can be executed. Example: aCC -c sub.C prog.C In this example, the compiler compiles sub.C and prog.C and puts the relocatable object code in the files, sub.o and prog.o, respectively. The +DOosname option sets the target operating system for the compiler, and is intended for enabling optimizations that are not backward compatible. For instance, the 11.23 compiler introduces new optimized math library functions that require library support not available in prior operating systems. +DO can be used at any level of optimization. The default value for osname is the operating system version on which the compiler is invoked. The syntax for this option is +DOosname, where osname is either 11.20, 11.22 or 11.23. Example: The following example generates code for the HP-UX 11.22 (or later) operating system. Binary incompatible features introduced in later OS versions are inhibited. aCC +DO11.22 +O3 app.C The +DDdata_model option specifies the data model for the compiler. data_model can be one of the following:
This option specifies the data model for the compiler. Table 2-1 “ILP32 Data Model and LP64 Data Model” lists the differences between the two data models. Table 2-1 ILP32 Data Model and LP64 Data Model
Examples: The following command generates code for the 64-bit data model: aCC +DD64 app.C The following command generates code for the 32-bit data model: aCC app.C The +DSmodel option performs instruction scheduling for a particular implementation of the Itanium®-based architecture. model can be one of four values.
The default is blended. Object code with scheduling tuned for a particular model will execute on other HP-UX systems, although possibly less efficiently. Instruction scheduling is different on different implementations of Itanium®-based architectures. You can improve performance on a particular model or processor of the HP-UX system by requesting the compiler to use instruction scheduling tuned to that particular model or processor. Using scheduling for one model or processor does not prevent your program from executing on another model or processor. If you plan to run your program on the same system where you are compiling, you do not need to use the +DS option. The compiler generates code tuned for your system. If you plan to run your program on a particular model of the HP-UX system, and that model is different from the one where you compile your program, use +DSmodel with either the model number of the target system or the processor name of the target system. When compiles are performed using diskless workstations or NFS-mounted file systems, it is important that the default code generation and scheduling are based on the local host processor. The system model numbers of the hosts where the source or object files reside do not affect the default code generation and scheduling. The -S option compiles a program and logs the assembly language output in a corresponding file with a .s suffix. The -S option is only for displaying the assembler code. The generated code is not intended to be used as input to the assembler (as). Example: The following command compiles prog.C to assembly code rather than to object code, and puts the assembly code in the file prog.s. aCC -S prog.C |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||