.\" .\". \"ident "@(#)ctrans:man/CC.1 1.1.1.1" .\"." Sun @(#)CC.1 1.136 10/21/98 16:29:42 SMI .\". \"This CC man page is generated by: troff -man CC.1 .\". \alias pm_new '(troff -t -Tlw -mansun \!* | lpr -n ) >& /dev/null &' .\". \alias pman_new '(troff -Tlw -mansun -t \!*) | preview &' .\". \"This man page reflects the Sun`s native compiler .\". \"All Rights Reserved .\". \"THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF .\". \"SUN MICROSYSTEMS .\". \"The copyright notice above does not evidence any .\". \"actual or intended publication of such source code. .TH CC 1 "98/12/14" .if n .na .UC 4 .SH NAME CC \- Sun WorkShop C++ Compiler 5.0 .SH SYNOPSIS .IP \fBCC .RB [ \-386 ] .RB [ \-486 ] .RB [ \-a ] .RB [ \-B ( dynamic | static\fR)] .RB [ \-c ] .RB [ \-cg ( 89 |\fB92\fR)] .RB [ \-compat [ = ( 4\fR|\fB5\fR)]] .RB [ \+d ] .RB [ \-D\fIname [ =\fIdef ]] .RB [ \-d ( y |\fBn\fR)] .RB [ \-dalign ] .RB [ \-dryrun ] .RB [ \-E ] .RB [ +e ( 0 | 1\fR)] .RB [ \-fast ] .RB [ \-features=\fIa ] .RB [ \-flags ] .RB [ \-fnonstd ] .RB [ \-fns [ = ( yes\fR|\fBno\fR)]] .RB [ \-fprecision=\fIp ] .RB [ \-fround=\fIr ] .RB [ \-fsimple [ =\fIn ]] .RB [ \-fstore ] .RB [ \-ftrap=\fIt ] .RB [ \-G ] .RB [ \-g ] .RB [ \-g0 ] .RB [ \-H ] .RB [ "\-h\ \fIname" ] .RB [ \-help ] .RB [ \-i ] .RB [ "\-I\ \fIdir" ] .RB [ \-inline=\fIrlst ] .RB [ \-instances=\fIi ] .RB [ \-keeptmp ] .RB [ \-KPIC ] .RB [ \-Kpic ] .RB [ \-L\fIdir ] .RB [ \-l\fIlib ] .RB [ \-libmieee ] .RB [ \-libmil ] .RB [ \-library=\fIlib ] .RB [ \-migration ] .RB [ \-misalign ] .RB [ \-mt ] .RB [ \-native ] .RB [ \-noex ] .RB [ \-nofstore ] .RB [ \-nolib ] .RB [ \-nolibmil ] .RB [ \-noqueue ] .RB [ \-norunpath ] .RB [ \-O [ \fIn ]] .RB [ "\-o\ \fIfile" ] .RB [ +p ] .RB [ \-P ] .RB [ \-p ] .RB [ \-pentium ] .RB [ \-pg ] .RB [ \-PIC ] .RB [ \-pic ] .RB [ \-pta ] .RB [ \-pti\fIdir ] .RB [ \-pto ] .RB [ \-ptr\fIdir ] .RB [ \-ptv ] ./".RB [ "\-Qcomponent\ \fIcomponent path" ] ./".RB [( \-Q | \-q ) "dir\ \fIdir" ] .RB [( \-Qoption | \-qoption ) "\ \fIphase option" ] ./" .RB [( \-Qpath | \-qpath ) "\ \fIdir" ] .RB [( \-Qproduce | \-qproduce ) "\ \fItype" ] .RB [ \-qp ] .RB [ \-R\fIpath ] .RB [ \-readme ] .RB [ \-S ] .RB [ \-s ] .RB [ \-sb ] .RB [ \-sbfast ] .RB [ \-staticlib=\fIlib ] .RB [ \-temp=\fIdir ] .RB [ \-template=\fIw ] .RB [ \-time ] .RB [ \-U name ] ./".RB [ "\-u\ \fIname" ] .RB [ \-unroll=\fIn ] .RB [ \-V ] .RB [ \-v ] .RB [ \-vdelx ] .RB [ \-verbose=\fIv ] .RB [ \+w ] .RB [ \+w2 ] .RB [ \-w ] .RB [ \-xa ] .RB [ \-xar ] .RB [ \-xarch=\fIa ] .RB [ \-xcache=\fIc ] .RB [ \-xcg (\fB89\fR|\fB92\fR)] .RB [ \-xchip=\fIc ] .RB [ \-xcode=\fIv ] .RB [ \-xF ] .RB [ \-xhelp= (\fBflags\fR|\fBreadme\fR)] .RB [ \-xild (\fBoff\fR|\fBon\fR)] .RB [ \-xinline=\fIrlst ] .RB [ \-xlibmieee ] .RB [ \-xlic_lib=\fIlib ] .RB [ \-xlicinfo ] .RB [ \-Xm ] .RB [ \-xM ] .RB [ \-xM1 ] .RB [ \-xMerge ] .RB [ \-xnolib ] .RB [ \-xnolibmil ] .RB [ \-xnolibmopt ] .RB [ \-xO [ \fIn ]] .RB [ \-xpg ] .RB [ \-xprefetch [ = (\fByes\fR|\fBno\fR)]] .RB [ \-xprofile=\fIp ] .RB [ \-xregs=\fIr ] .RB [ \-xs ] .RB [ \-xsb ] .RB [ \-xsbfast ] .RB [ \-xspace ] .RB [ \-xtarget=\fIt ] .RB [ \-xtime ] .RB [ \-xunroll=\fIn ] .RB [ \-xwe ] .RB [ \-ztext ] .RI [ file ] \&.\|.\|. .SH Release 5.0 This release supports standard C++ and SPARC v9. .sp Be sure to read the C++ README file by using the command: .sp .B \ \ \ \ \ CC \-xhelp=readme .SH DESCRIPTION \f3CC\f1 converts C++ and assembly source files to object files, and links object files and libraries into executable programs. .PP Programs containing C++ objects must be linked with \f3CC\f1. .\" .\" .PP .B CC takes arguments ending in .B .c, .C, .cc, .cxx, .cpp, or .B .i to be C++ source programs. The .B .i files are presumed to be preprocessed files. Arguments ending in .B .s are presumed to be assembly source files Arguments ending in .B .o are presumed to be object files. .PP Files whose names do not end with the above suffixes are treated as object programs or libraries and are handed over to the link editor. Unless .BR \-c\fR, .BR \-S\fR, .B \-E\fR, or .B \-P\fR is specified, these programs and libraries, together with the results of any specified compilations or assemblies, are linked in the order given to produce an output file named .BR a.out . You can specify a name for the executable by using the .B \-o option. .LP If a single file is compiled and linked all at once, the intermediate files are deleted. .LP The Incremental Link Editor (\f4ild\f1) is sometimes used in place of linker \f4ld\f1 for incremental linking. See \f3\-xildon\f1 and \f3\-xildoff\f1 for more information. .LP Before you use the .B CC command, insert the name of the directory in which you have chosen to install the C++ compilation system at the .I beginning of your search path. For instructions on setting your search path, see the csh(1) or the sh(1) man page. .SH COMPILING FOR 64-BIT SOLARIS 7: This version of the compiler can produce 64-bit object binaries on 32-bit or 64-bit Solaris 7 SPARC Platform Edition. The resulting executable will run only on 64-bit SPARC or UltraSPARC processors under Solaris 7 with the 64-bit kernel. Compilation, linking, and execution of 64-bit objects can only take place in a Solaris 7 environment. .LP Compiling for 64-bit Solaris 7 is indicated by the .B \-xarch=v9 and .B \-xarch=v9a options. Note that one of these options must be specified even if .B \-xtarget or .B \-fast are also specified. In such a case, the .B \-xarch=v9 or .B \-xarch=v9a option must appear AFTER any .B \-xtarget or other option that sets For example: .LP .B \ \ \ \ \-xtarget=ultra \-xarch=v9 .LP Note that .B \-xtarget=ultra and .B \-xtarget=ultra2 imply .B \-xarch=v8 and do not automatically signal .B \-xarch=v9 or .B \-xarch=v9a. .LP When building shared dynamic libraries with .B \-xarch=v9 or .B v9a on 64-bit Solaris 7, the .B \-Kpic or .B \-KPIC option MUST ALSO be specified. .LP See also the new .B \-xcode=abs32|abs64|pic13|pic32 option for specifying code address forms. .LP 64-bit Solaris 7 not only enables 64-bit integer and pointer data, but also support for large files and large arrays. For more details, see the README file: .LP \ \ \ \ \ .B \/SUNWspro\/READMEs\/64bit_Compilers .LP (where \ is usually .B \/opt in a standard install. \) .LP For general information on 64-bit Solaris for software developers, see the "Solaris 7 64-bit Developer's Guide" in AnswerBook2. .LP .\" .\" ADD BACK IN WHEN TEA IS AVAILABLE! Also -Ztha .\" .\" .SH OPTIONS .PP For a complete description of the C++ compiler options, including examples, see the .I C++ User's Guide. .PP .B CC accepts the following options: .TP 1i .B \-386 .I (x86) Use \f3\-xtarget=386\f1. .TP .B \-486 .I (x86) Use \f3\-xtarget=486\f1. .TP .B \-a Use .B \-xa. .RS .PP See also the .BR tcov (1) man page. .RE .TP .BI \-B binding Specifies whether library bindings for linking are dynamic (shared) or static (nonshared). The values for .I binding are .B static and .BR dynamic . .br .B \-Bdynamic is the default. You can use the .B \-B option to toggle several times on a command-line. .RS .PP For more information on the .BI \-B binding option, see the .BR ld (1) man page and the Solaris documentation. .PP .BR \-Bdynamic \(emDirects the link editor to look for .BI lib lib .so files. Use this option if you want shared library bindings for linking. If the .BI lib lib .so files are not found, it looks for .BI lib lib .a files. .PP .B \-Bstatic \fR\(em\fR Directs the link editor to look .I only for files named \f4lib\f2lib\fP.a\f1. The .B \&.a suffix indicates that the file is static, that is, nonshared. Use this option if you want nonshared library bindings for linking. .PP This option and its arguments are passed to the linker, .BR ld . .pp If you compile and link in separate steps, and use .BI \-B binding on the command line, you must use it in the link step as well. .RE .TP .B \-c Directs the .B CC driver to suppress linking with .B ld and produces a .B \&.o file for each source file. If you specify only one source file on the command-line, then you can explicitly name the object file with the .B \-o option. For example: .RS .PP o If you enter .B CC .B \-c .BR x\&.cc , the object file, .BR x.o , is generated. .br o If you enter .B CC .B \-c .BR x\&.cc .B \-o .BR y\&.o , the object file, .BR y.o , is generated. .PP See also .B \-o .I filename\fR. .RE .TP .BR \-cg ( 89 | 92 ) Use .BR \-xcg ( 89 | 92 ). See also .BR \-xtarget=native . .TP .BR \-compat [ = (\fB4\fR|\fB5\fR)] Sets the compiler to be compatible with 4.0.1, 4.1, and 4.2 compilers; or with full 5.0. This option controls the preprocessor .BR \__cplusplus macro. .sp The C++ compiler has two principal modes. One accepts the semantics and language defined by the Annotated C++ Reference Manual (ARM) and used in the 4.2 compiler (the compatibility mode, .BR \-compat=4 ). The other accepts constructs according to the ANSI/ISO standard (standards mode, .BR \-compat=5 ). These two modes are incompatible with each other because the ANSI/ISO standard forces significant, incompatible changes in name mangling, vtable layout, and other ABI details. These two modes are differentiated by the .B \-compat option as shown in the following values. .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .B \-compat=4 Compile for compatibility with C++ 4.0.1, C++ 4.1, and C++ 4.2 (Sets __cplusplus macro to 1.) .TP 1.5i .B \-compat=5 Compile with full C++ 5.0 features. (Sets __cplusplus macro to 199711L.) .RE .RS .PP Defaults: .sp If the .B \-compat option is not specified, .B \-compat=5 is assumed. If only .B \-compat is specified, .B \-compat=4 is assumed. .PP Interactions: .sp The .B \-xarch=v9 option and the .BR \-compat [ =4 ] option are not supported when used together. .RE .TP .B \+d Prevents the compiler from expanding C++ inline functions. This option is turned on when you specify .BR \-g , the debugging option. .sp The debugging option, .BR \-g0 , does not turn on .BR +d . See .BR \-g0 . .sp Warning: .sp .2 For large programs that rely heavily on inline functions, the amount of additional code generated may be substantial. .TP .BR \-D\fIname [ =\fIdef ] Defines a macro symbol .I name to the preprocessor. Doing so is equivalent to including a .B #define directive at the beginning of the source. If you do not use .BI = "def," .I name is defined as .BR 1 . You can use multiple .B \-D options. .RS .PP The following values are predefined: .PP .I SPARC and x86: .sp .B "_\&_BUILTIN_VA_ARG_INCR" .br .B "_\&_cplusplus" .br .B "_\&_DATE__" .br .B "_\&_FILE__" .br .B "_\&_LINE__" .br .B "_\&_STDC__" .br .B "_\&_SVR4" .br .B "_\&_SUNPRO_CC" = 0x500 .br .B "_\&_SUNPRO_CC_COMPAT" = 4 or 5 .br .B "_\&_sun" .br .B sun .br .B "_\&_TIME__" .br .BR "_\&_\f2`uname -s`\f1_\f2`uname -r`\f1 (replacing invalid characters with underscores, for example: \-D__SunOS_5_3, \-D__SunOS_5_4) .br .B "_\&_unix" .br .B unix .br .B "_WCHAR_T" .br .B "__ARRAYNEW" if the "array" forms of operators new and delete are enabled (see "-features=[no%]arraynew") .br .B "_BOOL" if type bool is enabled (see "-features=[no%]bool") .br .sp .I SPARC only: .sp .B "_\&_sparc" .br .B sparc (32-bit compilation modes only) .sp .I SPARC V9 only: .sp .B __sparcv9 (64-bit compilation modes only) .sp .I x86 only: .sp .B "_\&_i386" .br .B i386 .sp Defaults: .pp If you do not use \fR[\fI=def\fR], .I name is defined as 1. ..sp Warnings: ..sp If .B +p is used, .B sun, unix, sparc and .B i386 are not defined. .RE .TP .BR \-d ( y | n ) Allows or disallows dynamic libraries for the entire executable. .sp .B \-dy specifies dynamic linking, which is the default, in the link editor. .sp .B \-dn specifies static linking in the link editor. .sp This option and its arguments are passed to .BR ld . ..sp Warning: ..sp If you compile and link in separate steps, and use .B \-dn|dy in the compile command, you must use .B \-dn|dy in the link step as well. .TP .BR \-dalign .I (SPARC) Generates .B double-word load and .B store instructions whenever possible for improved performance. This option assumes that all .BR double "-typed" data are .BR double-word "-aligned." If you compile one unit with .BR \-dalign , compile all units of a program with .BR \-dalign , or you might get unexpected results. .TP .B \-dryrun Displays what options the driver has passed to the compiler. This option directs the driver .B CC to show, but not execute, the commands constructed by the compilation driver. .TP .B \-E Directs the .B CC driver to run only the preprocessor on C++ source files, and to send the result to .B stdout (standard output). No compilation is done; no .B .o files are generated. ..sp Output from this option is not supported as input to the C++ compiler when templates are used. .TP .BR +e ( 0 | 1 ) Controls virtual table generation. Invalid and ignored in compat=5 mode. ..sp Values: .RS .TP .2i o .B \+e0 suppresses the generation of virtual tables, and creates external references to those that are needed. .TP .2i o .B \+e1 creates virtual tables for all defined classes with virtual functions. .RE .TP .B \-fast Selects a combination of compilation options for optimum execution speed. This option provides near maximum performance for most applications by expanding the following compilation options: .B \-dalign .I (SPARC only) .B \-fns .I (SPARC) .B \-fsimple .I (SPARC only) .B \-ftrap=%none .I (SPARC, x86) .B \-xlibmil .I (SPARC, x86) .B \-nofstore .I (x86 only) .B \-xO4 .I (SPARC, x86) .B \-xlibmopt .I (SPARC, x86 only) .B \-xtarget=native .I (SPARC, x86) .RS .sp Interactions: .PP If you combine .B \-fast with other compilation options, the .B \-dalign option applies; see the description for .BR \-dalign . .PP The code generation option, the optimization level, and use of inline template files can be overridden by subsequent flags. For example, although the optimization level set by .B \-fast is .br .BR \-xO4 , if you specify .B \-fast .BR \-xO3 , the optimization level becomes .BR \-xO3 . The optimization level that you specify will override a previously set optimization level. .PP Warnings: .sp Do not use this option for programs that depend on IEEE standard floating-point exception handling; different numerical results, premature program termination, or unexpected SIGFPE signals might occur. .sp .BR Note "\(emThe criteria for the .B \-fast option vary with the Sun C, C++, FORTRAN 77, and Pascal compilers. Please see the appropriate documentation for the specifics. .sp .PP The .B \-fast option includes .B \-fns \-ftrap=%none; that is, this option turns off all trapping. In previous SPARC releases, the \fB\-fast\fR macro option included \fB\-fnonstd\fR, now it does not. .sp See the .I Numerical Computation Guide, .BR ieee_sun (3m). .RE .TP .BI \-features= a Enables/disables various C++ language features. .sp The following flags are valid for both .B \-compat=4 and .B \-compat=5 unless otherwise specified. .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .RB \&[ no% ] altspell [Do not] Recognize alternative token spellings (for example, "and" for "&&"). .TP 1.5i .RB \&[ no% ] anachronisms [Do not] Allow anachronistic constructs. .TP 1.5i .RB \&[ no% ] arraynew .RB ( -compat=4 only) [Do not] Recognize array forms of .B operator new and .B operator delete (for example, .B "operator new[] (void*)" ). When enabled, the macro .B \_\_ARRAYNEW = 1. When not enabled, the macro is not defined. For details on the use of this flag with -compat=5, see the Migration Guide. .TP 1.5i .RB \&[ no% ] bool [Do not] Allow the bool type and literals. When enabled, the macro .B \_BOOL = 1. When disabled, the macro is not defined. .TP 1.5i .RB \&[ no% ] conststrings [Do not] Put literal strings in Read-Only memory. .TP 1.5i .RB \&[ no% ] except [Do not] Allow C++ exceptions. .TP 1.5i .RB \&[ no% ] explicit [Do not] Recognize the keyword .BR explicit . .TP 1.5i .RB \&[ no% ] export [Do not] Recognize the keyword .BR export . .TP 1.5i .RB \&[ no% ] iddollar [Do not] Allow a $ as a non-initial identifier character. .TP 1.5i .RB \&[ no% ] localfor [Do not] Use new local-scope rules for the .B for statement. .TP 1.5i .RB \&[ no% ] mutable [Do not] Recognize the keyword .BR mutable . .TP 1.5i .RB \&[ no% ] namespace .RB ( \-compat=4 only) [Do not] Recognize keywords .BR namespace , .BR using . .TP 1.5i .RB \&[ no% ] rtti .RB ( \-compat=4 only) [Do not] Allow runtime type identification (RTTI). .RE .RS .PP Defaults: If .B \-features is not specified, the following is assumed for .BR \-compat=4 : .B \-features=%none, anachronisms, except, longlong, transitions. .sp If .B \-features is not specified, the following is assumed for .BR \-compat=5 : .BR \-features=%all, no%iddollar. .RE .TP .B \-flags Displays a brief description of each compiler flag. Also displayed are: phone numbers to call to obtain additional information on Sun products and for technical support. (This option is the same as .BR \-help .) .TP .B \-fnonstd .I (x86) Causes nonstandard initialization of floating-point arithmetic hardware. .RS .PP In addition, this option causes hardware traps to be enabled for floating-point overflow, division by zero, and invalid operations exceptions. .PP These results are converted into .B SIGFPE signals. If the program has no .B SIGFPE handler, it terminates with a memory dump (unless you limit the core dump size to 0). .PP Default: If .B \-fnonstd is not specified, IEEE 754 floating-point arithmetic exceptions do not abort the program, and underflows are gradual. .PP See the .I Numerical Computation Guide for more information. .RE .TP .BR \-fns [ = (\fBno\fR|\fByes\fR)] .I (SPARC) Selects SPARC non-standard floating-point mode. .RS .PP Default: Without this flag, the nonstandard floating point mode is not enabled automatically. Standard IEEE 754 floating-point computation takes place, that is, underflows are gradual. .sp This flag causes the nonstandard floating-point mode to be enabled when a program begins execution. .sp On some SPARC platforms, the nonstandard floating-point mode disables "gradual underflow," causing tiny results to be flushed to zero rather than to produce subnormal numbers. It also causes subnormal operands to be silently replaced by zero. On those SPARC platforms that do not support gradual underflow and subnormal numbers in hardware, use of this option can significantly improve the performance of some programs. .sp Optional use of \f2=yes\f1 or \f2=no\f1 provides a way of toggling the \f3-fns\f1 flag following some other macro flag that includes \f3-fns\f1, such as \f3-fast\f1. .sp \f3-fns\f1 is the same as \f3-fns=yes\f1. .br \f3-fns=yes\f1 selects non-standard floating point. .br \f3-fns=no\f1 selects standard floating point. .PP Warnings: .sp When nonstandard mode is enabled, floating-point arithmetic may produce results that do not conform to the requirements of the IEEE 754 standard. .sp This option is effective only on SPARC platforms and only if used when compiling the main program. On x86 systems, the option is ignored. .sp If you compile one routine with .BR \-fns , then compile all routines of the program with the .B \-fns option; otherwise you can get unexpected results. .RE .TP .BI \-fprecision= p .I (x86) Sets floating-point rounding precision mode. \fIp\fR must be one of: .BR single , .BR double , .BR extended . .sp The .B \-fprecision flag sets the rounding precision mode bits in the Floating Point Control Word. These bits control the precision to which the results of basic arithmetic operations (add, subtract, multiply, divide, and square root) are rounded. .sp The following table shows the meanings of the values of \fIp\fR: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&single Rounds to an IEEE single-precision value .TP 1i .B \&double Rounds to an IEEE double-precision value .TP 1i .B \&extended Rounds to the maximum precision available .RE .RS .PP When .I p is .B single or .B double, this flag causes the rounding precision mode to be set to .B single or .B double precision, respectively, when a program begins execution. When .I p is .B extended or the .B \-fprecision flag is not used, the rounding precision mode remains as the .BR extended precision. .PP The .B single precision rounding mode causes results to be rounded to 24 significant bits, and .B double precision rounding mode causes results to be rounded to 53 significant bits. In the default .B extended precision mode, results are rounded to 64 significant bits. This mode controls only the precision to which results in registers are rounded, and it does not affect the range. All results in register are rounded using the full range of the extended double format. Results that are stored in memory are rounded to both the range and precision of the destination format. .PP The nominal precision of the .B float type is .BR single . The nominal precision of the .B long double type is .BR extended . .PP Defaults: .sp When the .B \-fprecision flag is not specified, the rounding precision mode defaults to .BR extended . .PP Warnings: .sp This option is effective only on x86 devices and only if used when compiling the main program. On SPARC devices, this option is ignored. .RE .TP .BI \-fround= r Sets the IEEE rounding mode in effect at startup. .sp .I r must be one of: .B nearest, tozero, negative, positive. .RS .TP 1i .B \&Value .B Meaning .TP 1i .B nearest Rounds towards the nearest number and breaking ties to even numbers. .TP 1i .B tozero Round-to-zero. .TP 1i .B negative Round-to-negative-infinity. .TP 1i .B positive Round-to-positive-infinity. .PP Default: When the .B \-fround option is not specified, the rounding mode defaults to .B \-fround=nearest. .PP This option sets the IEEE 754 rounding mode that: .TP .2i o Can be used by the compiler in evaluating constant expressions. .TP .2i o Is established at runtime during the program initialization. .TP The meanings are the same as those for the \fBieee_flags\fR function, which may be used to change the mode at runtime. .PP If you compile one routine with .BI \-fround= r , compile all routines of the program with the same .BI \-fround= r option; otherwise, you can get unexpected results. This option is effective only if used when compiling the main program. .RE .TP .BR \-fsimple [ =\fIn ] Selects floating-point optimization preferences. .RS .PP If \fIn\fR is present, it must be 0, 1 or 2. .RE .RS .sp The following table shows the \fB\-fsimple\fR values: .TP .B \&Value .B Meaning .TP .5i .B \&0 Permits no simplifying assumptions. Preserves strict IEEE 754 conformance. .TP .5i .B \&1 Allows conservative simplification. The resulting code does not strictly conform to IEEE 754, but numeric results of most programs are unchanged. .TP .5i \& With .B \-fsimple=1 , the optimizer can assume the following: .TP 1i \& IEEE 754 default rounding/trapping modes do not change after process initialization .TP 1i \& Computation producing no visible result other than potential floating point exceptions might be deleted .TP 1i \& Computation with infinities or NaNs as operands needs to propagate NaNs to their results; e.g., x*0 might be replaced by 0 .TP 1i \& Computations do not depend on sign of zero .TP .5i \& With .BR \-fsimple=1 , the optimizer is not allowed to optimize completely without regard to roundoff or exceptions. In particular, a floating point computation cannot be replaced by one that produces different results with rounding modes held constant at runtime. .br .B \-fast implies .BR \-fsimple=1 . .TP .5i .B \&2 Permits aggressive floating point optimization that may cause many programs to produce different numeric results due to changes in rounding. For example, permits the optimizer to replace all computations of \fBx/y\fR in a given loop with \fBx*z\fR, where \fBx/y\fR is guaranteed to be evaluated at least once in the loop, .B z=1\/y , and the values of y and z are known to have constant values during execution of the loop. .RE .RS Defaults: .sp .2 If .B \-fsimple is not designated, the compiler uses .B \-fsimple=0. .sp If .B \-fsimple is designated but no value is given for .I n, the compiler uses .B \-fsimple=1. .sp Interactions: .B \-fast implies .B \-fsimple=1. .sp Warnings: .sp .2 This option can break IEEE 754 conformance. .RE .TP .B \-fstore .I (x86) Forces precision of floating-point expressions. .sp This option causes the compiler to convert the value of a floating-point expression or function to the type on the left side of an assignment - when that expression or function is assigned to a variable, or when that expression is cast to a shorter floating-point type rather than leaving the value in a register. .RS .PP To turn off this option, use the .B \-nofstore option. .RE .RS .PP Warnings: .sp .2 Due to roundoffs and truncation, the results may be different from those that are generated from the register values. .RE .TP .BI \-ftrap= t Sets the IEEE trapping mode in effect at startup. .RS .sp This option sets the IEEE 754 trapping modes that are established at program initialization, but does not install a .B SIGFPE handler. You can use .B ieee_handler to simultaneously enable traps and install a .B SIGFPE handler. When more than one value is used, the list is processed sequentially from left to right. .PP \fIt\fR is a comma-separated list that consists of one or more of the following: .RE .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .RB \&[ no% ] division [Do not] Trap on division by zero. .TP 1.5i .RB \&[ no% ] inexact [Do not] Trap on inexact result. .TP 1.5i .RB \&[ no% ] invalid [Do not] Trap on invalid operation. .TP 1.5i .RB \&[ no% ] overflow [Do not] Trap on overflow. .TP 1.5i .RB \&[ no% ] underflow [Do not] Trap on underflow. .TP 1.5i .B %all Trap on all of the above. .TP 1.5i .B %none Trap on none of the above. .TP 1.5i .B common Trap on invalid, division by zero, and overflow. .RE .RS .PP Note that the .RB [ no% ] form of the option is used only to modify the meanings of the .B %all or .B common value and and must be used with one of these values, as shown in the example. The .RB [ no% ] form of the option by itself does not explicitly cause a particular trap to be disabled. .sp If you wish to enable the IEEE traps, .B \-ftrap=common is the recommended setting. .sp Defaults: .sp .2 If .B \-ftrap is not specified, the .B \-ftrap=%none value is assumed. (Traps will not be enabled automatically.) .sp Examples: .sp .2 When one or more terms is given, the list is processed sequentially from left to right, thus .B \-ftrap=%all, no%inexact means to set all traps except .BR inexact . .sp Interactions: .sp .2 The mode may be changed at runtime with .BR ieee_handler (3) . .sp Warnings: .sp .2 If you compile one routine with \fB\-ftrap=\fIt\fR, compile all routines of the program with the same .br .BI \-ftrap= t option; otherwise, you can get unexpected results. .sp Use the .B \-ftrap=inexact trap with caution, as it will result in the trap being issued whenever a floating-point value cannot be represented exactly. For example, the following statement may generate this condition: .sp .B x = 1.0 / 3.0; .sp This option is effective only if used when compiling the main program. .RE .TP .B \-G Instructs the linker to build a dynamic shared library instead of an executable file; see the .BR ld (1) man page and the .I C++ Library Reference. All source files specified in the command-line are compiled with .B \-Kpic by default. .sp When building a shared library that uses templates, it is necessary in most cases to include in the shared library those template functions that are instantiated in the template database. Using this option automatically adds those templates to the shared library as needed. .sp The following options are passed to .B ld if .B \-c is not specified: .RS .TP .2i o .B \-dy .TP .2i o .B \-G .RE .TP .B \-g Instructs both the compiler and the linker to prepare the file or program for debugging. The tasks include: .RS .TP .2i o Producing more detailed information, known as stabs, in the symbol table of the object files and the executable .TP .2i o Producing some "helper functions," which the Debugger can call to implement some of its features .TP .2i o Disabling the inline generation of functions; that is, using this option implies the .B \+d option .TP .2i o Disabling certain levels of optimization. .TP .2i Interactions: You can use this option along with .B \-O for the optimization level that you desire. .sp If you use this option with .BR \-xO , you will get limited debugging information. .sp This option makes .B \-xildon the default incremental linker option in order to speed up the compile-edit-debug cycle. See the description for .BR \-xildon and .BR \-xildoff . This option invokes .B ild in place of .B ld unless any of the following are true: .TP .2i o The .B \-G option is present .TP .2i o The .B \-xildoff option is present .TP .2i o Any source files are named on the command line. .TP See also the explanations for .B \-g0 and .BR \+d , as well as the .BR ld (1) man page. The .I Debugging a Program with Sun WorkShop guide provides details about dbx stabs and "lazy stabs." .RE .TP .B \-g0 Instructs the compiler to prepare the file or program for debugging, but not to disable inlining. This option is the same as .B \-g, except that .B \+d is disabled. ..sp See also the description for the .B \+d option. .TP .B \-H On the standard error output .BR (stderr) , prints, one per line, the path name of each .B #include file contained in the current compilation. .TP .BI \-h name Assigns the name .I name to the generated shared dynamic library. .sp This is a loader option, passed to .BR ld . In general, the name after .B \-h should be exactly the same as the one after .BR \-o . A space between the .B \-h and .I name is optional. .sp The compile-time loader assigns the specified name to the shared dynamic library you are creating. It records the name in the library file as the intrinsic name of the library. If there is no .br .BI \-h name option, then no intrinsic name is recorded in the library file. ..sp Every executable file has a list of needed shared library files. When the runtime linker links the library into an executable file, the linker copies the intrinsic name from the library into that list of needed shared library files. If there is no intrinsic name of a shared library, then the linker copies the path of the shared library file instead. This command-line is an example: .br .B % .B CC .B \-G .B \-o .B libx.so.1 .B \-h .B libx.so.1 .B a\&.o .B b\&.o .B c\&.o .TP .B \-help Use .BR \-flags . .TP .BI \-i Tells the linker, .BR ld(1) , to ignore any .B LD_LIBRARY_PATH setting. .TP .BI \-I pathname Adds .I pathname to the list of directories that are searched for .B \#include files with relative file names \(em those that do not begin with a slash. The preprocessor searches for .B #include files in this order: .RS .PP 1. For includes in the form .B "#include\ \"foo.h\"" (where quotation marks are used), the directory containing the source. .PP 2. For includes in the form .B (where angle brackets are used), the directory containing the source file is .I not searched. .PP 3. In the directories named with .B \-I options, if any. .PP 4. In the directories for compiler-provided C++ header files: .br .B \/opt\/SUNWspro/SC5.0\/include\/CC .br for compat=5 or CC4 for compat=4; the actual path depends on where the compiler was installed. .PP 5. In the directories for compiler-provided ANSI C header files: .br .B \/\fIopt\fB\/SUNWspro/SC5.0\/include\/CC .br for compat=5 or CC4 for compat=4; the actual path depends on where the compiler was installed. .PP .PP 6. In .B \/usr\/include .RE .RS .TP .BR Note "\(em If .BI \-pti path is not used, the compiler looks for template files in .BI \-I pathname. It is recommended that you use .BI \-I pathname instead of .BI \-pti path. .RE .TP \f3\-inline=\f2rlst\f1 Use .BI -xinline= rlst. .TP .BI \-instances= a Controls the placement and linkage of template instances. .tp The following table shows the meanings of the values of \fIa\fR: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&extern Places all needed instances into the template repository and gives them global linkage. (If an instance in the repository is out of date, it will be reinstantiated.) .TP 1i .B \&explicit Places explicitly instantiated instances into the current object file and gives them global linkage. Does not generate any other needed instances. .TP 1i .B \&global Places all needed instances into the current object file and gives them global linkage. .TP 1i .B \&semiexplicit Places explicitly instantiated instances into the current object file and gives them global linkage. Places all instances needed by the explicit instances into the current object file and gives them static linkage. Does not generate any other needed instances. .TP 1i .B \&static Places all needed instances into the current object file and gives them static linkage. .RE .RS .PP Default: If .B instances is not specified, .B \-instances=extern is assumed. .sp Warnings: .PP For all values other than .BR extern , the template definitions must be included (directly or indirectly) within the current compilation unit. The compiler silently skips the instantiation if the definition is not available. .PP The .B static and .B semiexplicit values may produce invalid results. .I See the .I C++ User's Guide. .RE .TP .B \-keeptmp Retains the temporary files that are created during compilation. Along with .BR \-verbose=diags , this option is useful for debugging. .TP .B \-KPIC (SPARC) Same as .BR \-xcode=pic32 . .sp (x86) Same as .BR \-Kpic . .TP .B \-Kpic (SPARC) Same as .BR \-xcode=pic13 . .sp (x86) Produces position-independent code. Use this option to compile source files when building a shared library. Each reference to a global datum is generated as a dereference of a pointer in the global offset table. Each function call is generated in pc-relative addressing mode through a procedure linkage table. .TP .BI \-L dir Adds .I dir to the list of directories to be searched for libraries. .sp This option is passed to .BR ld . The directory, .IR dir , is searched before compiler-provided directories. .TP .BI \-l lib Add library .BI lib lib .a or .BI lib lib .so to linker's list of search libraries. .sp This option is passed to .BR ld . Normal libraries have names such as .BI lib lib .a or .BI lib lib .so where the .B lib and .B .a or .B .so parts are required. You can specify the .I lib part with this option. Put as many libraries as you want on a single command line; they are searched in the order specified with .BI \-L dir. .sp Use this option after your object file names. .TP .B \-libmieee Use .BR \-xlibmieee . .TP .B \-libmil Use .BR \-xlibmil . .TP .BI \-library= l Incorporates specified CC-provided libraries into compilation and linking. .sp If this option is specified, the proper .B \-I paths are set during compilation. The proper .B \-L, \-Y P, \-R paths, and .B \-l options are set during linking. .sp Values: .sp .I l is a comma-separated list of library specifiers. .sp The following table shows the meanings of the values for .I l: .sp For .BR \-compat=4 : .RS .TP 1i .B \&Value .B Meaning .TP 1i .RB \&[ no% ] rwtools7 [Do not] Use Tools.h++ v7 .TP 1i .RB \&[ no% ] rwtools7_dbg [Do not] Use debug-enabled Tools.h++ v7 .TP 1i .RB \&[ no% ] complex [Do not] Use .BR libcomplex , complex arithmetic .TP 1i .RB \&[ no% ] libC [Do not] Use .BR libC , C++ support .TP 1i .RB \&[ no% ] gc [Do not] Use .BR libgc , garbage collection .TP 1i .RB \&[ no% ] gc_dbg [Do not] Use debug-enabled .BR libgc , garbage collection .TP 1i .B \&%all Use all libraries, in the order .B rwtools7, complex, gc, libC .TP 1i .B \&%none Use none of the above .P For .BR \-compat=5 : .TP 1i .B \&Value .B Meaning .TP 1i .RB \&[ no% ] rwtools7 [Do not] Use Tools.h++ v7 .TP 1i .RB \&[ no% ] rwtools7_dbg [Do not] Use debug-enabled Tools.h++ v7 .TP 1i .RB \&[ no% ] iostream [Do not] Use .BR libiostream , the classic iostreams library. (If using this value, do not use .BR Cstd ) .TP 1i .RB \&[ no% ] Cstd [Do not] Use .BR libCstd , C++ standard library (If using this value, do not use .BR iostream ) .TP 1i .RB \&[ no% ] Crun [Do not] Use .BR libCrun , C++ runtime library .TP 1i .RB \&[ no% ] gc [Do not] Use .BR libgc , garbage collection. .TP 1i .RB \&[ no% ] gc_dbg [Do not] Use debug-enabled .BR libgc , garbage collection. .TP 1i .B \&%all Use all libraries, in the order .BR %none , rwtools7 , Cstd , Crun , gc .TP 1i .B \&%none Use none of the above .RE .RS .PP Defaults: For .BR \-compat=4 , if .B \-library is not specified, .sp .B \-library=%none, libC .sp For .BR \-compat=5 , if .B \-library is not specified, .sp .B \-library=%none,Cstd,Crun .sp Examples: .sp To link without any C++ libraries, use .sp .B CC \-library=%none .sp To use the older classic iostreams facility rather than the newer standard C++ library, use .sp .B CC \-library=iostream,no%Cstd .sp To use RogueWave .B tools.h++ v7 libraries, use .B CC \-library=rwtools7 .sp Interactions: .sp Only one rwtools library can be used at a time. Only one of .B iostream or .B Cstd may be used. Libraries are linked in the order listed above. .sp Programs linking neither .B libC nor .B Crun might not use all features of the C++ language. .sp The specified libraries are linked after user-specified libraries, and before system support libraries. .sp Warnings: .sp The set of libraries is not stable and might change from release to release. .sp See also: .sp .BR \-I , \-l , \-R , \-staticlib , \-xnolib , .sp .I C++ Library Reference, .IR Tools.h++ User's Guide , .I Tools.h++ Class Library Reference , .I C++ Standard Reference Library .RE .TP .B \-migration Displays a pointer to the .I C++ Migration Guide, which contains information about incompatibilities between versions 4.0.1, 4.1, and 4.2 of the compiler and the 5.0 compiler. .sp NOTE - This option might cease to exist in the next release. .TP .B \-misalign .I (SPARC) Permits misaligned data, which would otherwise generate an error, in memory. .sp Very conservative loads and stores must be used for the data, that is, one byte at a time. Using this option can cause significant degradation in peformance when you run the program. .sp If possible, do not link aligned and misaligned parts of the program. .TP .B \-mt Compile and link for multithreaded code. .sp This option compiles source files with .B \-D_REENTRANT and augments the set of support libraries to include .B \-lthread in the required order. .sp This flag is required if the application or libraries are multithreaded. .sp Warnings: .sp To ensure proper library linking order, use this option, rather than .BR \-lthread . .sp See also: .BR \-xnolib . .TP .B \-native Use .BR \-xtarget=native . .TP .B \-noex Use .BR \-features=no%except . .TP .B \-nofstore .I (x86) Disables forced precision of expression. .sp This option does not force the value of a floating-point expression or function to the type on the left side of an assignment but leaves the value in a register, when that expression or function is assigned to a variable, or is cast to a shorter floating-point type. .sp See also .BR \-fstore . .TP .B \-nolib Use .BR \-xnolib . .TP .B \-nolibmil Use .BR \-xnolibmil . .TP .B \-noqueue Disables license queueing. If no license is available, this option returns without queueing your request and without compiling. A nonzero status is returned for testing makefiles. .TP .B \-norunpath Does not build the path for shared libraries into the executable. .sp If an executable file uses shared libraries, then the compiler normally builds in a path that points the runtime linker to those shared libraries. To do so, the compiler passes the .B \-R option to .BR ld . The path depends on the directory where you have installed the compiler. .RS .PP This option is helpful if you have installed the compiler in some nonstandard location, and you ship an executable file to your customers, who need not work with that nonstandard location. .PP Interactions: .sp .2 If you use any shared libraries under the compiler installed area (default location .BR \/opt\/SUNWspro\/lib ) and you also use .BR \-norunpath , then you should either use the .B \-R option at link time or set the environment variable .B LD_LIBRARY_PATH at run time to specify the location of the shared libraries. This will allow the runtime linker to find the shared libraries. .RE .TP .B \-O Same as .B \-xO2 .TP .BR \-xO [ \fIlevel ] Use .BR \-xO [ \fIlevel ]. .TP .BI \-o " filename" Sets the name of the output file (with the suffix, .BR \&.o ) or the executable file to .IR filename . .sp Warning: .pp .I filename must have the appropriate suffix for the type of file to be produced by the compilation (see .SM FILES\s0\fR). It cannot be the same file as the source file, since the .B CC driver does not overwrite the source file. .TP .B \+p Use \f3\-features=no%anachronisms\f1. .TP .B \-P Only preprocesses source: does not compile. (Outputs a file with a .B \&.i suffix.) .sp This option does not include preprocessor-type line number information in the output. .TP .B \-p Prepares the object code to collect data for profiling with .BR prof . This option invokes a runtime recording mechanism that produces a .B mon.out file at normal termination. .RS .PP You can also perform this task with the Analyzer. Refer to the .BR analyzer (1) man page. .RE .TP .B \-pentium .I (x86) Use .BR \-xtarget=pentium . .TP .B \-pg Use .BR \-xpg . .TP .B \-PIC Use .BR \-KPIC . .TP .B \-pic Use .BR \-Kpic . .TP .B \-pta Use .B \-template=wholeclass. .TP .BI \-pti path Specifies an additional search directory for template source. .RS .PP This option is an alternative to the normal search path set by .BI \-I pathname . If the .BI \-pti path flag is used, the compiler looks for template definition files on this path and ignores the .BI \-I pathname flag. .sp Using .br .BI \-I pathname flag instead of .BI \-pti path produces less confusion. .RE .TP .B \-pto Use \fB\-instances=static\fR. .TP .BI \-ptr path Specifies the directory of the template repository. .sp The template repository cache files are stored in .IR path/\fBSunWS_cache\fR. The template repository configuration files are stored in .br .IR path/\fBSunWS_config\fR. .sp You cannot use multiple .B \-ptr options. .sp Examples: .RS .TP .2i .B \-ptr\/tmp\/Foo specifies the repository subdirectories .B \/tmp\/Foo\/SunWS_cache and .BR \/tmp/Foo/SunWS_config . .TP Interactions: .sp The subdirectory names can be changed with the environmental variables .B SUNWS_CACHE or .B SUNWS_CONFIG . .sp Warnings: .sp If you use .B \-ptr to compile, you must also use .B \-ptr to link. .RE .TP .B \-ptv Use \fB\-verbose=template\fR. ./".B \-Qcomponent \fIcomponent path\fP ./"Insert directory \fIpath\fP in search path for \fIcomponent\fP. ./".I path ./"is the path you want searched. ./".I component ./"is any component invoked by the \fBCC\fP driver, for example \fBccfe\fP, ./"or it can be all. ./"The compile stops with a fatal error if ./".I component ./"is not found in the specified path. .TP .B \-Qoption \fIphase option\fP Passes the option, to the compilation phase. .sp To pass more than one option, specify them in order as a comma-separated list. .sp The following table shows the possible values for .IR prog : .RS .TP 1.5i .I "SPARC Architecture" .I "x86 Architecture" .TP 1.5i .B ccfe .B ccfe .TP 1.5i .B iropt .B cg386 .TP 1.5i .B cg .B codegen .TP 1.5i .B CClink .B CClink .TP 1.5i .B ld .B ld .RE .RS .PP Examples: .sp In the following command-line, when .B ld is invoked by the .B CC driver, .B \-Qoption passes the option, .B \-i to .BR ld : .br .B "% CC \-Qoption ld \-i test.c" .RE .TP .B \-qoption \fIphase option\fP Use .BR \-Qoption . .TP .B \-qp Same as .BR \-p . .TP .B \-Qproduce \fIsourcetype\fP Causes the .B CC driver to produce source code of the type .IR sourcetype . Source code types are shown in the following table: .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .RB \&.i Preprocessed C++ source from .B ccfe .TP 1.5i .RB \&.o Object file from .B cg, the code generator .TP 1.5i .RB \&.s Assembler source from .B cg .RE .TP .B \-qproduce \fIsourcetype\fP Use .BR \-Qproduce . .TP .BI \-R pathname Builds dynamic library search paths into the executable file. .sp Multiple instances of .BI \-R pathname are concatenated, with each .I pathname separated by a colon. Without this option specified, the compiler passes one of the following default search paths to the linker: .sp .B /opt/SUNWspro/lib (for standard installs) .sp .B \/lib (for non-standard installs into .B .sp If both the .B LD_RUN_PATH and the .B \-R option are specified, then the path from .B \-R is scanned, and the path from .B LD_RUN_PATH is ignored. ..sp This option is passed to .BR ld . .TP .B \-readme Displays the contents of the .B README file. The .B README file is paged by the command specified by the environment variable, .BR PAGER . If .B PAGER is not set, the default paging command is .BR more . .TP .B \-S Compiles and generates only assembly code. This option causes the .B CC driver to compile the program and output an assembly source file, but not assemble the program. The assembly source file is named with a .B \&.s suffix. .TP .B \-s Strip the symbol table from the executable file. This option removes all symbol information from output executable files. This option is passed to .BR ld . .TP .B \-sb Use .BR \-xsb . .TP .B \-sbfast Use .BR \-xsbfast . .TP .BI \-staticlib= l Indicates which C++ libraries are to be linked statically. .sp Values: ..sp The following table shows the meanings of the values of .IR l . .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .RB \&[ no% ] \fIlibrary\fR See .B \-library for the specific libraries. .TP .B \&%all Link all libraries specified in the .B \-library option statically. .TP .B \&%none Link no libraries statically. .RE .RS .PP Default: .sp If .B \-staticlib is not specified, .B \-staticlib=%none is assumed. .sp Interactions: .sp For C++ libraries selected explicitly with the \fB\-library\fR option or implicitly through its defaults, libraries specified with \fB\-staticlib\fR are linked statically. If a library specified with \fB\-staticlib\fR is not selected with \fB\-library\fR or its defaults, it is not linked. .sp Examples: .sp .B CC \-staticlib=Crun .sp links .B libCrun statically because .B Crun is a default value for .BR \-library . .sp However, .B CC \-library=no%Cstd \-staticlib=Cstd .sp will not link Crun at all because .B Crun is not in the specified .B \-library set. .sp Warnings: .sp This set of libraries is not stable and might change from release to release. .RE .TP .BI \-temp= dir Defines directory for temporary files. .sp This option sets the name of the directory for the temporary files, generated during the compilation process, to be .IR dir . See also .BR \-keeptmp . .TP .BI \-template= w Enables/disables various template options. ..sp The following table shows the meaning of the value of \fIw\fR: .RS .TP 1.3i .B \&Value .B Meaning .TP 1.3i .RB \&[ no% ] wholeclass Directs the compiler [not] to instantiate a whole template class, rather than only those functions that are used. This option creates a \fB.o\fR file for each member of a class. You must reference at least one member of the class; otherwise, the compiler does not instantiate any members for the class. .RE .TP .B \-time Use .BR \-xtime . .TP .BI \-U name Deletes command-line definition of preprocessor symbol .B name. .sp This option affects only -D options on the command line, including those implicitly placed there by the CC driver. It has no effect on other predefined macros or on macro definitions in source files. The .B \-U option is: .RS .TP .2i o Equivalent to putting .BR #undef on the first line of the first file seen by the compiler. .TP .2i o The inverse of the .B \-D option. .RE .RS .PP You can specify multiple .B \-U options on the command-line. .TP Warnings: .sp .2 This option is order-sensitive if used with the .B \-D option, and is processed after all .B \-D options are processed. .RE .TP .BI \-unroll= n Same as .BI \-xunroll= n. ..sp .TP .B \-V Same as .B \-verbose=version. .TP .B \-v Same as .B \-verbose=diags. .TP .B \-vdelx This is an obsolete flag that will be removed in future releases. This flag is available only for .B \-compat=4. Don't use this flag unless you have bought some software from a third-party vendor and the vendor recommends using this flag. .sp .2 For expressions using .BR delete[] , this option generates a call to the runtime library function .B \_vector_deletex_ instead of generating a call to .BR \ _vector_delete_ . The function .B \_vector_delete_ takes two arguments: the pointer to be deleted and the size of each array element. .sp .2 The function .B \_vector_deletex_ behaves the same as .B \ _vector_delete_ except that it takes an additional third argument: the address of the destructor for the class. This third argument is not used by the function but is provided to be used by third-party vendors. .sp .2 Default: .sp .2 The compiler generates a call to .B \_vector_delete_ for expressions using .BR delete[] . .TP .BI \-verbose= v Controls compiler verbosity. ..sp .I v is a comma-separated list consisting of one or more of the following: .RB [ no% ] template , .RB [ no% ] diags , .RB [ no% ] version , .BR %all , .BR %none. ..sp You can specify more than one option, for example, .B \-verbose=template,diags ..sp The following table shows the meanings of the values of \fIv\fR: .RS .TP 1i .B \&Value .B Meaning .TP 1i .RB \&[ no% ] template [Do not] Turn on the verbose mode, sometimes called the verify mode. The verbose mode displays each phase of instantiation as it occurs during compilation. Use this option if you are new to templates. .TP 1i .RB \&[ no% ] diags [Do not] Print the command line for each compilation pass. .TP 1i .RB \&[ no% ] version [Do not) Direct the \fBCC\fR driver to print the names and version numbers of the programs it invokes. .TP 1i .B %all Invokes all of the above. .TP 1i .B %none Invokes none of the above. .RE .TP .B \+w Prints extra warnings where necessary. .sp Generates additional warnings about all questionable constructs that are: .RS .TP o Nonportable .PP o Likely to be mistakes .PP o Inefficient .RE .RS ..sp Default: ..sp If .B +w is not specified, the compiler warns about constructs that are almost certainly problems. .RE .TP .B \+w2 Prints even more warnings. .TP .B \-w Suppresses warning messages. .sp This option causes the compiler .I not to print warning messages. Some warnings, particularly anachronistic ones, cannot be suppressed. .TP .B \-xa Generates code for profiling. .sp If set at compiler time, the .B TCOVDIR environment variable specifies the directory where the coverage .RB ( .d ) files are located. If this variable is not set, then the coverage .RB ( .d ) files remain in the same directory as the .B source files. .sp Use this option only for backward compatibility with old coverage files. See .B \-xprofile=tcov for information on the new style of profiling, the .B tcov (1) man page, and .I Profiling Tools for more details. .sp Interactions: .sp .2 The .B \-xprofile=tcov and the .B \-a options are compatible in a single executable. That is, you can link a program that contains some files that have been compiled with .BR \-xprofile=tcov , and others that have been compiled with .BR \-a . You cannot compile a single file with both options. .sp .B \-xa is incompatible with .BR \-g . .sp Warnings: .sp .2 If you compile and link in separate steps, and you compile with .B \-xa, then be sure to link with .B \-xa, or you might get unexpected results. .TP .B \-xar Creates archive libraries. .sp When building a C++ archive that uses templates, it is necessary in most cases to include in the archive those template functions which are instantiated in the template database. Using this option automatically adds those templates to the archive as needed. .sp Example: .sp .B "CC \-xar \-o libmain.a a.o b.o c.o" .sp archives the template functions contained in the library and object files. .sp Warnings: .sp .2 Do not add .B .o files from the template data base on the command line. .sp .2 Do not use the .B ar command directly for building archives. Use .B CC \-xar to ensure that template instantiations are automatically included in the archive. .TP .BI \-xarch= a Specifies the target architecture set. .sp Although this option can be used alone, it is part of the expansion of the .B -xtarget option. Its primary use is to override a value supplied by the .B -xtarget option. .sp This option limits the instructions generated to those of the specified architecture, and \fIallows\fR the specified set of instructions. It does not guarantee an instruction is used; however, under optimization, it is usually used. .sp Values: .sp On SPARC platforms, must be one of: .B generic, v7, v8a, v8, v8plus, v8plusa, v9, v9a .B v9, v9a. .sp On x86 devices, .I a must be one of: .B generic, 386, 486, pentium, pentium_pro. .sp SPARC architectures .BR v7 , .BR v8a , and .B v8 are all binary compatible. .B v8plus and .B v8plusa are binary compatible with each other and they are forward, but not backward, compatible. .sp For any particular choice, the generated executable can run much more slowly on earlier architectures. .sp The following table shows the \fB\-xarch\fR values: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&generic Gets good performance on most SPARC architectures, major degradation on none. .TP 1i \& This is the default. With each new release, this best instruction set will be adjusted, if appropriate. .TP 1i .B \&v7 Limits instruction set to .B v7 architecture. .TP 1i \& This option uses the best instruction set for good performance on the .B v7 architecture, but without the quad-precision floating-point instructions. This is equivalent to using the best instruction set for good performance on the .B v8 architecture, but \fIwithout\fR the following instructions: .TP 1.5i \& The quad-precision floating-point instructions .TP 1.5i \& The integer \fBmul\fR and \fBdiv\fR instructions .TP 1.5i \& The \fBfsmuld\fR instruction .TP 1i \& Examples: SPARCstation 1, SPARCstation 2 .TP 1i .B \&v8 Limits instruction set to .B v8 architecture. .TP 1i \& This option uses the best instruction set for good performance on the .B v8 architecture, but without quad-precision, floating-point instructions. .TP 1i \& Examples: SPARCstation 10 .TP 1i .B \&v8a Limits instruction set to the .B v8a version of the .B v8 architecture. .TP 1i \& By definition, .B v8a means the .B v8 architecture but without: .TP 1.5i \& The quad-precision floating-point instructions .TP 1.5i \& The \fBfsmuld\fR instruction .TP 1i \& This option uses the best instruction set for good performance on the .B V8a architecture. \& Example: Any machine based on MicroSPARC 1. .TP 1i .B \&v8plus Limits instruction set to the .B V8plus version of the .B V9 architecture. .TP 1i \& By definition, .B V8plus means the .B V9 architecture, but: .TP 1.5i \& Without the quad-precision floating-point instructions .TP 1.5i \& Limited to the 32-bit subset defined by the .B v8plus specification .TP 1i \& This option uses the best instruction set for good performance on the .B v8plus chip architecture. .TP 1.5i \& In .BR v8plus , a system with the 64-bit registers of .B v9 runs in 32-bit addressing mode, but the upper 32 bits of the i and l registers must not affect program results. .TP 1i \& This choice does not include the VIS instructions. .TP 1i \& Example: any machine based on UltraSPARC .TP 1i \& Use of this option also causes the \fB.o\fR file to be marked as a .B v8plus binary. Such files will not run on a .B v7 or .B v8 machine. .TP 1i .B \&v8plusa Limits instruction set to the .B v8plusa architecture variation. .TP 1i \& By definition, .B v8plusa means the .B v8plus architecure plus: .TP 1.5i \& The UltraSPARC-specific instructions .TP 1.5i \& The VIS instructions .TP 1i \& This option uses the best instruction set for good performance on the UltraSPARC TM architecture, but limited to the 32-bit subset defined by the .B v8plus specification. .TP 1i \& Example: Any machine based on UltraSPARC .TP 1i \& Use of this option also causes the \fB.o\fR file to be marked as a Sun-specific .B v8plus binary. Such files will not run on a .BR v7 or .B v8 machine. .TP 1i .B \&v9 Limits instruction set to the SPARC-V9 architecture. The resulting \fB.o\fR object files are in 64-bit ELF format and can only be linked with other object files in the same format. The resulting executable can only be run on a 64-bit SPARC processor running 64-bit Solaris 7 software with the 64-bit kernel. Compiling with this option uses the best instruction set for good performance on the V9 SPARC architecture, but without the use of quad-precision floating-point instructions. (Available only on 64-bit Solaris 7 software.) .TP 1i .B \&v9a Limits instruction set to the SPARC-V9 architecture, adding the Visual Instruction Set (VIS) and extensions specific to UltraSPARC processors. The resulting .B .o object files are in 64-bit ELF format, and can only be linked with other object files in the same format. The resulting executable can only be run on a 64-bit SPARC processor running 64-bit Solaris 7 software with the 64-bit kernel. Compiling with this option uses the best instruction set for good performance on the V9 UltraSPARC architecture, but without the use of quad-precision floating-point instructions. (Available only on 64-bit Solaris 7 software.) .TP 1i For x86 Platforms: .sp o \fBgeneric\fR and \fB386\fR are equivalent in this release. .sp o \fB486\fR , \fBpentium\fR , or \fBpentium_pro\fR directs the compiler to issue instructions for the corresponding Intel chip. .TP Interactions: .sp The .B \-xarch=v9 option and the .BR \-compat [ =4 ] options are not supported when used together. .sp Warnings: .sp If this option is used with optimization, the appropriate choice can provide good performance of the executable on the specified architecture. An inappropriate choice, however, might result in serious degradation of performance. .RE .TP .BI \-xcache= c .I (SPARC) Defines the cache properties for use by the optimizer. .sp This option specifies the cache properties that the optimizer can use. It does not guarantee that any particular cache property is used. .sp Note \(em Although this option can be used alone, it is part of the expansion of the .B \-xtarget option; its primary use is to override a value supplied by the .B \-xtarget option. .sp .RS .PP \fIc\fR must be one of the following: .RE .RS .TP o \fBgeneric\fR .PP o \fIs1/l1/a1\fR .PP o \fIs1/l1/a1:s2/l2/a2\fR .PP o \fIs1/l1/a1:s2/l2/a2:s3/l3/a3\fR .PP That is, \fB\-xcache={generic \fR| \fIs1/l1/a1[:s2/l2/a2[:s3/l3/a3]]}\fR, where the \fIsi/li/ai\fR are defined as follows: .RE .RS .TP .5i .I \&si The size of the data cache at level \fIi\fR, in kilobytes .TP .5i .I \&li The line size of the data cache at level \fIi\fR, in bytes .TP .5i .I \&ai The associativity of the data cache at level \fIi\fR .TP .5i .PP For example, .IB i =1 designates level 1 cache properties, .IR s1\/l1\/a1 . .sp The following table shows the .B \-xcache values: .RE .RS .TP 1.5i .B \&Value .B Meaning .TP 1.5i .B \&generic Defines the cache properties for good performance on most SPARC processors. .TP 1.5i \& This is the default value which directs the compiler to use cache properties for good performance on most SPARC processors, without major performance degradation on any of them. .sp .TP 1.5i .I \&s1/l1/a1 \& Defines level 1 cache properties. .TP 1.5i .I \&s1/l1/a1:s2/l2/a2 \& Defines levels 1 and 2 cache properties. .TP 1.5i .I \&s1/l1/a1:s2/l2/a2:s3/l3/a3 \& Defines levels 1, 2, and 3 cache properties. .TP 1.5i Example: \fB\-xcache=16/32/4:1024/32/1\fR specifies .if n .br the following: .RE .RS .TP 1.5i \&Level 1 cache has: \& Level 2 cache has: .TP 1.5i \&16K bytes \& 1024K bytes .TP 1.5i \&32-byte line size \& 32-byte line size .TP 1.5i \&4-way associativity \& Direct mapping .RE .TP .BR \-xcg [ 89 | 92 ] .I (SPARC) Compiles for generic SPARC or SPARC V8 architecture. .sp This option specifies the code generator for floating-point hardware on SPARC platforms released in 1989 or 1992. Use the .B fpversion command to determine which floating-point hardware you have. If you compile one procedure of a program with this option, it does not mean that you must compile .I all the procedures of the program in the same way. .sp .B \-xcg89 generates code to run on generic SPARC architecture. .sp .B \-xcg89 is a macro for .B \-xtarget=ss2 and expands to: .B \-xarch=v7 \-xchip=old .br .B \ \ \ \ \-xcache=64/32/1. .sp .B \-xcg92 generates code to run on SPARC V8 architecture. .sp .B \-xcg92 is a macro for .B \-xtarget=ss1000 and expands to: .B \-xarch=v8 \-xchip=super .br .B \ \ \ \ \-xcache=16/64/4:1024/64/1. .TP .BI \-xchip= c Specifies the target processor for use by the optimizer. .sp .I c must be one of the following: .sp On SPARC platforms: .B generic, old, super, super2, micro, micro2, .B hyper, hyper2, powerup, ultra, ultra2, ultra2i .sp On x86 platforms: .B 386, 486, pentium, pentium_pro. .sp Although this option can be used alone, it is part of the expansion of the .B \-xtarget option; its primary use is to override a value supplied by the \fB\-xtarget\fR option. .sp This option specifies timing properties by specifying the target processor. .sp This option affects: .RS .PP o The ordering of instructions, that is, scheduling .PP o The way the compiler uses branches .PP o The instructions to use in cases where semantically equivalent alternatives are available. .PP The .B \-xchip values for SPARC: .RE .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&generic Uses timing properties for good performance on most SPARC processors. .TP 1i \& This is the default value that directs the compiler to use the best timing properties for good performance on most SPARC processors, without major performance degradation on any of them. .TP 1i .B \&old Uses timing properties of pre-SuperSPARC TM processors. .TP 1i .B \&super Uses timing properties of the SuperSPARC chip. .TP 1i .B \&super2 Uses timing properties of the SuperSPARC II chip. .TP 1i .B \µ Uses timing properties of the MicroSPARC TM chip. .TP 1i .B \µ2 Uses timing properties of the MicroSPARC II chip. .TP 1i .B \&hyper Uses timing properties of the HyperSPARC TM chip. .TP 1i .B \&hyper2 Uses timing properties of the HyperSPARC II chip. .TP 1i .B \&powerup Uses timing properties of the Weitek PowerUp chip. .TP 1i .B \&ultra Uses timing properties of the UltraSPARC I chip. .TP 1i .B \&ultra2 Uses timing properties of the UltraSPARC II chip. .TP 1i .B \&ultra2i Uses timing properties of the UltraSPARC IIi chip. The following table shows the .B \-xchip values for x86: .PP The .B \-xchip values for x86: .RE .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&generic Uses timing properties for good performance on most x86 processors. .TP 1i .B \&386 Uses timing properties of the Intel 386 chip. .TP 1i .B \&486 Uses timing properties of the Intel 486 chip. .TP 1i .B \&pentium Uses timing properties of the Intel Pentium chip. .TP 1i .B \&pentium_pro Uses timing properties of the Intel Pentium Pro chip. .RE .TP .BI \-xcode= a .I (SPARC) Specifies code address space. ..sp The following table shows the .B \-xcode values: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&abs32 Generate 32-bit absolute addresses. Code + data + bss size is limited to 2**32 bytes. .TP 1i .B \&abs44 Generate 44-bit absolute addresses. Code + data + bss size is limited to 2**44 bytes. Available only on 64-bit architectures: .BR \-xarch= ( v9 | v9a ) .TP 1i .B \&abs64 Generate 64-bit absolute addresses. Available only on 64-bit architectures: .BR \-xarch= ( v9 | v9a ) .TP 1i .B \&pic13 Generate position-independent code (small model). Equivalent to .B \-Kpic. Permits references to at most 2**11 unique external symbols on 32-bit architectures, 2**10 on 64-bit. .TP 1i .B \&pic32 Generate position-independent code (large model). Equivalent to .B \-KPIC. Permits references to at most 2**30 unique external symbols on 32-bit architectures, 2**29 on 64-bit. .PP Defaults: .sp The default is .B \-xcode=abs32 for SPARC V8 and V7. .LP The default is .B \-xcode=abs64 for SPARC and UltraSPARC V9 (with .BR \-xcg [ 89 | 92 ]. .LP Interactions: .sp When building shared dynamic libraries using .br .B \-xarch=v9 or .B v9a on 64-bit Solaris 7 software, the .br .B \-xcode=pic13 or .B pic32 (or .B \-pic or .B \-PIC ) option MUST be specified. .RE .TP .B \-xF With .BR \-features=no%except , enables reordering of functions by the linker. .sp If you compile with the .B \-xF option, and then run the Analyzer, you generate a map file that shows an optimized order for the functions. The subsequent link to build the executable file can be directed to use that map by using the linker .BI \-M mapfile option. It places each function from the executable file into a separate section. .sp Reordering the subprograms in memory is useful only when the application text page fault time is consuming a large percentage of the application time. Otherwise, reordering may not improve the overall performance of the application. .sp .BR Note "\(em The .B \-xF option will work only if you also specify .B \-features=no%except .sp The .BR analyzer (1), .BR debugger (1), and .BR ld (1) man pages provide further details on this option. .TP .B \-xhelp=flags Same as \fB\-help\fR. Displays list of compiler options. .TP .B \-xhelp=readme Same as .BR \-readme . Displays contents of online readme file. .TP .B \-xildoff Turns off the Incremental Linker. .sp This option is assumed if you do .I not use the .B \-g option. It is also assumed if you do use the .B \-G option, or name any source file on the command line. Override this default by using the .br .B \-xildon option. .TP .B \-xildon Turns on the Incremental Linker. This option is assumed if you use the .B \-g option and not .B \-G, and do not name any source file on the command line. Override this default by using the .B \-xildoff option. .\" .TP .BI \-xinline= rlst Inlines specified routines. .sp This option requests that the optimizer inline the user-written routines named in the .I rlst list - a comma-separated list of functions and subroutines. Inlining is an optimization technique whereby the compiler effectively replaces a function call with the actual subprogram code. Inlining often provides the optimizer more opportunities to produce efficient code. .sp Note \(em This option does not affect C++ inline functions and is not related to the .B +d option. .sp The following restrictions apply \(em no warning is issued: .RS .TP .2i o Optimization must be greater than .BR \-xO3 . .TP .2i o The compiler determines if actual inlining is advantageous or safe. .TP .2i o The source for the routine must be in the file being compiled. .TP Examples: .sp % cat example.cc static int twice (int i) { return 2*1; } int main() { return twice( 3 ); } % CC \-compat=4 \-O example.cc % nm \-C a.out | grep twice [37] | 68068| 8|FUNC |LOCL |0 |7 |twice(int) [__0FFtwicei] .B % CC \-compat=4 \-O \-xinline=__0FFtwicei example.cc .sp Interactions: .sp o If a function specified in the list is not declared as .B extern "C", the function name should be mangled. You can use the .B nm command on the executable file to find the mangled function names. For functions declared as .B extern "C", the names are not mangled by the compiler. .sp o Adding the .B \-xinline has no effect for optimization levels below .BR \-xO3 . At .BR \-xO4 , the optimizer decides which functions should be inlined, and does so without the .B \-xinline option being specified. At .BR \-xO4 , the compiler also attempts to determine which functions will improve performance if they are inlined. If you force inlining of a function with .BR \-xinline , you might actually diminish performance. .RE .TP .B \-xlibmieee Causes .B libm to return IEEE 754 values for math routines in exceptional cases. The default behavior of .B libm is XPG-compliant. .TP .B \-xlibmil Inlines selected library routines for optimization. .sp There are inline templates for some of the .B libm library routines. This option selects those inline templates that produce the fastest executables for the floating-point option and platform currently being used. .sp 1 .BR Note \(em This option does not affect C++ inline functions. .TP .B \-xlibmopt Uses a library of optimized math routines. .sp This option uses a math routine library optimized for performance, and usually generates faster code. The results may be slightly different from those produced by the normal math library. If so, they usually differ in the last bit. .sp The order on the command line for this library option is not significant. .sp This option is implied by the .B \-fast option. ..sp See also the descriptions for .B \-fast and .br .BR \-xnolibmopt . .TP .B \-xlic_lib=\fIl\fR Links with the Sun-supplied, licensed libraries specified in \fIl\fR. .sp .TP .B \-xlicinfo Shows license server information. .sp This option returns the license-server name and the user ID for each user who has a license checked out. When you use this option, the compiler is .I not invoked, and a license is .I not checked out. .sp Generally, with this option, no compilation is done, and a license is not checked out. If a conflicting option is used, then the latest one on the command line takes precedence, and a warning is issued. .sp Examples: .sp Do not compile; report license information. .br .B "\ \ \ demo% CC \-c \-xlicinfo any.cc" .sp Compile; do not report license information. .br .B "\ \ \ demo% CC \-xlicinfo \-c any.cc" .TP .BR \-Xm Use .B \-features=iddollar. .TP .B \-xM Outputs makefile dependency information. .sp Example: ..sp When you compile the following code ..sp .B #include .B int main() \{ .B (void) printf ("hello"); .B \} ..sp with this option: ..sp .B "% CC \-xM hello.c" ..sp The output shows the dependencies: ..sp .B "hello.o: hello.c" .br .B "hello.o: /opt/SunWSpro/SC5.0/include/CC/stdio.h .br .B "hello.o: /usr/include/stdio.h" ..sp See .BR make (1) for details about makefiles and dependencies. .TP .B \-xM1 Generates dependency information, but excludes .BR /usr/include . This is the same as .BR \-xM , except that this option does not report dependencies for the .B /usr/include header files. When you compile the same code provided with the .B \-xM option, the output is: ..sp .B "hello.o: hello.c" .TP .B \-xMerge Merges the data segment with the text segment. .sp The data in the object file is read-only, and is shared between processes, unless you link with .BR "ld \-N" . .TP .B \-xnolib Disables linking with default system libraries. .sp Normally, the C++ compiler links with several system libraries to support C++ programs. With this option, the .BI \-l lib options to link the default system support libraries are .I not passed to .BR ld . .sp Normally, the compiler links with the following libraries in the following order: .sp For \fB-compat=4\fR: .sp .B \-lm \-lC \-lw \-lthread \-lcx \-lc .sp (Use \fB\-lthread\fR when \fB\-mt\fR is specified; do not use \fB\-lthread\fR when \fB\-mt\fR is not specified.) .sp For \fB-compat=5\fR: .sp .B \-lm \-lCrun \-lw \-lthread \-lcx \-lc .sp (Use \fB\-lthread\fR when \fB\-mt\fR is specified; do not use \fB\-lthread\fR when \fB\-mt\fR is not specified.) .sp You must pass all .B \-l options explicitly. .sp The order of the .B \-l options is significant. The .BR \-lm , \-lw , and .B \-lcx options must appear before .BR \-lc . .sp Examples: .sp For minimal compilation to meet the C application binary interface, that is, a C++ program with only C support required, use: .sp .B CC \-library=%none \-xnolib test.cc \-lc .sp To link .B libm statically, into a single-threaded application on SPARC V8 platforms, use .sp .B CC \-xnolib \-Bstatic \-lm \-Bdynamic \-lw \-lcx \-lc .sp To link .B libm and .B libw statically, and link others dynamically: .sp .B CC \-xnolib \-Bstatic \-lm \-lw \-Bdynamic \-lcx \-lc .sp Interactions: .sp If you specify .BR \-xnolib , you must manually link all required system support libraries in the given order. You must link the system support libraries last. .sp Warnings: .sp The set of system support libraries is not stable and might change from release to release. .sp .B \-lcx is not present in 64-bit compilation mode. .TP .B \-xnolibmil Cancels .B \-xlibmil on command line. .sp Use this option with .B \-fast to override linking with the optimized math library. .TP .B \-xnolibmopt Does .I not use the math routine library. .sp Use this option .I after the .B \-fast option on the command-line, as in: .br .B "CC \-fast \-xnolibmopt ..." .\" .TP .BI \-xO level Specifies optimization level. .sp If .BI \-xO [level] is not specified, only a very basic level of optimization, limited to local common subexpression elimination and dead code analysis, is performed. A program's performance may be significantly improved when compiled with an optimization level than without optimization. Use of .B \-xO (which implies .BR \-xO2 ) or .B \-fast (which implies .BR \-xO4 ) is recommended for most programs. .sp Generally, the higher the level of optimization with which a program is compiled, the better runtime performance obtained. However, higher optimization levels may result in increased compilation time and larger executable files. .sp There are five levels that you can use with .BR \-xO . The following sections describe how they differ for SPARC platforms, for x86, and for all platforms. ..sp Values: .sp .8 .I On SPARC Platforms: .sp If the optimizer runs out of memory, it attempts to proceed over again at a lower level of optimization, resuming compilation of subsequent routines at the original level. .sp .RS .PP .BR \-xO \(emThis is equivalent to .BR \-xO2 . .PP .B \-xO1 \(emDoes only the minimum amount of optimization (peephole), which is postpass assembly-level optimization. Do not use .B \-xO1 unless using .B \-xO2 or .B \-xO3 results in excessive compilation time, or if you are running out of swap space. .PP .B \-xO2 \(emDoes basic local and global optimization, which includes: .RE .RS .PP o Induction-variable elimination .PP o Local and global common subexpression elimination .PP o Algebraic simplification .PP o Copy propagation .PP o Constant propagation .PP o Loop-invariant optimization .PP o Register allocation .PP o Basic block merging .PP o Tail recursion elimination .PP o Dead-code elimination .PP o Tail-call elimination .PP o Complex-expression expansion .RE .RS .PP This level does not optimize references or definitions for external or indirect variables. In general, this level results in minimum code size. .PP .BR \-xO3 \(emIn addition to optimizations performed at the .B \-xO2 level, also optimizes references and definitions for external variables. This level does not trace the effects of pointer assignments. When compiling either device drivers that are not properly protected by .BR volatile , or programs that modify external variables from within signal handlers, use .BR \-xO2 . In general, .B \-xO3 results in increased code size. If you are running out of swap space, use .BR \-xO2 . .PP .BR \-xO4 \(emDoes automatic inlining of functions contained in the same file in addition to performing .B \-xO3 optimizations. This automatic inlining usually improves execution speed, but sometimes makes it worse. In general, this level results in increased code size. .PP .BR \-xO5 \(emDoes the highest level of optimization, suitable only for the small fraction of a program that uses the largest fraction of computer time. Uses optimization algorithms that take more compilation time or that do not have as high a certainty of improving execution time. Optimization at this level is more likely to improve performance if it is done with profile feedback. See \fB\-xprofile\fR. .sp .I On x86 Platforms: .PP .BR \-xO1 \(emPreloads arguments from memory; causes cross jumping (tail merging), as well as the single pass of the default optimization. .PP .BR \-xO2 \(emSchedules both high- and low-level instructions, and performs improved spill analysis, loop memory-reference elimination, register lifetime analysis, enhanced register allocation, global common subexpression elimination, and optimizations done by level 1. .PP .BR \-xO3 \(emPerforms loop strength reduction, inlining, as well as optimization done by level 2. .PP .BR \-xO4 \(emPerforms architecture-specific optimization, as well as optimization done by level 3. .PP .BR \-xO5 \(em\fRGenerates the highest level of optimization. Uses optimization algorithms that take more compilation time or that do not have as high a certainty of improving execution time. .sp .I On SPARC and x86 Platforms: .sp In general, program execution speed depends on level of optimization. The higher the level of optimization, the faster the speed. .RE .RS .sp In a few cases, .B \-xO2 may perform better than the others, and .B \-xO3 may outperform .BR \-xO4 . Try compiling with each level to see if you have one of these rare cases. .PP If the optimizer runs out of memory, it tries to recover by retrying the current procedure at a lower level of optimization, and resumes subsequent procedures at the original level specified in the .B \-xO option. .PP If you optimize at .B \-xO3 or .B \-xO4 with very large procedures, such as thousands of lines of code in a single procedure, the optimizer might require an unreasonably large amount of memory. In such cases, performance of the machine might be degraded. .PP To prevent this degradation from taking place, use the .B limit command to limit the amount of virtual memory available to a single process; see the .BR csh (1) man page. For example, on a machine with 32 megabytes, to limit virtual memory to 16 megabytes, the command: .sp .BR "% limit datasize 16M" , .sp This command causes the optimizer to recover if it reaches 16 megabytes of data space. .PP This limit cannot be greater than the total available swap space of the machine, and the limit should be small enough to permit normal use of the machine while a large compilation is in progress. .PP The best setting of data size depends on the degree of optimization requested, the amount of real memory, and virtual memory available. .PP o To find the actual swap space, type: .B swap .B \-1 .PP o To find the actual real memory, type: .B dmesg .B | .B grep mem .PP Interactions: .sp o Debugging with .B\-g does not supress .BI \-xO [level], but .BI \-xO [level] limits .B \-g in certain ways. .sp o The .BR \-xO3 and \-xO4 options reduce the utility of debugging so that you cannot display variables from .BR dbx , but you can still use .B dbx where command to get a symbolic traceback. .sp o Adding the .B \-xinline has no effect for optimization levels below .BR \-xO3 . At .BR \-xO4 , the optimizer decides which functions should be inlined, and does so without the .B \-xinline option being specified. At .BR \-xO4 , the compiler also attempts to determine which functions will improve performance if they are inlined. If you force inlining of a function with .BR \-xinline , you might actually diminish performance. .PP See also: .sp .B \-fast, .BI \-xprofile= p, .B csh(1) man page .RE .TP .B \-xpg Compiles for profiling with the .B gprof profiler. .sp The .B \-xpg option compiles self-profiling code to collect data for profiling with .BR gprof . This option invokes a runtime recording mechanism that produces a .B gmon.out file when the program normally terminates. .sp Warnings: If you compile and link separately, and you compile with .BR \-xpg , then be sure to link with .BR \-xpg . .sp You can also perform this task with the Analyzer. Refer to the .BR analyzer (1) man page. .TP .BR -xprefetch [ = ( yes | no )] .I (SPARC) Uses prefetch instructions on UltraSPARC II processors. .sp With \f3-xprefetch=yes\f1, the compiler is free to insert prefetch instructions into the code it generates. This may result in a performance improvement on UltraSPARC II processors. .sp Defaults: .sp If the -xprefetch option is not specified, the default is .BR \-xprefetch=no . .sp Specifying \f3-xprefetch\f1 alone is equivalent to \f3-xprefetch=yes\f1. .TP .BI "\-xprofile=" p Collects or optimizes with runtime profiling data. .IP .I p must be .BR collect [ :\fIname ], .BR use [ :\fIname ], or .BR tcov . .IP This option causes execution frequency data to be collected and saved during execution, then the data can be used in subsequent runs to improve performance. This option is only valid when a level of optimization is specified. .IP If compilation and linking are performed in separate steps, the same .B \-xprofile option must appear on the compile as well as the link step. .RS .TP .5i Values: .sp .BR collect [ :\fIname ] Collects and saves execution frequency for later use by the optimizer with .br \f3\-xprofile=use\f1. The compiler generates code to measure statement execution frequency. .sp The \f2name\f1 is the name of the program that is being analyzed. This name is optional. If \f2name\f1 is not specified, \f3a.out\f1 is assumed to be the name of the executable. .sp At runtime, a program compiled with .br \f3\-xprofile=collect:\f2name\f1 will create the subdirectory \f2name\f3.profile\f1 to hold the runtime feedback information. Data is written to the file \f3feedback\f1 in this subdirectory. If you run the program several times, the execution frequency data accumulates in the \f3feedback\f1 file; that is, output from prior runs is not lost. .TP .5i .BR use [ :\fIname ] Uses execution frequency data to optimize strategically. The \f2name\f1 is the name of the executable that is being analyzed. This name is optional. If \f2name\f1 is not specified, a.out is assumed to be the name of the executable. .sp The program is optimized by using the execution frequency data previously generated and saved in the \f3feedback\f1 files written by a previous execution of the program compiled with .B \-xprofile=collect\f1. .sp The source files and other compiler options must be exactly the same as those used for the compilation that created the compiled program that generated the \f3feedback\f1 file. If compiled with .B \-xprofile=collect:\f2name\f1, the same program name \f2name\f1 must appear in the optimizing compilation: \f3\-xprofile=use:\f2name\f1. .TP .5i .B tcov Basic block coverage analysis using "new" style \f3tcov\f1. .sp The \f3\-xprofile=tcov\f1 option is the new style of basic block profiling for \f3tcov\f1. It has similar functionality to the \f3\-xa\f1 option, but correctly collects data for programs that have source code in header files or make use of C++ templates. See also .B \-xa for information on the old style of prfiling, the \f3tcov\f1(1) man page, and the \f2Performance Profiling Tools\f1 manual for more details. .sp Code instrumentation is performed similarly to that of the \f3\-xa\f1 option, but \f3.d\f1 files are no longer generated. Instead, a single file is generated, the name of which is based on the final executable. For example, if the program is run out of .B /foo/bar/myprog.profile\f1, the data file is stored in .B /foo/bar/myprog.profile/myprog.tcovd. .sp The \f3\-xprofile=tcov\f1 and the \f3\-xa\f1 options are compatible in a single executable, that is, you can link a program that contains some files that have been compiled with \f3\-xprofile=tcov\f1, and others with \f3\-xa\f1. You cannot compile a single file with both options. .sp When running \f3tcov\f1, you must pass it the \f3\-x\f1 option to make it use the new style of data. If not, \f3tcov\f1 uses the old \f3.d\f1 files, if any, by default for data, and produces unexpected output. .sp Unlike the \f3\-xa\f1 option, the \f3TCOVDIR\f1 environment variable has no effect at compile-time. However, its value is used at program runtime. See \f3tcov\f1(1) and the \f2Performance Profiling Tools\f1 manual for more details. .sp The \f3\-xprofile=tcov\f1 option is incompatible with .BR \-g . .RE .TP .BI "\-xregs=" r Specify register usage .I "(SPARC Only)." .sp Specify usage of registers in generated code. .sp .I r is a comma-separated list of one or more of the following: .BR "[no%]appl" , .BR "[no%]float" . .sp Example: .B "\-xregs=appl,no%float" .RS .PP The .B \-xregs values are for specific .B \-xarch values): .RE .RS .TP .9i .B appl Allow using registers .BR g2 , .BR g3 , and .BR g4 . (v8, v8a) .br Allow using registers .BR g2 , .BR g3 , .BR g4 , and .BR g5 . (v8plus, v8plusa) .br Allow using registers .BR g2 , .BR g3 . (v9, v9a) .TP .B no%appl Do not use .B appl registers. .TP .B float Allow using floating-point registers as specified in the SPARC ABI. .TP .B no%float Do not use floating-point registers. .RE .RS .PP The default is: .BR "\-xregs=appl,float" . .RE .br .ne 1i .\" .sp .TP .BR \-xs Allows debugging by .B dbx without object ( .BR .o ) files. .sp This option disables Auto-Read for .BR dbx . Use this option in case you cannot keep the .B .o files around. This option passes .B \-s to the assembler. .sp "No Auto-Read" is the older way of loading symbol tables. It places all symbol tables for .B dbx in the executable file. The linker links more slowly, and .B dbx initializes more slowly. .sp Auto-Read is the newer and default way of loading symbol tables. With Auto-Read, the information is distributed in the .B .o files, so that .B dbx loads the symbol table information only if and when it is needed. Hence, the linker links faster, and dbx initializes faster. .sp With .B \-xs , if you move executables to another directory, you do not have to move the object files in order to use .BR dbx . .sp Without .B \-xs , if you move the executables, then you must move both the source files and the object ( .B .o ) files in order to use .BR dbx . .TP .B \-xsafe=mem .I "(SPARC) Allows no memory-based traps occur. .sp This option grants permission to use the speculative load instruction on V9 machines. It is only effective when used with .B \-x05 optimization, and .br .B \-xarch=v8plus, v8plusa, v9, or .B v9a is specified. .sp Warnings: .sp You should only use this option if you can safely assert that no memory-based traps occur in your program. For most programs, this assertion is appropriate and can be safely made. For a program that explicitly forces memory-based traps to handle exceptional conditions, this assertion is not safe. .TP .B \-xsb Produces information for the WorkShop source code browser. .sp This option causes the .B CC driver to generate extra symbol table information in the .B SunWS_cache subdirectory for the .B source browser. .sp See also: .sp .B \-xsbfast .TP .B \-xsbfast Produces only source browser information, no compilation. .sp This option runs only the .B ccfe phase to generate extra symbol table information in the .B SunWS_cache subdirectory for the .B source browser. No object file is generated. .TP .B \-xspace .I (SPARC) Does not allow optimizations that increase code size. .TP .BI \-xtarget= t Specifies the target system for instruction set and optimization. ..sp .I t must be one of: .B native, generic, .I sytem-name .sp The \fB\-xtarget\fR option permits a quick and easy specification of the .B \-xarch, \-xchip, and \fB\-xcache\fR combinations that occur on real systems. The only meaning of \fB\-xtarget\fR is in its expansion. ..sp The \fB\-xtarget\fR values on SPARC platforms: .RS .TP 1i .B \&Value .B Meaning .TP 1i .B \&native Gets the best performance on the host system. .TP 1i \& The compiler generates code for the best performance on the host system. It determines the available architecture, chip, and cache properties of the machine on which the compiler is running. .TP 1i .B \&generic Gets the best performance for generic architecture, chip and cache. .TP 1i \& The compiler expands \fB\-xtarget=generic\fR to: .TP 1.2i \& .B \-xarch=generic \-xchip=generic .br .B \ \ \ \-xcache=generic .TP 1i \& This is the default value. .TP 1i .I \&system-name Gets the best performance for the specified system. .TP 1i \& You select a system name from .I C++ User's Guide Table 3-15 that lists the mnemonic encodings of the actual system name and numbers. .RE .RS .PP Note: The .B \-compat and the .B \-xtarget=v9 options are not supported when used together. .PP Compiling for 64-bit Solaris 7 software on SPARC or UltraSPARC V9 platforms is indicated by the .B \-xarch=v9|v9a flag. Setting .B \-xtarget=ultra|ultra2 is not necessary or sufficient. If .B \-xtarget is specified, the .B \-xarch=v9|v9a option must appear after .BR \-xtarget , as in: .B \-xtarget=ultra \-xarch=v9 otherwise, the .B \-xtarget setting will revert the .B \-xarch value to .BR v8 . .PP For x86 platforms, .B \-xtarget accepts the following values: .RS .TP .2i o .B native or .B generic .TP .2i o .B 386 (Directs the compiler to generate code for the best performance on the Intel 80386 microprocessor.) .TP .2i o .B 486 (Directs the compiler to generate code for the best performance on the Intel 80486 microprocessor.) .TP .2i o .B pentium (Directs (Directs the compiler to generate code for the best performance on the Pentium or Pentium Pro microprocessor.) .RE .PP This option is a macro. Each specific value for .B \-xtarget expands into a specific set of values for the .B \-xarch, \-xchip, and \fB\-xcache\fR options. Refer to Table 3-15 in the .I C++ User's Guide for the expanded values. .sp Valid system names on SPARC are: sun4/15, sun4/20, sun4/25, sun4/30, sun4/40, sun4/50, sun4/60, sun4/65, sun4/75, sun4/110, sun4/150, sun4/260, sun4/280, sun4/330, sun4/370, sun4/390, sun4/470, sun4/490, sun4/630, sun4/670, sun4/690, sselc, ssipc, ssipx, sslc, sslt, sslx, sslx2, ssslc, ss1, ss1plus, ss2, ss2p, ss4, ss5, ssvyger, ss10, ss10/hs11, ss10/hs12, ss10/hs14, ss10/20, ss10/hs21, ss10/hs22, ss10/30, ss10/40, ss10/41, ss10/50, ss10/51, ss10/61, ss10/71, ss10/402, ss10/412, ss10/512, ss10/514, ss10/612, ss10/712, ss20/hs11, ss20/hs12, ss20/hs14, ss20/hs21, ss20/hs22, ss20/51, ss20/61, ss20/71, ss20/502, ss20/512, ss20/514, ss20/612, ss20/712, ss600/41, ss600/51, ss600/61, ss600/120, ss600/140, ss600/412, ss600/512, ss600/514, ss600/612, ss1000, sc2000, cs6400, solb5, solb6, ultra, ultra2, ultra2i, ultra1/140, ultra1/170, ultra1/200, ultra2/1170, ultra2/1200, ultra2/1300, ultra2/2170, ultra2/2200, ultra2/2300, entr2, entr2/1170, entr2/2170, entr2/1200, entr2/2200, entr150, entr3000, entr4000, entr5000, entr6000. .sp .PP Compiling for 64-bit Solaris 7 on SPARC or UltraSPARC V9 is indicated by the .B \-xarch=v9 or .B \-xarch=v9a flag. Setting .B \-xtarget=ultra or .B ultra2 is not necessary or sufficient. If .B \-xtarget is specified, the .B \-xarch=v9 or .B v9a option must appear AFTER the .BR \-xtarget , as in: .TP 1i .B \ \ \ \-xtarget=ultra2 ... \-xarch=v9 .LP otherwise the .B \-xtarget setting will revert the .B \-xarch value to .BR v8. .TP 1i On x86, \fB\-xtarget\fR accepts: .RE .RS .TP .2i o .B generic or \fBnative\fR .TP .2i o \fB386\fR (Directs the compiler to generate code for the best performance on the Intel 80386 microprocessor.) .TP .2i o \f3486\f1 (Directs the compiler to generate code for the best performance on the Intel 80486 microprocessor.) .TP .2i o .B pentium\f1 or \f3pentium_pro (Directs the compiler to generate code for the best performance on the Pentium or Pentium Pro microprocessor.) .RE .TP .B \-xtime Causes the .B CC driver to report execution times for the various compilation passes. .TP .BI \-xunroll= n Enables unrolling of loops where possible. .sp This option specifies whether or not the compiler optimizes (unrolls) loops. .sp When .I n is 1, it is a suggestion to the compiler not to unroll loops. .sp When .I n is an integer greater than 1, \fB\-xunroll=\fIn\fR causes the compiler to unroll loops .I n times. .TP .B \-xwe Converts all warnings to errors by returning non-zero exit status. .TP .B \-ztext Forces a fatal error if any relocations remain against non-writable, allocatable sections. This option is passed to the linker. .\" .\" .SH NOTES The C++ compiler includes the static library, .B libC.a. However, the corresponding bundled shared library, \fBlibC.so.5\fR, is out of sync with the C++ 5.0 compiler on Solaris OS versions 2.5.1, 2.6 and Solaris 7. For the compiler to work correctly with the shared library on Solaris versions 2.5.1, 2.6 or Solaris 7, you must install the appropriate OS patch; see the README. .sp Type .B CC \-readme for details. .PP .SH FILES .P .PD 0 .TP 40 .B file.a Static library .sp .2 .TP .B file.C Input file .sp .2 .TP .B file.cc Input file .sp .2 .TP .B file.cpp Input file .sp .2 .TP .B file.cxx Input file .sp .2 .TP .B file.o Object file .sp .2 .TP .B file.so Dynamic (shared) library .sp .2 .TP .B a.out Linked output .sp .2 .SH SEE ALSO .BR analyzer (1), .BR as (1), .BR c++filt (1), .BR cc (1), .BR csh (1), .BR dbx (1), .BR debugger (1), .BR gprof (1), .BR ild (1), .BR ld (1), .BR more (1), .BR nm (1) , .BR prof (1), .BR tcov (1) .br .sp .I C++ User's Guide, .br .I C++ Programming Guide, .br .I C++ Migration Guide, .br .I C++ Library Reference .br .I The C++ Programming Language, Third Edition, Bjarne Stroustrup, Addison-Wesley 1997 .br .I The C Programming Language, B. W. Kernighan and D. M. Ritchie, Prentice-Hall 1988 .br .I Solaris Linker and Libraries Guide .br International Standard (ISO/IEC FDIS 14882), .I Programming Languages \(em C++ .sp .\".SH DIAGNOSTICS .\"The diagnostics produced by .\".I CC .\"itself are intended to be .\"self-explanatory. .\"Occasional messages may be produced by the assembler or loader. .\"No messages should be produced by .\".IR cc (1) . .\"SH BUGS .\"PP .\"Some ``used before set'' warnings are wrong. .\".SH NOTES .\"You can use shell variables to tell the C++ translator .\"script .\".B CC .\"that various passes are located in unusual places .\"or have unusual names. For example, if you have your .\"own version of the C compiler called .\".B myC , .\"you can set and export the shell variable .\".L ccC .\"with a line like this: .\".PP .\" \fIccC+/usr/bin/myC;export ccC\fP .\".PP .\"Note that you have to export the variable. If you .\"are using the c-shell: .\".PP .\" \fIsetenv ccC /usr/bin/myC\fP .\".PP .\"The variables used by .\".B CC .\"are: .\".PP .\".\"==========begin troff version of table========== .\".if n .ig IG .\".TS .\"box tab (;) ; .\"c | c | c .\"l | lw(20) | l . .\"Variable; Default; Function .\"_ .\"\fBCCROOTDIR;/usr/CC/`arch`;\fRC++ for this architecture .\"\fBCCLIBDIR;$CCROOTDIR;\fRC++ for this architecture .\"\fBI;$CCROOTDIR/incl;\fRDirectory for include files .\"\fBLIBRARY;$CCROOTDIR/libC.a;\fRStandard C++ library-full path .\"\fBcfrontC;cfront;\fRThe translator itself .\"\fBLIB_ID;C;T{ .\"\fRIf LIBRARY not set, .\"used to build name .\"of C++ library by .\"replacing \fIx\fR in .\"\fLlib\fIx\fP.a\fR .\"T} .\"\fBccC;cc;\fRC compiler .\"\fBcppC;/lib/cpp;\fRC preprocessor .\"\fBSYS;bsd4.3;\fRSystem type .\"\fBCPLUS;-Dc_plusplus=1.3;\fR1.2 \f7cpp\fR C++ constant for .\";;backward compatibility .\"\fBcPLUS;-D_\|_cplusplus=1;\fR2.0 \f7cpp\fR C++ constant for .\";;ANSI C conformance .\"\fBcplusfiltC;$CCROOTDIR/c++filt;T{ .\"\fRC++ link error message filter .\"T} .\".TE .\".IG .\".\"==========end troff version of table========== .\".\"==========begin nroff version of table========== .\".if t .ig IG .\".TS .\"tab (;) ; .\"c c c .\"l lw(20) l . .\"Variable; Default; Function .\" .\"\fBCCROOTDIR;/usr/CC/`arch`;\fRC++ for this architecture .\"\fBCCLIBDIR;$CCROOTDIR;\fRC++ for this architecture .\"\fBI;$CCROOTDIR/incl;\fRDirectory for include files .\"\fBLIBRARY;$CCROOTDIR/libC.a;\fRStandard C++ library-full path .\"\fBcfrontC;cfront;\fRThe translator itself .\"\fBLIB_ID;C;T{ .\"\fRIf LIBRARY not set, .\"used to build name .\"of C++ library by .\"replacing \fIx\fR in .\"\fLlib\fIx\fP.a\fR .\"T} .\"\fBccC;cc;\fRC compiler .\"\fBcppC;/lib/cpp;\fRC preprocessor .\"\fBSYS;bsd4.3;\fRSystem type .\"\fBCPLUS;-Dc_plusplus=1.3;\fR1.2 \f7cpp\fR C++ constant for .\";;backward compatibility .\"\fBcPLUS;-D_\|_cplusplus=1;\fR2.0 \f7cpp\fR C++ constant for .\";;ANSI C conformance .\"\fBcplusfiltC;$CCROOTDIR/c++filt;T{ .\"\fRC++ link error message filter .\"T} .\".TE .\".IG .\".\"===========end nroff version of table========== .\".PP .\"These variables are maintained by .\".BR CC . .\"The only variable you can change is .\".BR $CCROOTDIR . .\"If C++ is installed in a different path than .\".BR /usr/CC/'arch' , .\"you can indicate this to .\".BR CC .\"by: .\".PP .\" \fIsetenv CCROOTDIR /myCC\fP