Analog Devices, Inc. reserves the right to change this product without
prior notice. Information furnished by Analog Devices is believed to be
accurate and reliable. However, no responsibility is assumed by Analog
Devices for its use; nor for any infringement of patents or other rights of
third parties which may result from its use. No license is granted by implication or otherwise under the patent rights of Analog Devices, Inc.
Trademark and Service Mark Notice
The Analog Devices logo, icon bar and logo, the CROSSCORE logo,
VisualDSP++, SHARC, TigerSHARC, and EZ-KIT Lite are registered
trademarks of Analog Devices, Inc.
All other brand and product names are trademarks or service marks of
their respective owners.
Page 3
CONTENTS
PREFACE
Purpose of This Manual ............................................................. xxxix
VisualDSP++ 5.0 C/C++ Compiler and Library Manual for TigerSHARC DSPs xxxvii
Page 38
xxxviiiVisualDSP++ 5.0 C/C++ Compiler and Library Manual
for TigerSHARC Processors
Page 39
PREFACE
Thank you for purchasing Analog Devices, Inc. development software for
digital signal processing (DSP) applications.
Purpose of This Manual
The VisualDSP++ 5.0 C/C++ Compiler and Library Manual for
TigerSHARC Processors contains information about the C/C++ compiler
and run-time library for TigerSHARC® (ADSP-TSxxx) processors. It
includes syntax for command lines, switches, and language extensions. It
leads you through the process of using library routines and writing mixed
C/C++/assembly code.
Intended Audience
The primary audience for this manual is a programmer who is familiar
with Analog Devices processors. This manual assumes that the audience
has a working knowledge of the appropriate processor architecture and
instruction set. Programmers who are unfamiliar with Analog Devices
processors can use this manual, but should supplement it with other texts
(such as the appropriate hardware reference and programming reference
manuals) that describe their target architecture.
VisualDSP++ 5.0 C/C++ Compiler and Library Manual xxxix
for TigerSHARC Processors
Page 40
Manual Contents Description
Manual Contents Description
This manual contains:
•Chapter 1, “Compiler”
Provides information on compiler options, language extensions and
C/C++/assembly interfacing
•Chapter 2, “Achieving Optimal Performance from C/C++ Source
Code”
Provides information on compiler (and assembly) code optimization (techniques and options).
•Chapter 3, “C/C++ Run-Time Library”
Shows how to use library functions and provides a complete C/C++
library function reference (for functions covered in the current
compiler release)
What’s New in This Manual
This edition of the VisualDSP++ 5.0 C/C++Compiler and Library Manual
for TigerSHARC Processors provides changes based on problem reports.
Technical or Customer Support
You can reach Analog Devices, Inc. Customer Support in the following
ways:
•Visit the Embedded Processing and DSP products Web site at
•Contact your Analog Devices, Inc. local sales office or authorized
distributor
•Send questions by mail to:
Analog Devices, Inc.
One Technology Way
P.O. Box 9106
Norwood, MA 02062-9106
USA
Supported Processors
Preface
The name “TigerSHARC” refers to a family of Analog Devices, Inc.
floating-point and [8-bit, 16-bit, and 32-bit] fixed-point processors. For a
complete list of processors supported by VisualDSP++ 5.0, refer to VisualDSP++ online Help.
Product Information
Product information can be obtained from the Analog Devices Web site,
VisualDSP++ online Help system, and a technical library CD.
Analog Devices Web Site
The Analog Devices Web site, www.analog.com, provides information
about a broad range of products—analog integrated circuits, amplifiers,
converters, and digital signal processors.
VisualDSP++ 5.0 C/C++ Compiler and Library Manual xli
for TigerSHARC Processors
Page 42
Product Information
To access a complete technical library for each processor family, go to
http://www.analog.com/processors/technical_library. The manuals
selection opens a list of current manuals related to the product as well as a
link to the previous revisions of the manuals. When locating your manual
title, note a possible errata check mark next to the title that leads to the
current correction report against the manual.
Also note, MyAnalog.com is a free feature of the Analog Devices Web site
that allows customization of a Web page to display only the latest information about products you are interested in. You can choose to receive
weekly e-mail notifications containing updates to the Web pages that meet
your interests, including documentation errata against all manuals. MyAn-
alog.com
provides access to books, application notes, data sheets, code
examples, and more.
Visit MyAnalog.com to sign up. If you are a registered user, just log on.
Your user name is your e-mail address.
VisualDSP++ Online Documentation
Online documentation comprises the VisualDSP++ Help system, software
tools manuals, hardware tools manuals, processor manuals, Dinkum
Abridged C++ library, and FLEXnet License Tools documentation. You
can search easily across the entire VisualDSP++ documentation set for any
topic of interest.
For easy printing, supplementary Portable Documentation Format (.pdf)
files for all manuals are provided on the VisualDSP++ installation CD.
xliiVisualDSP++ 5.0 C/C++ Compiler and Library Manual
for TigerSHARC Processors
Page 43
Each documentation file type is described as follows.
File Description
.chmHelp system files and manuals in Microsoft help format
Preface
.htm or
.html
.pdfVisualDSP++ and processor manuals in PDF format. Viewing and printing the
Dinkum Abridged C++ library and FLEXnet license tools software
documentation. Viewing and printing the
Internet Explorer 6.0 (or higher).
.pdf files requires a PDF reader, such as Adobe Acrobat Reader (4.0 or higher).
.html files requires a browser, such as
Technical Library CD
The technical library CD contains seminar materials, product highlights,
a selection guide, and documentation files of processor manuals, VisualDSP++ software manuals, and hardware tools manuals for the following
processor families: Blackfin, SHARC, TigerSHARC, ADSP-218x, and
ADSP-219x.
To order the technical library CD, go to http://www.analog.com/proces-
sors/technical_library, navigate to the manuals page for your
processor, click the request CD check mark, and fill out the order form.
Data sheets, which can be downloaded from the Analog Devices Web site,
change rapidly, and therefore are not included on the technical library
CD. Technical manuals change periodically. Check the Web site for the
latest manual revisions and associated documentation errata.
VisualDSP++ 5.0 C/C++ Compiler and Library Manual xliii
for TigerSHARC Processors
Page 44
Notation Conventions
L
a
[
Notation Conventions
Text conventions used in this manual are identified and described as
follows.
ExampleDescription
Close command
(File menu)
{this | that}Alternative required items in syntax descriptions appear within curly
[this | that]Optional items in syntax descriptions appear within brackets and sepa-
[this,…]Optional item lists in syntax descriptions appear within brackets
.SECTIONCommands, directives, keywords, and feature names are in text with
filenameNon-keyword placeholders appear in text with italic style format.
Titles in reference sections indicate the location of an item within the
VisualDSP++ environment’s menu system (for example, the Close
command appears on the File menu).
brackets and separated by vertical bars; read the example as this or
that. One or the other is required.
rated by vertical bars; read the example as an optional
delimited by commas and terminated with an ellipse; read the example
as an optional comma-separated list of this.
letter gothic font.
Note: For correct operation, ...
A Note provides supplementary information on a related topic. In the
online version of this book, the word Note appears instead of this
symbol.
Caution: Incorrect device operation may result if ...
Caution: Device damage may result if ...
A Caution identifies conditions or inappropriate usage of the product
that could lead to undesirable results or product damage. In the online
version of this book, the word Caution appears instead of this symbol.
this or that.
Warn in g: Injury to device users may result if ...
A Warning identifies conditions or inappropriate usage of the product
that could lead to conditions that are potentially hazardous for devices
users. In the online version of this book, the word Wa rnin g appears
instead of this symbol.
xlivVisualDSP++ 5.0 C/C++ Compiler and Library Manual
for TigerSHARC Processors
Page 45
1COMPILER
The C/C++ compiler (ccts) is part of Analog Devices development
software for TigerSHARC (ADSP-TSxxx) processors.
L
This chapter contains:
The code examples in this manual have been compiled using
VisualDSP++ 5.0. The examples compiled with other versions of
VisualDSP++ may result in build errors or different output
although the highlighted algorithms stand and should continue to
stand in future releases of VisualDSP++.
•“C/C++ Compiler Overview” on page 1-3
provides an overview of C/C++ compiler for TigerSHARC
processors.
•“Compiler Command-Line Interface” on page 1-5
describes the operation of the compiler as it processes programs,
including input and output files, and command-line switches.
•“C/C++ Compiler Language Extensions” on page 1-89
describes the
for the C and C++ languages.
•“Preprocessor Features” on page 1-255
contains information on the preprocessor and ways to modify
source compilation.
ccts compiler’s extensions to the ISO/ANSI standard
•“C/C++ Run-Time Model and Environment” on page 1-261
contains reference information about implementation of C/C++
programs, data, and function calls in TigerSHARC processors
VisualDSP++ 5.0 C/C++ Compiler Manual1-1
for TigerSHARC Processors
Page 46
•“C/C++ and Assembly Language Interface” on page 1-298
describes how to call an assembly language subroutine from C/C++
program, and how to call a C/C++ function from within an assembly language program.
•“Compiler C++ Template Support” on page 1-308
describes how templates are instantiated at compile-time.
•“File Attributes” on page 1-312
describes how file attributes help with the placement of run-time
library functions.
1-2VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 47
Compiler
C/C++ Compiler Overview
The C/C++ compiler (ccts) is designed to aid your DSP project development efforts by:
•Processing C and C++ source files, producing machine-level versions of the source code and object files
•Providing relocatable code and debugging information within the
object files
•Providing relocatable data and program memory segments for
placement by the linker in the processors’ memory
Using C/C++, developers can significantly decrease time-to-market since
it gives them the ability to efficiently work with complex signal processing
data types. It also allows them to take advantage of specialized signal processing operations without having to understand the underlying processor
architecture.
The C/C++ compiler (ccts) compiles ISO/ANSI standard C and C++
code for the TigerSHARC processors. Additionally, Analog Devices
includes within the compiler a number of C language extensions designed
to assist in project development. The
alDSP++ environment or from an operating system command line.
The C/C++ compiler processes your C and C++ language source files and
produces TigerSHARC assembler source files. The assembler source files
are assembled by the TigerSHARC assembler (easmts). The assembler creates Executable and Linkable Format (ELF) object files that can either be
linked (using the linker) to create a executable file or included in an
archive library (using elfar). The way in which the compiler controls the
assemble, link, and archive phases of the process depends on the source
input files and the compiler options used.
VisualDSP++ 5.0 C/C++ Compiler Manual1-3
for TigerSHARC Processors
ccts compiler runs from the Visu-
Page 48
C/C++ Compiler Overview
Source files contain the C/C++ program to be processed by the compiler.
The
ccts compiler supports the ANSI/ISO standard definitions of the C
and C++ languages. For information on the C language standard, see any
of the many reference texts on the C language. Analog Devices recommends the Bjarne Stroustrup text “The C++ Programming Language” from
Addison Wesley Longman Publishing Co (ISBN: 0201889544) (1997) as
a reference text for the C++ programming language.
The ccts compiler supports a set of C/C++ language extensions. These
extensions support hardware features of the TigerSHARC processors. For
more information, see “C/C++ Compiler Language Extensions” on
page 1-89.
Compiler options are set in the VisualDSP++ Integrated Development
and Debug Environment (IDDE) from the Compile page of the Project Options dialog box. The selections control how the compiler processes
your source files, letting you select features that include the language dialect, error reporting, and debugger output, etc.
By default, the ccts compiler operates in the 32-bit word-addressing
mode. The ccts compiler can also be set for the 8-bit byte-addressing
mode. For more information, refer to “-char-size-any” switch
(on page 1-28), “-char-size-{8|32}” switch (on page 1-28), “Data Types
and Data Type Sizes” on page 1-73, and “Byte-Addressing Mode” on
page 1-93.
For more information on the VisualDSP++ environment, see online Help.
1-4VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 49
Compiler Command-Line Interface
This section describes how the ccts compiler is invoked from the command line, the various types of files used by and generated from the
compiler, and the switches used to tailor the compiler’s operation.
This section contains:
•“Running the Compiler” on page 1-6
•“Compiler Command-Line Switches” on page 1-10
•“Data Types and Data Type Sizes” on page 1-73
•“Data Type Alignment” on page 1-75
•“Environment Variables Used by the Compiler” on page 1-76
•“Optimization Control” on page 1-77
Compiler
•“Controlling Silicon Revision and Anomaly Workarounds within
the Compiler” on page 1-82
By default, the compiler runs with Analog Extensions for C code enabled.
This means that the compiler processes source files written in ANSI/ISO
standard C language supplemented with Analog Devices extensions.
Table 1-2 on page 1-8 lists valid extensions of source files the compiler
operates upon. By default, the compiler processes the input file through
the listed stages to produce a .
page 1-9.) Table 1-4 on page 1-11 lists the switches that select the lan-
guage dialect.
Although many switches are generic between C and C++, some of them
are valid in C++ mode only. A summary of the generic C/C++ compiler
switches appears in Table 1-5 on page 1-11. A summary of the C++ specific compiler switches appears in Table 1-6 on page 1-20. The summaries
are followed by descriptions of each switch.
VisualDSP++ 5.0 C/C++ Compiler Manual1-5
for TigerSHARC Processors
DXE file. (See file names in Table 1-3 on
Page 50
Compiler Command-Line Interface
L
the compiler’s default options settings. The way the compiler’s
options are set depends on the environment used to run the DSP
development software.
Running the Compiler
Use the following general syntax for the ccts command line:
When developing a DSP project, sometimes it is useful to modify
Command
Element
cctsName of the compiler program for TigerSHARC processors.
-switchSwitch (or switches) to process.
Description
The compiler has many switches. These switches select the operations and
modes for the compiler and other tools. Command-line switches are case
sensitive. For example,
-O is not the same as -o.
sourceFileName of the file to be preprocessed, compiled, assembled, and/or linked
A file name can include the drive, directory, file name, and file extension.
The compiler supports both Win32- and POSIX-style paths, using either
forward or back slashes as the directory delimiter. It also supports UNC
path names (starting with two slashes and a network name).
When file names or other switches for the compiler include spaces
L
or other special characters, you must ensure that these are properly
quoted (usually using double-quote characters), to ensure that they
are not interpreted by the operating system before being passed to
the compiler.
1-6VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 51
Compiler
The
ccts compiler uses the file extension to determine what the file con-
tains and what operations to perform upon it. Table 1-3 on page 1-9 lists
the allowed extensions.
-Wremarks Selects extra diagnostic remarks in addition to
warning and error messages
-o program.dxe Selects a name for the compiled, linked output
source.c Specifies the C language source file to be compiled
The following example command line for the C++ mode
ccts -proc ADSP-TS101 -c++ source.cpp
runs ccts with:
-c++ Specifies that all of the source files to be compiled
in C++
source.cpp Specifies the C++ language source file for your
program
The normal function of
ccts is to invoke the compiler, assembler, and
linker as required to produce an executable object file. The precise operation is determined by the extensions of the input filenames, and by various
switches.
In normal operation the compiler uses the following extension files to perform a specified action:
VisualDSP++ 5.0 C/C++ Compiler Manual1-7
for TigerSHARC Processors
Page 52
Compiler Command-Line Interface
Table 1-2. File Extensions
ExtensionAction
.c .cpp .cxx .cc .c++Source file is compiled, assembled, and linked
.asm, .dsp, or .sAssembly language source file is assembled and linked
.dojObject file (from previous assembly) is linked
If multiple files are specified, each is first processed to produce an object
file; then all object files are presented to the linker.
You can stop this sequence at various points by using appropriate compiler switches, or by selecting options with the VisualDSP++ environment.
These switches are
-E, -P,-M,-H,-S, and -c.
Many of the compiler’s switches take a file name as an optional parameter.
If you do not use the optional output name switch, ccts names the output
for you. Table 1-3 on page 1-9 lists the type of files, names, and extensions ccts appends to output files.
File extensions vary by command-line switch and file type. These extensions are influenced by the program that is processing the file, any search
directories that you select, and any path information that you include in
the file name. Table 1-3 indicates the searches that the preprocessor, compiler, assembler, and linker support. The compiler supports relative and
absolute directory names to define file search paths. For information on
additional search directories, see the -I directory switch (on page 1-38)
-L directory switch (on page 1-39).
and
When providing an input or output file name as an optional parameter,
use the following guidelines:
•Use a file name (include the file extension) with either an unambiguous relative path or an absolute path. A file name with an absolute
path includes the drive, directory, file name, and file extension.
1-8VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 53
Compiler
•Enclose long file names within straight quotes; for example,
file name.c". The ccts compiler uses the file extension conven-
"long
tions listed in Table 1-3 to determine the input file type.
•Verify that the compiler is using the correct file. If you do not provide the complete file path as part of the parameter or add
additional search directories, ccts looks for input in the current
directory.
Using the verbose output switches for the preprocessor, compiler,
L
assembler, and linker causes each of these tools to display command-line information as they process each file.
Table 1-3. Input and Output Files
Input File ExtensionFile Extension Description
.cC/C++ source file
.cc .cpp .cxxC++ source file
.hHeader file (referenced by a #include statement)
.hpp .hh .hxx .h++ C++ header file (referenced by a #include statement)
.pchC++ pre-compiled header file
.iPreprocessed C/C++ source, created when preprocess only (-E compiler
switch) is specified
.ipa, .opaInterprocedural analysis files—used internally by the compiler when
performing interprocedural analysis
.pgoExecution profile generated by a simulation run. For more information,
see “Using Profile-Guided Optimization” in Chapter 2, Achieving
Optimal Performance from C/C++ Source Code.
.s, .dsp, .asmAssembler source file
.iiTemplate instantiation files—used internally by the compiler when
instantiating C++ templates
.isPreprocessed assembly source (retained when -save-temps is specified)
.ldfLinker Description File
.dojObject file to be linked
VisualDSP++ 5.0 C/C++ Compiler Manual1-9
for TigerSHARC Processors
Page 54
Compiler Command-Line Interface
Table 1-3. Input and Output Files (Cont’d)
Input File ExtensionFile Extension Description
.dlbLibrary of object files to be linked as needed
.xmlProcessor system memory map file output
.symProcessor system symbol map file output
The compiler refers to a number of environment variables during its operation, and these environment variables can affect the compiler’s behavior.
Refer to “Environment Variables Used by the Compiler” on page 1-76 for
more information.
Compiler Command-Line Switches
This section describes the command-line switches used when compiling.
It contains a set of tables that provide a brief description of each switch.
These tables are organized by type of a switch. Following these tables are
sections that provide fuller descriptions of each switch.
C/C++ Compiler Switch Summaries
This section contains a set of tables that summarize generic and specific
switches (options), as follows:
•Table 1-4“C/C++ Mode Selection Switches” on page 1-11
•Table 1-5“C/C++ Compiler Common Switches” on page 1-11
•Table 1-6“C++ Mode Compiler Switches” on page 1-20
1-10VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 55
A brief description of each switch follows the tables, beginning
on page 1-22.
Table 1-4. C/C++ Mode Selection Switches
Switch NameDescription
Compiler
-c89
(on page 1-22)
-c++
(on page 1-22)
Supports programs that conform to the ISO/IEC
9899:1990 standard
Supports ANSI/ISO standard C++ with Analog Devices
extensions
Table 1-5. C/C++ Compiler Common Switches
Switch NameDescription
sourcefile
(on page 1-23)
-@ filename
(on page 1-23)
-A name[tokens]
(on page 1-23)
-add-debug-libpaths
(on page 1-24)
-align-branch-lines
(on page 1-25)
-
allow-macs-to-extend-saturation
(on page 1-25)
-alttok
(on page 1-25)
Specifies file to be compiled
Reads command-line input from the file
Asserts the specified name as a predicate
Link against debug-specific variants of system libraries,
where available.
Quad align predicted branches
Instructs the compiler to try to generate multiply-accumulate instructions using saturating add and subtract
operations.
Allows alternative keywords and sequences in sources
-always-inline
(on page 1-26)
-annotate
inline keyword as a requirement rather than a
Tr e a t s
suggestion.
Enables assembly annotations
(on page 1-26)
-annotate-loop-instr
(on page 1-27)
Provides additional annotation information for the
prolog, kernel and epilog of a loop
VisualDSP++ 5.0 C/C++ Compiler Manual1-11
for TigerSHARC Processors
Page 56
Compiler Command-Line Interface
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-auto-attrs
(on page 1-34)
-bss
(on page 1-27)
Directs the compiler to emit automatic attributes based
on the files it compiles. Enabled by default.
Causes the compiler to place global zero-initialized
data into a separate BSS-style section
-build-lib
(on page 1-27)
-C
(on page 1-27)
-c
(on page 1-28)
-char-size-any
(on page 1-28
-char-size-{8|32}
(on page 1-28)
-const-read-write
(on page 1-29)
-Dmacro[=definition]
(on page 1-29)
-debug-types
(on page 1-30)
-default-branch-{np|p}
(on page 1-30)
-double-size-any
(on page 1-30)
Directs the librarian to build a library file
Retains preprocessor comments in the output file;
active only with the
-E or -P switch)
Compiles and/or assembles only; does not link
Indicate that the resulting object can link against any
char size object
Selects byte (8-bit) or word (32-bit) addressing mode
Constant pointers may access modifiable memory
Defines a macro
Supports building a
*.h file directly and writing a
complete set of debugging information for the header
file
Sets default branches to be predict or non-predict
Indicate that the resulting object can link against any
double size object
-double-size-{32|64}
(on page 1-31)
-dry
(on page 1-32)
-dryrun
(on page 1-32)
Selects 32- or 64-bit IEEE format for
-double-size-32 is the default mode
Displays, but does not perform, main driver actions
(verbose dry-run)
Displays, but does not perform, top-level driver actions
(terse dry-run)
double; the
1-12VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 57
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-E
(on page 1-32)
-ED
(on page 1-32)
Preprocesses, but does not compile, the source file
Preprocesses and sends all output to a file
Compiler
-EE
(on page 1-33)
-enum-is-int
(on page 1-33)
-extra-keywords
(on page 1-33)
-file-attr name[=value]
(on page 1-34)
-flags-{tools} <arg1>
[,arg2...]
(on page 1-34)
-force-circbuf
(on page 1-34)
-fp-associative
(on page 1-35)
-fp-div-lib
(on page 1-35)
-full-version
(on page 1-35)
-g
(on page 1-35)
-glite
(on page 1-36)
Preprocesses and compiles the source file
By default
option ensures the
enums can have a type larger than int. This
enum type is int.
Recognizes Analog Devices extensions to ISO/ANSI
standards for C and C++ (default mode)
Adds the specified attribute name/value pair to the
file(s) being compiled
Passes command-line switches through the compiler to
other build tools
Treats array references of the form
array[i%n] as cir-
cular buffer operations
Treats floating-point multiply and addition as an associative
Uses library code instead of inline code for floating-point divides. Increases accuracy at expense of performance.
Displays version information for build tools
Generates DWARF-2 debug information
Generates lightweightDWARF-2 debug information
-H
(on page 1-36)
-HH
Outputs a list of header files, but does not compile the
source file
Outputs a list of included header files and compiles
(on page 1-37)
VisualDSP++ 5.0 C/C++ Compiler Manual1-13
for TigerSHARC Processors
Page 58
Compiler Command-Line Interface
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-h[elp]
(on page 1-37)
-I-
(on page 1-37)
-I directory
(on page 1-38)
Outputs a list of command-line switches with brief
syntax descriptions
Establishes the point in the include directory list at
which the search for header files enclosed in angle
brackets should begin
Appends directory to the standard search path.
-implicit-pointers
(on page 1-38)
-include filename
(on page 1-39)
-ipa
(on page 1-39)
-L directory
(on page 1-39)
-l library
(on page 1-40)
-list-workarounds
(on page 1-40)
-M
(on page 1-41)
-MD
(on page 1-41)
-MM
(on page 1-41)
-Mo filename
(on page 1-41)
-Mt filename
(on page 1-41)
Demotes incompatible-pointer-type errors into discretionary warnings. Not valid when compiling in C++
mode.
Includes named file prior to preprocessing each source
file
Enables interprocedural analysis
Appends the specified directory to the standard library
search path when linking
Searches the specified library for functions when linking
Lists all compiler-supported errata workarounds
Generates make rules only; does not compile
Generates
make rules, compiles, and prints to a file
Generates make rules and compiles
Writes dependency information to
switch is used in conjunction with the
filename. This
-ED or -MD
options.
Makes dependencies, where the target is renamed as
filename
1-14VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 59
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-map filename
(on page 1-41)
-mem
(on page 1-42)
Directs the linker to generate a memory map of all
symbols
Enables memory initialization
Compiler
-multiline
(on page 1-42)
-never-inline
(on page 1-42)
-no-align-branch-lines
(on page 1-42)
-no-alttok
(on page 1-42)
-no-annotate
(on page 1-43)
-no-annotate-loop-instr
(on page 1-43)
-no-auto-attrs
(on page 1-34)
-no-bss
(on page 1-43)
-no-builtin
(on page 1-44)
-no-circbuf
(on page 1-44)
-no-const-strings
(on page 1-44)
Enables string literals over multiple lines (default)
Ignores
inline keyword on function definitions
Do not align predicted branches to a quad word
boundary
Does not allow alternative keywords and sequences in
sources
Disables the annotation of assembly files
Disables the production of additional loop annotation
information by the compiler (default mode)
Directs the compiler not to emit automatic attributes
based on the files it compiles.
Causes the compiler to group global zero-initialized
data into the same section as global data with non-zero
initializers. Set by default.
For certain language extensions, uses generic implementations in preference to intrinsic functions. See
“Math Intrinsics” on page 1-149.
Disables the automatic generation of circular buffer
code by the compiler
Indicates that string literals should not be qualified as
const
-no-defs
(on page 1-44)
Does not define any default preprocessor macros,
include directories, library directories, libraries,
run-time headers, or keyword extensions
VisualDSP++ 5.0 C/C++ Compiler Manual1-15
for TigerSHARC Processors
Page 60
Compiler Command-Line Interface
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-no-extra-keywords
(on page 1-45)
-no-fp-associative
(on page 1-45)
Does not define language extension keywords that
could be valid C/C++ identifiers
Does not treat floating-point multiply and addition as
an associative
-no-mem
(on page 1-46)
-no-multiline
(on page 1-46)
-no-progress-rep-timeout
(on page 1-46)
-no-saturation
(on page 1-46)
-no-std-ass
(on page 1-47)
-no-std-def
(on page 1-47)
-no-std-inc
(on page 1-47)
-no-std-lib
(on page 1-47)
-no-threads
(on page 1-47)
-no-workaround workaround_id
(on page 1-48)
-O
(on page 1-48)
Disables memory initialization
Disables multiple line string literal support
Prevents the compiler from issuing a diagnostic during
excessively long compilations.
Causes the compiler not to introduce saturation
semantics when optimizing expressions
Disables any predefined assertions and system-specific
macro definitions
Disables normal macro definitions; also disables Analog Devices keyword extensions that do not have leading underscores (__)
Searches for preprocessor header files only in the current directory and in directories specified with the -I
switch
Searches for only those linker libraries specified with
-l switch when linking
the
Specifies that compiled code does not need to be
thread-safe
Disables compiler anomaly workdaround
Enables code optimizations
-O [0|1]
Enables/disables code optimizations
(on page 1-48)
-Oa
Enables automatic function inlining
(on page 1-48)
1-16VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 61
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-Og
(on page 1-49)
-Os
(on page 1-49)
Enables a compiler mode that performs optimizations
while still preserving the debugging information
Optimizes for code size
Compiler
-Ov num
(on page 1-49)
-o filename
(on page 1-51)
-overlay
(on page 1-51)
-P
(on page 1-52)
-PP
(on page 1-52)
-path-{asm|compiler|lib|link}
pathname
(on page 1-52)
-path-install directory
(on page 1-52)
-path-output directory
(on page 1-53)
-path-temp directory
(on page 1-53)
-pch
(on page 1-53)
Controls speed vs. size optimizations
Specifies the output file name
Permits program usage of overlays
Preprocesses, but does not compile, the source file; output does not contain #line directives
Preprocesses and compiles the source file; output does
not contain #line directives.
Uses the specified directory as the location of the specified compilation tool (assembler, compiler, librarian, or
linker, respectively)
Uses the specified directory as the location for all compilation tool
Specifies the location of non-temporary files
Specifies the location of temporary files
Generates and uses precompiled header files (*.pch)
-pchdir directory
Specifies the location of PCHRepository
(on page 1-53)
-pguide
(on page 1-54)
Adds instrumentation for the gathering of a profile as
the first stage of performing profile-guided optimization
-pplist filename
Outputs a raw preprocessed listing to the specified file
(on page 1-54)
VisualDSP++ 5.0 C/C++ Compiler Manual1-17
for TigerSHARC Processors
Page 62
Compiler Command-Line Interface
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-proc processor
(on page 1-55)
-progress-rep-func
(on page 1-56)
-progress-rep-gen-opt
(on page 1-56)
-progress-rep-mc-opt
(on page 1-56)
-progress-rep-timeout
(on page 1-56)
Specifies that the compiler should produce code suitable for the specified processor
Issues a diagnostic message each time the compiler
starts compiling a new function. Equivalent to
-Wwarn=cc1472.
Issues a diagnostic message each time the compiler
starts a new generic optimization pass on the current
function. Equivalent to
Issues a diagnostic message each time the compiler
starts a new machine-specific optimization pass on the
current function. Equivalent to
Issues a diagnostic message if the compiler exceeds a
time limit during compilation.
-Wwarn=cc1473.
-Wwarn=cc1474.
-progress-rep-timeout-secs secs
(on page 1-57)
-R directory
(on page 1-57)
-R-
(on page 1-57)
-S
(on page 1-57)
-s
(on page 1-58)
-save-temps
(on page 1-58)
-section id=section_name
(on page 1-58)
-show
(on page 1-59)
-si-revision version
(on page 1-59)
Specifies how many seconds must elapse during a compilation before the compiler issues a diagnostic on the
length of compilation.
Appends directory to the standard search path for
source files
Removes all directories from the standard search path
for source files
Stops compilation before running the assembler
Removes debugging information from the output executable file when linking
Saves intermediate compiler temporary files
Orders the compiler to place data/program of type
“id” into the section “section_name”
Displays the driver command-line information
Specifies a silicon revision of the specified processor.
The default setting is the latest silicon revision.
1-18VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 63
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-signed-bitfield
(on page 1-60)
-signed-char
(on page 1-60)
Makes the default type for plain
Makes the default type for char signed
Compiler
int bitfields signed
-structs-do-not-overlap
(on page 1-60)
-syntax-only
(on page 1-61)
-sysdefs
(on page 1-61)
-T filename
(on page 1-62)
-threads
(on page 1-62)
-time
(on page 1-62)
-Umacro
(on page 1-63)
-unsigned-bitfield
(on page 1-63)
-unsigned-char
(on page 1-64)
-v
(on page 1-64)
-verbose
(on page 1-64)
-version
(on page 1-64)
Specifies that struct copies may use “memcpy” semantics, rather than the usual “memmove” behavior
Checks the source code for compiler syntax errors, but
does not write any output
Defines the system definition macros
Uses the specified the Linker Description File as control input for linking
Specifies that the build and link should be thread-safe
Displays the elapsed time as part of the output information on each part of the compilation process
Undefines macro(s)
Makes the default type for plain
Makes the default type for
int bitfields unsigned
char unsigned
Displays version and command-line information for all
compilation tools
Displays command-line information for all compilation tools as they process each file
Displays version information for all compilation tools
as they process each file
-W{error|remark|
suppress|warn} number
Overrides the default severity of the specified diagnosticmessages (errors, remarks, or warnings)
(on page 1-64)
VisualDSP++ 5.0 C/C++ Compiler Manual1-19
for TigerSHARC Processors
Page 64
Compiler Command-Line Interface
Table 1-5. C/C++ Compiler Common Switches (Cont’d)
Switch NameDescription
-Werror-limit number
(on page 1-65)
-Werror-warnings
(on page 1-65)
Stops compiling after reaching the specified number of
errors
Directs the compiler to treat all warnings as errors
-Wremarks
(on page 1-65)
-Wterse
(on page 1-65)
-w
Indicates that the compiler may issue remarks, which
are diagnostic messages even milder than warnings
Issues only the briefest form of compiler warnings,
errors, and remarks
Disables all warnings
(on page 1-66)
-warn-protos
Issues warnings about functions without prototypes
(on page 1-66)
-workaround workaround_id
(on page 1-66)
-write-files
Enables code generator workaround for specific hardware defects
Enables compiler I/O redirection
(on page 1-67)
-write-opts
(on page 1-67)
-xref filename
(on page 1-67)
Passes the user options (but not input filenames) via a
temporary file
Outputs cross-reference information to the specified
file.
Table 1-6. C++ Mode Compiler Switches
Switch NameDescription
-anach
(on page 1-68)
Supports some language features (anachronisms) that are
prohibited by the C++ standard but still in common use
-check-init-order
(on page 1-69)
-eh
Adds run-time checking to the generated code highlighting potential uninitialized external objects.
Enables exception handling
(on page 1-70)
-full-dependency-inclusion
(on page 1-70)
Ensures re-inclusion of implictly included files when generating dependency information
1-20VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 65
Table 1-6. C++ Mode Compiler Switches (Cont’d)
Switch NameDescription
Compiler
-ignore-std
(on page 1-71)
-no-anach
(on page 1-71)
-no-eh
(on page 1-71)
-no-implicit-inclusion
(on page 1-71)
-no-rtti
(on page 1-72)
-no-std-templates
(on page 1-72)
-rtti
(on page 1-72)
-std-templates
(on page 1-72)
Disables namespace std within the C++ Standard header
files.
Disallows the use of anachronisms that are prohibited by
the C++ standard
Disables exception-handling
Prevents implicit inclusion of source files as a method of
finding definitions of template entities to be instantiated
Disables run-time type information
Disables the lookup of names used in templates.
Enables run-time type information
Enables the lookup of names used in templates
VisualDSP++ 5.0 C/C++ Compiler Manual1-21
for TigerSHARC Processors
Page 66
Compiler Command-Line Interface
C/C++ Mode Selection Switch Descriptions
The following command-line switches provide C/C++ mode selection.
-c89
The -c89 switch directs the compiler to support programs that conform to
the ISO/IEC 9899:1990 standard. For greater conformance to the standard, the following switches should be used: -alttok, -const-read-write,
and -no-extra-keywords (see Table 1-5 on page 1-11).
-c++
The -c++ (C++ mode) switch directs the compiler to compile the source
file(s) written in ANSI/ISO standard C++ with Analog Devices language
extensions. When using this switch, source files with an extension of .c are
compiled and linked in C++ mode.
All the standard features of C++ are accepted in the default mode except
exception handling and run-time type identification because these impose
a run-time overhead that is not desirable for all embedded programs. Support for these features can be enabled with the -eh and -rtti switches.
(See Table 1-6 on page 1-20.)
Exceptions also require modifications to the Linker Description Files
(LDF); these modifications link against versions of the C++ run-time
library that have been built with exceptions support enabled, and link the
exception-handling library. There are several new data sections that must
be mapped into the .
dxe file as well: .frt, .edt, .cht, and .gdt. See the
default .ldf files included with the release for example modifications.
1-22VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 67
Compiler
C/C++ Compiler Common Switch Descriptions
The following command-line switches apply in C and C++ modes.
sourcefile
The sourcefile parameter (or parameters) switch specifies the name of
the file (or files) to be preprocessed, compiled, assembled, and/or linked.
A file name can include the drive, directory, file name, and file extension.
The ccts compiler uses the file extension to determine the operations to
perform. Table 1-3 on page 1-9 lists the permitted extensions and matching compiler operations.
-@ filename
The -@ filename (command file) switch directs the compiler to read command-line input from filename. The specified filename must contain
driver options but may also contain source filenames and environment
variables. It can be used to store frequently used options as well as to read
from a file list.
-A name [(<tokens>)]
The -A (assert) switch directs the compiler to assert name as a predicate
with the specified tokens. This has the same effect as the #assert preprocessor directive. The following assertions are predefined:
VisualDSP++ 5.0 C/C++ Compiler Manual1-23
for TigerSHARC Processors
Page 68
Compiler Command-Line Interface
The
-A name(value) switch is equivalent to including
#assert name(value)
in your source file, and both may be tested in a preprocessor condition in
the following manner:
#if #name(value)
// do something
#else
// do something else
#endif
For example, the default assertions may be tested as:
#if #machine(adspts)
// do something
#endif
L
-add-debug-libpaths
switch, to prevent misinterpretation. No quotes are needed for a
#assert directive in a source file.
The -add-debug-libpaths switch prepends the Debug subdirectory to the
search paths passed to the linker. The Debug subdirectory, found in each
of the silicon-revision-specific library directories, contains variants of certain libraries (for example, system services), which provide additional
diagnostic output to assist in debugging problems arising from their use.
Invoke this switch with the Use Debug System Libraries radio but-
The parentheses in the assertion need quotes when using the -A
L
ton located in the VisualDSP++ Project Options dialog box, Link
page, Processor category.
1-24VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 69
Compiler
-align-branch-lines
The -align-branch-lines switch instructs the assembler to align all
instruction lines containing a predicted branch to quad-word boundaries.
This is the default.
-allow-macs-to-extend-saturation
By default, the compiler will not try to generate multiply-accumulate
instructions if the add or subtract is saturating. The
-allow-macs-to-extend-saturation switch overrides that behavior. Note
that using this switch may result in different output as the multiplyaccumulate instruction will saturate to 40 bits for intermediate results and
then saturate to 32 bits on extraction from the accumulator.
-alttok
The -alttok (alternative tokens) switch directs the compiler to allow
alternative operator keywords and digraph sequences in source files. This
is the default mode. The -no-alttok switch (on page 1-42) can be used to
disallow such support.
The ANSI C trigraphs sequences are always expanded (even with the
-no-alttok option), and only digraph sequences are expanded in C source
files.
The following operator keywords are enabled by default.
Table 1-8. Keyword Equivalents
KeywordEquivalent
and &&
and_eq &=
bitand&
bitor|
compl~
not!
VisualDSP++ 5.0 C/C++ Compiler Manual1-25
for TigerSHARC Processors
Page 70
Compiler Command-Line Interface
Table 1-8. Keyword Equivalents (Cont’d)
KeywordEquivalent
not_eq!=
or||
or_eq|=
xor^
xor_eq^=
L
To use alternative tokens in C, use #include <iso646.h>.
-always-inline
The -always-inline switch instructs the compiler to always attempt to
inline any call to a function that is defined with the inline qualifier. It is
equivalent to applying #pragma always_inline to all functions in the
module that have the inline qualifier. See also “-never-inline” on
page 1-42.
L
-annotate
The -annotate (enable assembly annotations) switch directs the compiler
to annotate assembly files generated by the compiler. The default behavior
is that whenever optimizations are enabled, all assembly files generated by
the compiler are annotated with information on the performance of the
generated assembly. See “Assembly Optimizer Annotations” on page 2-81
for more details on this feature.
Invoke this switch with the Always radio button located in the
Inlining area of the VisualDSP++ Project Options dialog box,
Compile page, General category.
L
1-26VisualDSP++ 5.0 C/C++ Compiler Manual
Invoke this switch by checking the Generate assembly code anno-tations check box located in the VisualDSP++ Project Options
dialog box, Compile page, General category.
for TigerSHARC Processors
Page 71
Compiler
-annotate-loop-instr
The -annotate-loop-instr switch directs the compiler to provide additional annotation information for the prolog, kernel and epilog of a loop.
See “Assembly Optimizer Annotations” on page 2-81 for more details on
this feature.
-auto-attrs
The -auto-attrs (automatic attributes) switch directs the compiler to
emit automatic attributes based on the files it compiles. Emission of automatic attributes is enabled by default. See “File Attributes” on page 1-312
for more information about attributes, and what automatic attributes the
compiler emits. See also the -no-auto-attrs switch (on page 1-43) and
the -file-attr switch (on page 1-34).
-bss
The -bss switch directs the compiler to place global zero-initialized data
into a BSS-style section (called “bsz”), rather than into normal global data
section. See also -no-bss switch (on page 1-43).
-build-lib
The -build-lib (build library) switch directs the compiler to use elfar
(librarian) to produce a library file (.dlb) as the output instead of using
the linker to produce an executable file (.dxe). The -o option must be
used to specify the name of the resulting library.
-C
The -C (comments) switch, which is only active in combination with the
-E or -P switches, directs the C preprocessor to retain comments in its
output file.
VisualDSP++ 5.0 C/C++ Compiler Manual1-27
for TigerSHARC Processors
Page 72
Compiler Command-Line Interface
-c
The -c (compile only) switch directs the compiler to compile and/or
assemble the source files, but stop before linking. The output is an object
file (.doj) for each source file.
-char-size-any
The -char-size-any switch indicates that the resulting object file should
be marked in such a way that it can link against objects marked with any
char size (8 bit or 32 bit). When linking a project with modules compiled
with 8-bit and 32-bit compilers, use the -char-size-any switch to avoid
any linking error messages.
L
L
-char-size-{8|32}
The -char-size-{8|32} switch specifies that chars are 8-bit data items
(byte addressing mode) or 32-bit data items (which is the default word
addressing mode). Selecting byte addressing mode also sets the macro
__TS_BYTE_ADDRESS to a value of 1. Use the -char-size-any switch to
avoid any linking error messages if both 8-bit and 32-bit modules are used
in building a project.
L
When a project is linked with a mixture of modules compiled in
both word and byte-addressed mode, only one version of the libraries (either word or byte-addressed) can be used. A combination of
both is not allowed.
Invoke this switch with the Allow mixing of sizes radio buttons
located in the VisualDSP++ Project Options dialog box, Compile
category, Processor (1) subcategory.
Invoke this switch with the Char size radio buttons located in the
VisualDSP++ Project Options dialog box, Compile tab,
Compile category, Processor (1) subcategory.
1-28VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 73
Compiler
-const-read-write
The -const-read-write switch directs the compiler to specify that constants may be accessed as read-write data (as in ANSI C). The compiler’s
default behavior assumes that data referenced through const pointers
never changes.
The -const-read-write switch changes the compiler’s behavior to match
the ANSI C assumption, which is that other non-const pointers may be
used to change the data at some point.
L
-const-strings
The -const-strings (const-qualify strings) switch directs the compiler to
mark string literals as const-qualified. This is the default behavior. See
also the -no-const-strings switch (on page 1-44).
L
-Dmacro[=definition]
The -D (define macro) switch directs the compiler to define a macro. If
you do not include the optional definition string, the compiler defines the
macro as the string ‘
constant, it must be surrounded by escaped double quotes. Note that the
compiler processes
fine macro) switches.
Invoke this switch with the Pointers to const may point to non-const data check box located in the Constants area of the
VisualDSP++ Project Options dialog box, Compile page,
Language Settings category.
Invoke this switch with the Literal strings are const check box
located in the Constants area of the VisualDSP++ Project Options
dialog box, Compile page, Language Settings category.
1’. If definition is required to be a character string
-D switches on the command line before any -U (unde-
VisualDSP++ 5.0 C/C++ Compiler Manual1-29
for TigerSHARC Processors
Page 74
Compiler Command-Line Interface
L
-debug-types
The -debug-types switch builds a *.h file directly and writes a complete
set of debugging information for the header file. The -g option need not
be specified with the -debug-types switch because it is implied.
For example,
Until the introduction of -debug-types, the compiler would not accept a
*.h file as a valid input file. The implicit -g option writes debugging
information for only those typedefs that are referenced in the program.
The -debug-types option provides complete debugging information for
all typedefs and structs.
-default-branch-{np|p}
The -default-branch-{np|p} switch instructs the assembler and linker to
set the branch behavior to be predictable or non-predictable. The default
is the predicted condition.
This switch can be invoked with the Definitions: dialog field
located in the VisualDSP++ Project Options dialog box, Compile
tab, Preprocessor category.
ccts -debug-types anyHeader.h
-double-size-any
The -double-size-any switch directs the compiler to mark the resulting
object file in such a way that it can link against objects marked with any
double size (32 bits and 64 bits).
L
1-30VisualDSP++ 5.0 C/C++ Compiler Manual
Invoke this switch with the Allow mixing of sizes check box
located in the VisualDSP++ Project Options dialog box, Compile
page, Processor (1) category.
for TigerSHARC Processors
Page 75
Compiler
-double-size-{32 | 64}
The -double-size-32 (double is 32 bits) and -double-size-64 (double is
64 bits) switches select the storage format that the compiler uses for type
double. The -double-size-32 is the default mode.
The C/C++ type double poses a special problem for the compiler. The C
and C++ languages default to double for floating-point constants and
many floating-point calculations. If double has the customary size of 64
bits, many programs inadvertently use slow-speed 64-bit floating-point
emulated arithmetic, even when variables are declared consistently as
float. To avoid this problem, ccts provides a mode in which double is
the same size as float. This mode is enabled with the -double-size-32
switch and is the default mode.
Representing a double using 32 bits gives good performance and provides
enough precision for most DSP applications. This, however, does not fully
conform to the C and C++ standards. The standards require that double
maintains 10 digits of precision, which requires 64 bits of storage. The
-double-size-64 switch sets the size of double to 64 bits for full standard
conformance.
With -double-size-32, a double is stored in 32-bit IEEE single-precision
format and is operated on using fast hardware floating-point instructions.
Standard math functions, such as sin, also operate on 32-bit values. This
mode is the default and is recommended for most programs. Calculations
that need higher precision can be done with the long double type, which
is always 64 bits.
-double-size-64, a double is stored in 64-bit IEEE double preci-
With
sion format and is operated on using slow floating-point emulation
software. Standard math functions, such as
sin, also operate on 64-bit val-
ues and are similarly slow. This mode is recommended only for porting
code that requires that
double have more than 32 bits of precision.
VisualDSP++ 5.0 C/C++ Compiler Manual1-31
for TigerSHARC Processors
Page 76
Compiler Command-Line Interface
The
-double-size-32 switch defines the __DOUBLES_ARE_FLOATS__ pre-
processor macro, while the -double-size-64 switch undefines the
__DOUBLES_ARE_FLOATS__ preprocessor macro.
L
-dry
The -dry (verbose dry run) switch directs the compiler to display main
ccts actions, but not to perform them.
-dryrun
The -dryrun (terse dry run) switch directs the compiler to display
top-level ccts actions, but not to perform them.
-E
The -E (stop after preprocessing) switch directs the compiler to stop after
the C/C++ preprocessor runs (without compiling). The output (preprocessed source code) prints to the standard output stream (<stdout>) unless
the output file is specified with -o. Note that the -C switch can only be
run in combination with the -E switch.
L
Invoke this switch with the Double size radio buttons located in
the VisualDSP++ Project Options dialog box, Compile tab, Compile category, Processor (1) subcategory.
Invoke it with the Stop after: Preprocessor check box located in
the VisualDSP++ Project Options dialog box, Compile tab, General category.
-ED
The -ED (run after preprocessing to file) switch directs the compiler to
write the output of the C/C++ preprocessor to a file named
original_filename.i. After preprocessing, compilation proceeds
normally.
1-32VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 77
Compiler
L
-EE
The -EE (run after preprocessing) switch is similar to the -E switch, but it
does not halt compilation after preprocessing.
-enum-is-int
The -enum-is-int switch ensures that the type of an enum is int. By
default, the compiler defines enumeration types with integral types larger
than int, if int is insufficient to represent all the values in the enumeration. This switch prevents the compiler from selecting a type wider than
int.
L
-extra-keywords
Invoke this switch with the Generate preprocessed file check box
located in the VisualDSP++ Project Options dialog box, Compile
page, General category.
Invoke this switch with the Enumerated types are always int check
box located in the VisualDSP++ Project Options dialog box,
Compile page, Language Settings category.
The -extra-keywords (enable short-form keywords) switch directs the
compiler to recognize the Analog Devices keyword extensions to
ISO/ANSI standard C and C++. This recognition includes keywords, such
as pm and dm, without leading underscores which could affect conforming
ISO/ANSI C and C++ programs. This is the default mode.
-no-extra-keywords switch (on page 1-45) can be used to disallow
The
support for the additional keywords. Table 1-16 on page 1-91 provides a
list and a brief description of keyword extensions.
VisualDSP++ 5.0 C/C++ Compiler Manual1-33
for TigerSHARC Processors
Page 78
Compiler Command-Line Interface
-file-attr name[=value]
The -file-attr (file attribute) switch directs the compiler to add the
specified attribute name/value pair to all the files it compiles. To add multiple attributes, use the switch multiple times. If “=value” is omitted, the
default value of “1” will be used. See “File Attributes” on page 1-312 for
more information about attributes, and what automatic attributes the
compiler emits. See also the -auto-attrs switch (on page 1-27) and the
-no-auto-attrs switch (on page 1-43).
L
in the VisualDSP++ Project Options dialog box, Compile page,
General category.
Invoke this switch with the Additional attributes text field located
The -flags (command-line input) switch directs the compiler to pass
command-line switches to the other build tools. The tools are listed in
Table 1-9.
Table 1-9. Switches Passed to other Analog Devices’ Tools
OptionTool
-flags-asmAssembler
-flags-compilerCompiler executable
-flags-libLibrary Builder (elfar.exe )
-flags-linkLinker
-flags-memMemory Initializer
-force-circbuf
The -force-circbuf (circular buffer) switch instructs the compiler to
make use of circular buffer facilities, even if the compiler cannot verify
that the circular index or pointer is always within the range of the buffer.
Without this switch, the compiler’s default behavior is conservative, and
1-34VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 79
Compiler
does not use circular buffers unless it can verify that the circular index or
pointer is always within the circular buffer range. See “Circular Buffer
Built-In Functions” on page 1-148.
L
-fp-associative
The -fp-associative switch directs the compiler to treat floating-point
multiplication and addition as an associative. This switch is on by default.
-fp-div-lib
The -fp-div-lib switch instructs the compiler to call a run-time library
support routine for 32-bit floating-point divides rather than inlining the
code. The inline sequence is faster, and is the recommended approach, but
is only accurate to one LSB. Use the -fp-div-lib switch if higher accuracy is required
If this switch is specified, a call is planted to a run-time support routine
with an entry point named “__divsf3” for the divide operation. This routine can be overridden by user-written routines if desired.
L
Invoke this switch with the Even when pointer may be outside
buffer range check box located in the VisualDSP++ Project
Options dialog box, Compile page, Language Settings category.
Invoke this switch with the Do not inline float/double divisions
check box located in the VisualDSP++ Project Options dialog box, Compile page, Processor category.
-full-version
The -full-version (display versions) switch directs the compiler to display version information for build tools used in a compilation.
-g
The -g (generate debug information) switch directs the compiler to output symbols and other information used by the debugger.
VisualDSP++ 5.0 C/C++ Compiler Manual1-35
for TigerSHARC Processors
Page 80
Compiler Command-Line Interface
When the
tion) switch, the compiler performs standard optimizations. The compiler
also outputs symbols and other information to provide limited
source-level debugging through VisualDSP++ IDDE. This combination of
options provides line debugging and global variable debugging.
L
L
-glite
The -glite (lightweight debugging) switch can be used on its own, or in
conjunction with any of the -g, -Og or -debug-types compiler switches.
When this switch is enabled it instructs the compiler to remove any
unnecessary debug information for the code that is compiled.
-g switch is used in conjunction with the -O (enable optimiza-
When the -g and -O switches are specified, no debug information is
available for local variables and the standard optimizations can
sometimes rearrange program code in a way that inaccurate line
number information may be produced. For full debugging capabilities, use the -g switch without the -O switch. See also the -Og
switch (on page 1-49).
Invoke this switch by selecting the Generate debug information
check box in the VisualDSP++ Project Options dialog box,
Compile tab, General category.
When used on its own, the switch also enables the -g option.
L
-H
The -H (list headers) switch directs the compiler to output only a list of
the files included by the preprocessor via the
compiling.
1-36VisualDSP++ 5.0 C/C++ Compiler Manual
This switch can be used to reduce the size of object and executable
files, but will have no effect on the size of the code loaded onto the
target.
#include directive, without
for TigerSHARC Processors
Page 81
Compiler
-HH
The -HH (list headers and compile) switch directs the compiler to output to
the standard out a list of the files included by the preprocessor via the
#include directive. After preprocessing, compilation proceeds normally.
-h[elp]
The -help (command-line help) switch directs the compiler to output a
list of command-line switches with a brief syntax description.
-I-
The -I- (start include directory list) switch establishes the point in the
include directory list at which the search for header files enclosed in angle
brackets begins. Normally, for header files enclosed in double quotes, the
compiler searches in the directory containing the current input file; then
the compiler reverts back to looking in the directories specified with the
-I switch and then in the standard include directory.
It is possible to replace the initial search (within the directory containing
the current input file) by placing the -I- switch at the point on the command line where the search for all types of header file begins. All include
directories on the command line specified before the -I- switch are used
only in the search for header files that are enclosed in double quotes.
Note that this switch removes the directory containing the current input
file from the include directory list.
L
VisualDSP++ 5.0 C/C++ Compiler Manual1-37
for TigerSHARC Processors
Invoke this switch with the Additional include directories text
field located in the VisualDSP++ Project Options dialog box, Compile page, Preprocessor category.
Page 82
Compiler Command-Line Interface
-I directory [{,|;} directory...]
The -I (include search directory) switch directs the C/C++ compiler preprocessor to append the directory (directories) to the search path for
include files. This option can be specified more than once; all specified
directories are added to the search path.
Include files, whose names are not absolute path names and that are
enclosed in “...” when included, are searched for in the following directories in this order:
1. The directory containing the current input file (the primary source
file or the file containing the #include)
2. Any directories specified with the -I switch in the order they are
listed on the command line
3. Any directories on the standard list:
<VDSP++ install dir>/.../include
L
-implicit-pointers
for by using directories defined in items 2 and 3 above.
The -implicit-pointers (implicit pointer conversion) switch allows a
pointer to one type to be converted to a pointer to another without the use
of an explicit cast. The compiler produces a discretionary warning rather
than an error in such circumstances. This option is not valid when compiling in C++ mode. For example,
If a file is included using the <...> form, this file is only searched
int *foo(int *a) {
return a;
}
int main(void) {
char *p = 0, *r;
r = foo(p);/* Bad: will normally give an error. */
return 0;
}
1-38VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 83
Compiler
Both the argument to
compiler. Using -implicit-pointers converts these errors into warnings.
L
-include filename
The -include (include file) switch directs the preprocessor to process the
specified file before processing the regular input file. Any -D and -U
options on the command line are always processed before an -include file.
Only one -include may be given.
-ipa
The -ipa (interprocedural analysis) switch directs the compiler to turn on
the interprocedural analysis option. This option enables optimization
across the entire program, including source files that are compiled separately. Using -ipa implicitly enables the -O switch. For more information,
see “Interprocedural Analysis” on page 1-80.
L
Invoke this switch with the Allow incompatible pointer types
check box located in the VisualDSP++ Project Options dialog box, Compile page, Language Settings category.
Invoke this switch by selecting the Interprocedural Analysis check
box in the VisualDSP++ Project Options dialog box, Compile tab, General category.
foo and the assignment to r will be faulted by the
-L directory [{,|;} directory...]
The -L (library search directory) switch directs the compiler to append the
directory to the search path for library files.
VisualDSP++ 5.0 C/C++ Compiler Manual1-39
for TigerSHARC Processors
Page 84
Compiler Command-Line Interface
-l library
The -l (link library) switch directs the compiler to search the library for
functions when linking. The library name is the portion of the file name
between the lib prefix and .dlb extension. For example, the -lc switch
directs the linker to search in the library named “c” for functions. This
library resides in a file named libc.dlb.
All object files should be listed on the command line before listing libraries using the -l switch. When a reference to a symbol is made, the symbol
definition will be taken from the left-most object or library on the command line that contains the global definition of that symbol. If two
objects on the command line contain definitions of the symbol x, x will be
taken from the left-most object on the command line that contains a global definition of x.
If one of the definitions for x comes from user objects, and the other from
a user library, and the library definition should be overridden by the user
object definition, it is important that the user object comes before the
library on the command line.
Libraries included in the default .ldf file are searched last for symbol
definitions.
-list-workarounds
The -list-workarounds (list supported errata workarounds) switch displays a list of all errata workarounds which the compiler supports. For
more information on valid revisions and the interactions of the -si-revi-
sion
, -workaround and -no-workaround switches, see
“Controlling Silicon Revision and Anomaly Workarounds within the
Compiler” on page 1-82.
1-40VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 85
Compiler
-M
The -M (generate make rules only) switch directs the compiler not to compile the source file, but to output a rule suitable for the make utility,
describing the dependencies of the main program file. The format of the
make rule output by the preprocessor is:
object-file: include-file …
-MD
The -MD (generate make rules and compile) switch directs the preprocessor
to print to a file called original_filename.d a rule describing the dependencies of the main program file. After preprocessing, compilation
proceeds normally. See also the –Mo switch.
-MM
The -MM (generate make rules and compile) switch directs the preprocessor
to print to stdout a rule describing the dependencies of the main program
file. After preprocessing, compilation proceeds normally.
-Mo filename
The -Mofilename (preprocessor output file) switch directs the compiler to
use filename for the output of –MD or –ED switches.
-Mt name
The -Mt name (output make rule for the named source) switch modifies
the target of generated dependencies, renaming the target to name. It only
has an effect when used in conjunction with the
-map filename
-M or -MM switch.
The -map (generate a memory map) switch directs the compiler to output
a memory map of all symbols. The map file name corresponds to the
filename argument; if the filename argument is test, the map file name
test.xml. The .xml extension is added where necessary.
is
VisualDSP++ 5.0 C/C++ Compiler Manual1-41
for TigerSHARC Processors
Page 86
Compiler Command-Line Interface
-mem
The -mem (enable memory initialization) switch directs the compiler to
invoke the memory initializer after linking the executable file. The MemInit utility can be controlled through the -flags-mem switch
(on page 1-34).
-multiline
The -multiline switch enables a compiler GNU compatibility mode
which allows string literals to span multiple lines without the need for a
“\” at the end of each line. This is the default mode.
L
-never-inline
The -never-inline switch instructs the compiler to ignore the inline
qualifier on function definitions, so that no calls to such functions will be
inlined. See also “-always-inline” on page 1-26.
L
-no-align-branch-lines
The -no-align-branch-lines (disable alignment of predicted-taken
branch lines) switch directs the compiler not to align all instruction lines
containing a predicted branch to a quad-word boundary.
-no-alttok
The -no-alttok (disable alternative tokens) switch directs the compiler to
not accept alternative operator keywords and digraph sequences in the
source files. For more information, see the
Invoke this switch with the Allow multi-line character strings
check box located in the VisualDSP++ Project Options dialog box, Compile page, Language Settings category.
Invoke this switch with the Never check box located in the Inlining
area of the VisualDSP++ Project Options dialog box, Compile
page, General category.
-alttok switch (on page 1-25).
1-42VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 87
Compiler
-no-annotate
The -no-annotate (disable assembly annotations) switch directs the compiler not to annotate assembly files generated by the compiler. The default
behavior is that whenever optimizations are enabled, all assembly files generated by the compiler are annotated with information on the
performance of the generated assembly. See “Assembly Optimizer Annota-
tions” on page 2-81 for more details on this feature.
L
-no-annotate-loop-instr
The -no-annotate-loop-instr switch disables the production of additional loop annotation information by the compiler. This is the default
mode.
-no-auto-attrs
The -no-auto-attrs (no automatic attributes) switch directs the compiler
not to emit automatic attributes based on the files it compiles. Emission of
automatic attributes is enabled by default. See “File Attributes” on
page 1-312 for more information about attributes, and what automatic
attributes the compiler emits. See also the -auto-attrs switch
(on page 1-27) and the
L
Invoke this switch by clearing the Generate assembly code annotations check box located in the VisualDSP++ Project Options dialog box, Compile page, General category.
-file-attr switch (on page 1-34).
Invoke this switch by clearing the Auto-generated attributes check
box located in the VisualDSP++ Project Options dialog box,
Compile page, General category.
-no-bss
The -no-bss switch causes the compiler to keep zero-initialized and
non-zero-initialized data in the same data section, rather than separating
zero-initialized data into a different, BSS-style section. See also the
switch (on page 1-27).
VisualDSP++ 5.0 C/C++ Compiler Manual1-43
for TigerSHARC Processors
-bss
Page 88
Compiler Command-Line Interface
-no-builtin
The -no-builtin (no built-in functions) switch directs the compiler not
to generate short names for the built-in functions (for example, abs()),
and to accept only the full name (for example, __builtin_abs()). For a
list of the extensions that use single machine instructions when -no-buil-
tin
is not used, see “Math Intrinsics” on page 1-149. This switch also
predefines the __NO_BUILTIN preprocessor macro.
L
-no-circbuf
The -no-circbuf (no circular buffer) switch disables the automatic generation of circular buffer code by the compiler. Uses of the circindex() and
circptr() functions (that is, explicit circular buffer operations) are not
affected.
L
-no-const-strings
The -no-const-strings switch directs the compiler not to make string literals
-no-defs
The -no-defs (disable defaults) switch directs the preprocessor not to
define any default preprocessor macros, include directories, library directories, libraries, or run-time headers. It also disables the Analog Devices
compiler C/C++ keyword extensions.
Invoke this switch by selecting the Disable builtin functions check
box in the VisualDSP++ Project Options dialog box, Compile tab, Language Settings category.
Invoke this switch with the Never check box located in the
Circular Buffer Generation area of the VisualDSP++ Project Options dialog box, Compile page, Language Settings category.
const qualified.
1-44VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 89
Compiler
-no-extra-keywords
The -no-extra-keywords (disable short-form keywords) switch directs the
compiler not to recognize the Analog Devices keyword extensions that
might affect conformance to ISO/ANSI programs. These extensions
include keywords, such as pm and dm, which may be used as identifiers in
conforming programs. The alternate keywords that are prefixed with two
leading underscores, such as __pm and __dm, continue to work. The
-extra-keyword switch (on page 1-33) can be used to explicitly request
support for the additional keywords.
L
-no-fp-associative
The -no-fp-associative switch directs the compiler NOT to treat
floating-point multiplication and addition as an associative.
L
-no-fp-minmax
The -no-fp-minmax (No floating-point MIN or MAX instructions) switch
prevents the compiler from generating floating-point
tions, when it inlines a floating-point comparison. The
instructions on TigerSHARC processors will return 0xFFFFFFFF if either
input value is a NaN. This can result in behavior not anticipated or
intended by the original user code.
L
Invoke this switch with the Disable Analog Devices extension keywords check box located in the VisualDSP++ Project Options
dialog box, Compile page, Language Settings category.
Invoke this switch with the Do not treat floating-point operations
as associative check box located in the VisualDSP++ Project
Options dialog box, Compile page, Language Settings category.
MIN or MAX instruc-
MAX and MIN
Invoke this switch with the Do not generate float/double
MIN/MAX check box located in the VisualDSP++ Project
Options dialog box, Compile page, Processor (1) category.
VisualDSP++ 5.0 C/C++ Compiler Manual1-45
for TigerSHARC Processors
Page 90
Compiler Command-Line Interface
-no-mem
The -no-mem (disable memory initialization) switch directs the compiler
not to run the MemInit utility. Note that if you use -no-mem, the compiler
does not initialize globals and statics.
-no-multiline
The -no-multiline switch disables a compiler GNU compatibility mode
which allows string literals to span multiple lines without the need for a
“\” at the end of each line.
L
-no-progress-rep-timeout
The -no-progress-rep-timeout (disable progress message for long compilation) switch disables the diagnostic message issued by the compiler to
indicate that it is still working, when a function’s compilation is taking an
excessively long time. The message is disabled by default. See also the
-progress-rep-timeout switch (on page 1-56) and the
-progress-rep-timeout-secs switch (on page 1-57).
-no-saturation
The -no-saturation switch directs the compiler not to introduce faster
operations in cases where the faster operation would saturate (if the
expression overflowed) when the original operation would have wrapped
the result. The code produced in this may may be less efficient than when
the switch is not used.
Saturation is enabled by default when optimizing, and may be disabled by
this switch. Saturation is disabled when not optimizing (for example, this
switch is the default when not optimizing).
Invoke this switch by clearing the Allow multi-line character strings check box located in the VisualDSP++ Project Options dialog box, Compile page, Language Settings category.
1-46VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 91
Compiler
-no-std-ass
The -no-std-ass (disable standard assertions) switch prevents the compiler from defining the standard assertions. See the -A switch
(on page 1-23) for the list of standard assertions.
-no-std-def
The -no-std-def (disable standard macro definitions) prevents the compiler from defining any default preprocessor macro definitions.
L
-no-std-inc
The -no-std-inc (disable standard include search) switch directs the C
preprocessor to limit its search for header files to the current directory and
directories specified with -I switch.
L
-no-std-lib
The -no-std-lib (disable standard library search) switch directs the compiler to limit its search to those libraries specified with the -l switch.
-no-threads
The -no-threads (disable thread-safe build) switch specifies that all compiled code and libraries used in the build need not be thread-safe. This is
the default setting when the
not used.
This switch also disables the Analog Devices keyword extensions
which have no leading underscores, such as pm and dm.
Invoke this switch by selecting the Ignore standard include paths
check box in the VisualDSP++ Project Options dialog box,
Compile tab, Preprocessor category.
-threads (enable thread-safe build) switch is
VisualDSP++ 5.0 C/C++ Compiler Manual1-47
for TigerSHARC Processors
Page 92
Compiler Command-Line Interface
-no-workaround workaround_id[,workaround_id …]
The -no-workaroundworkaround_id (disable avoidance of specific errata)
switch disables compiler code generator workarounds for specific hardware errata. For more information on valid revisions and the interactions
of the -si-revision, -workaround and -no-workaround switches, see
“Controlling Silicon Revision and Anomaly Workarounds within the
Compiler” on page 1-82.
-O
The -O (enable optimizations) switch directs the compiler to produce code
that is optimized for performance. Optimizations are not enabled by
default for the ccts compiler.
L
-O[0|1]
The -O [0|1] (enable/disable optimizations) switch allows the compiler to
select code optimization mode. Optimizations are not enabled by default
for the ccts compiler. (Note that the switch settings are numbers—zeros
or 1s—while the switch itself is the letter “O.”) The switch setting -O or
-O1 turns optimization on, while setting -O0 turns off all optimizations.
L
-Oa
The -Oa (automatic function inlining) switch enables the inline expansion
of C/C++ functions, which are not necessarily declared inline in the source
code. The amount of auto-inlining the compiler performs is controlled
using the –Ov num (optimize for speed versus size) switch (on page 1-49).
Invoke this switch by selecting the Enable optimization check box
in the VisualDSP++ Project Options dialog box, Compile tab, General category.
Invoke this switch by selecting the Enable optimization check box
in the VisualDSP++ Project Options dialog box, Compile tab, General category.
1-48VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 93
Compiler
The
-Ov100 setting attempts to optimize purely for speed (and therefore
inline a greater number of functions) whereas the -Ov0 setting attempts to
optimize purely for space (and therefore inline fewer functions).
L
-Og
The -Og switch enables a compiler mode that attempts to perform optimizations while still preserving the debugging information. It is meant as an
alternative for those who want a debuggable program but who are also
concerned about the performance of their debuggable code.
-Os
The -Os (optimize for size) switch directs the compiler to produce code
that is optimized for size. This is achieved by performing all optimizations
except those that increase code size. The optimizations not performed
include loop unrolling, some delay slot filling, and jump avoidance. The
compiler also uses a function to save and restore preserved registers for a
function instead of generating the more cycle-efficient inline default
versions.
-Ov num
Invoke this switch with the Automatic check box located in the
Inlining area of the VisualDSP++ Project Options dialog box,
Compile page, General category.
For any given optimization, the compiler modifies the code being generated. Some optimizations produce code that will execute in fewer cycles,
but which will require more code space. In such cases, there is a trade-off
between speed and space.
The -Ovnum (optimize for speed versus size) switch informs the compiler
of the relative importance of speed versus size, when considering whether
such trade-offs are worthwhile. The
between 0 (purely size) and 100 (purely speed).
VisualDSP++ 5.0 C/C++ Compiler Manual1-49
for TigerSHARC Processors
num variable should be an integer
Page 94
Compiler Command-Line Interface
0
Execution
count
Optimize for speed
-Ovnum
0100
Infinity
Optimize for space
Limit line
The
num variable indicates a sliding scale between 0 and 100 which is the
probability that a linear piece of generated code – a “basic block” – will be
optimized for speed or for space. At -Ov0 all blocks are optimized for space
and at -Ov100 all blocks are optimized for speed. At any point in between,
the decision is based upon num and how many times the block is expected
to be executed – the “execution count” of the block. Figure 1-1 demonstrates this relationship.
1-50VisualDSP++ 5.0 C/C++ Compiler Manual
Figure 1-1. -Ov Switch Optimization Curve
For any given optimization where speed and size conflict, the potential
benefit is dependent on the execution count: an optimization that
increases performance at the expense of code size is considerably more
beneficial if applied to the core loop of a critical algorithm than if applied
for TigerSHARC Processors
Page 95
Compiler
to one-time initialization code or to rarely-used error-handling functions.
If code only appears to be executed once, it will be optimized for space. As
its execution count increases, so too does the likelihood that the compiler
will consider the code increase worthwhile for the corresponding benefit
in performance.
As Figure 1-1 shows, the
cution count is considered sufficient to switch optimization from “for
space” to “for speed”. Where num is a low value, the compiler is biased
towards space, so a block’s execution count has to be relatively high for the
compiler to apply code-increasing transformations. Where num has a high
value, the compiler is biased towards speed, so the same transformation
will be considered valid for a much lower execution count.
The -Ov switch is most effective when used in conjunction with profileguided optimization, where accurate execution counts are available. Without profile-guided optimization, the compiler makes estimates of the
relative execution counts using heuristics.
L
For more information, see “Using Profile-Guided Optimization” in
Chapter 2, Achieving Optimal Performance from C/C++ Source Code.
-o filename
The -o (output file) switch directs the compiler to use filename for the
name of the final output file.
Invoke this switch with the Optimize for code size/speed slider
located in the VisualDSP++ Project Options dialog box, Compile
page, General category.
-Ov switch affects the point at which a given exe-
-overlay
The -overlay (program may use overlays) switch will disable the propagation of register information between functions and force the compiler to
assume that all functions clobber all scratch registers. Note that this switch
will affect all functions in the source file, and may result in a performance
VisualDSP++ 5.0 C/C++ Compiler Manual1-51
for TigerSHARC Processors
Page 96
Compiler Command-Line Interface
degradation. For information on disabling the propagation of register
information only for specific functions, see “#pragma overlay” on
page 1-210.
-P
The -P (omit line numbers) switch directs the compiler to stop after the C
preprocessor runs (without compiling) and to omit the #line preprocessor
directives (with line number information) in the output from the preprocessor. The -C switch may be used in combination with the -P switch.
-PP
The -PP (omit line numbers and compile) switch directs the compiler to
omit the #line preprocessor directives with line number information from
the preprocessor output. After preprocessing, compilation proceeds
normally.
-path-{ asm | compiler | lib | link } pathname
The -path-{asm|compiler|lib|link} pathname (tool location) switch
directs the compiler to use the specified component in place of the
default-installed version of the compilation tool. The component comprises a relative or absolute path to its location. Respectively, the tools are
the assembler, compiler, librarian, or linker. Use this switch when overriding the normal version of one or more of the tools. The -path-{...}
switch also overrides the directory specified by the
-path-install directory
The -path-install (installation location) switch directs the compiler to
use the specified directory as the location for all compilation tools instead
of the default path. This is useful when working with multiple versions of
the tool set.
L
1-52VisualDSP++ 5.0 C/C++ Compiler Manual
You can selectively override this switch with the -path-{asm|
compiler|lib|link}
switch.
-path-install switch.
for TigerSHARC Processors
Page 97
Compiler
-path-output directory
The -path-output (non-temporary files location) switch directs the compiler to place final output files in the specified directory.
-path-temp directory
The -path-temp (temporary files location) switch directs the compiler to
place temporary files in the specified directory.
-pch
The -pch (precompiled header) switch directs the compiler to automatically generate and use precompiled header files. A precompiled output
header has a .pch extension attached to the source file name. By default,
all precompiled headers are stored in a directory called PCHRepository.
L
-pchdir directory
The -pchdir (locate PCHRepository) switch specifies the location of an
alternative PCHRepository for storing and invocation of precompiled
header files. If the directory does not exist, the compiler creates it. Note
that the -o (output) switch does not influence the -pchdir option.
-pgo-session session-id
The -pgo-sessionsession-id (specify PGO session identifier) switch is
used with profile-guided optimization. It has the following effects:
Precompiled header files can significantly speed compilation; precompiled headers tend to occupy more disk space.
•When used with the -pguide switch (on page 1-54), the compiler
associates all counters for this module with the session identifier
session-id.
•When used with a previously-gathered profile (a .pgo file), the
compiler ignores the profile contents, unless they have the same
session-id identifier.
VisualDSP++ 5.0 C/C++ Compiler Manual1-53
for TigerSHARC Processors
Page 98
Compiler Command-Line Interface
This is most useful when the same source file is being built in more than
one way (for example, different macro definitions, or for multiple processors) in the same application; each variant of the build can have a different
session-id associated with it, which means that the compiler will be able
to identify which parts of the gathered profile should be used when optimizing for the final build.
If each source file is built only in a single manner within the system (the
usual case), then the -pgo-session switch is not needed.
L
For more information, see “Using Profile-Guided Optimization” in
Chapter 2, Achieving Optimal Performance from C/C++ Source Code.
-pguide
The -pguide (PGO) switch causes the compiler to add instrumentation
for the gathering of a profile (a .pgo file) as the first stage of performing
profile-guided optimization.
L
For more information, see “Using Profile-Guided Optimization” in
Chapter 2, Achieving Optimal Performance from C/C++ Source Code.
-pplist filename
The -pplist (preprocessor listing) switch directs the preprocessor to output a listing to the named file. When more than one source file is
preprocessed, the listing file contains information about the last file processed. The generated file contains raw source lines, information on
transitions into and out of include files, and diagnostics generated by the
compiler.
Invoke this switch with the PGO session name text field located in
the VisualDSP++ Project Options dialog box, Compile page, Pro-file-Guided Optimization category.
Invoke this switch with the Prepare application to create new pro-file check box located in the VisualDSP++ Project Options dialog
box, Compile page, Profile-Guided Optimization category.
1-54VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Page 99
Each listing line begins with a key character that identifies its type as:
Table 1-10. Key Characters
CharacterMeaning
NNormal line of source
XExpanded line of source
SLine of source skipped by #if or #ifdef
LChange in source position
RDiagnostic message (remark)
WDiagnostic message (warning)
EDiagnostic message (error)
CDiagnostic message (catastrophic error)
-proc processor
Compiler
The -proc processor (target processor) switch specifies that the compiler
produces code suitable for the specified processor. Refer to “Supported
Processors” for the list of supported TigerSHARC processors.
For example,
ccts -proc ADSP-TS201 -o bin\p1.doj p1.asm
If no target is specified with the -proc switch, the system uses the
L
ADSP-TS101 setting as a default.
When compiling with the -proc switch, the appropriate processor macro
is defined as 1.
See also “-si-revision version” on page 1-59 for more information
L
on silicon revision of the specified processor.
VisualDSP++ 5.0 C/C++ Compiler Manual1-55
for TigerSHARC Processors
Page 100
Compiler Command-Line Interface
-progress-rep-func
The -progress-rep-func switch provides feedback on the compiler’s
progress that may be useful when compiling and optimizing very large
source files. It issues a “warning” message each time the compiler starts
compiling a new function. The “warning” message is a remark that is disabled by default, and this switch enables the remark as a warning. The
switch is equivalent to -Wwarn=cc1472.
-progress-rep-gen-opt
The -progress-rep-gen-opt switch provides feedback on the compiler’s
progress that may be useful when compiling and optimizing a very large,
complex function. It issues a “warning” message each time the compiler
starts a new generic optimization pass on the current function. The
“warning” message is a remark that is disabled by default, and this switch
enables the remark as a warning. The switch is equivalent to
-Wwarn=cc1473.
-progress-rep-mc-opt
The -progress-rep-mc-opt switch provides feedback on the compiler’s
progress that may be useful when compiling and optimizing a very large,
complex function. It issues a “warning” message each time the compiler
starts a new machine-specific optimization pass on the current function.
The “warning” message is a remark that is disabled by default, and this
switch enables the remark as a warning. The switch is equivalent to
-Wwarn=cc1474.
-progress-rep-timeout
The -progress-rep-timeout switch issues a diagnostic message if the
compiler exceeds a time limit during compilation. This indicates the compiler is still operating, just taking a long time.
1-56VisualDSP++ 5.0 C/C++ Compiler Manual
for TigerSHARC Processors
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.