Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line Options

Options to Control Code Generation

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The following options allow you to control the kind of code that the compiler generates:

-c

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.

+DOosname

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

+DDdata_model

The +DDdata_model option specifies the data model for the compiler.

data_model can be one of the following:

  • 32 (This value generates ILP32 code and is the default.)

  • 64 (This value generates LP64 code.)

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

ILP32 Data Model

LP64 Data Model

The size of an int, long, or pointer data type is 32-bits.

The size of an int data type is 32-bits. The size of a long or pointer data type is 64-bits.

The preprocessor predefined macro _ILP32 is defined.

The preprocessor predefined macros, __LP64__ and _LP64 are defined.

 

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

+DSmodel

The +DSmodel option performs instruction scheduling for a particular implementation of the Itanium®-based architecture.

model can be one of four values.

blended

Tune to run reasonably well on multiple implementations. As old implementation become less important and new implementations are added, the behavior with this value will change accordingly.

itanium

Tune for the Itanium® processor.

itanium2

Tune for the Itanium2® processor.

native

Tune for the processor on which the compiler is running.

The default is blended. Object code with scheduling tuned for a particular model will execute on other HP-UX systems, although possibly less efficiently.

Using +DS to Specify Instruction Scheduling

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.

Compiling in Networked Environments

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.

-S

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

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.