pc(1) — Commands
Name
pc − Compaq Pascal compiler
Syntax
pc [option] ... file ... [option]
Description
The pc command invokes the cpp preprocessor, the Compaq Pascal compiler, and the linker.
The Compaq Pascal compiler accepts programs that comply with the unextended Pascal standards and programs that comply with a subset of the Extended Pascal standards. Compaq Pascal also provides features (called extensions) that are not part of any standard and contains FIPS-109 (Federal Information Processing Standard) validation support.
The Extended Pascal standards are a superset of the unextended Pascal standards. Because Compaq Pascal supports many (but not all) Extended Pascal Standard features, it cannot compile all programs that comply with Extended Pascal. See the Compaq Pascal Language Reference Manual for more information about the Pascal standards.
The pc command accepts the following types of arguments:
•Arguments whose names end with .p, .P, .pas, or .PAS, which are assumed to be Pascal language source files.
•Arguments whose names end with .o, which are assumed to be object files.
•Arguments whose names end with .i, which are assumed to be Pascal source code that has been processed by the C preprocessor. They are compiled without being processed by C preprocessor.
•Arguments whose names end with .c, which are assumed to be C language source files.
•Arguments whose names end with .a, which are assumed to be archive library files.
•Arguments whose names end with .so, which are assumed to be shared library files.
•Other arguments that are interpreted as either loader option arguments or arguments that specify the environment for the compilation.
If the environment variable DECPASCAL is set, the value is used as the name of the compiler to invoke.
If the environment variable DECPASCAL_LIB_PATH is set, the value is used on the ld(1) command line as a library to search (using the -L option.)
The pc command defines the following cpp(1) macros to cpp(1) :
•LANGUAGE_PASCAL
•__LANGUAGE_PASCAL__
•unix
•__unix__
•__alpha
•__osf__
Options
Some pc options are specified using keywords. Specify these options in the form: −name keyword. You must spell out the −name completely, but you can abbreviate the keyword to its shortest unique prefix (4 characters is the recommended length).
The pc command accepts the following options:
−align target
Control the default alignment rules. The target parameter is required. You can specify one of the following:
Alpha_AXP (default)
Aligns unpacked objects on natural boundaries based on their size. For example, longwords are aligned on longword boundaries.
vax Aligns unpacked objects on the next byte boundary.
−arch keyword
Specifies the lowest version of the Alpha architecture where this code will run, which can allow the compiler to generate more efficient code, with the tradeoff that code may not run on older systems, unlike the -tune option.
All Alpha processors implement a core set of instructions and, in some cases, the following extensions: BWX (byte- and word- manipulation instructions) and MAX (multimedia instructions). (The Alpha Architecture Reference Manual describes the extensions in detail.)
The option specified by the -arch flag determines which instructions the compiler can generate, and which coding rules it must follow:
generic
Generate instructions that are appropriate for all Alpha processors. This option is the default, and is equivalent to -arch ev4.
host
Generate instructions for the processor that the compiler is running on (for example, EV56 instructions on an EV56 processor, and EV4 instructions on an EV4 processor).
ev4 Generate instructions for the EV4 base design processors (21064, 20164A, 21066, and 21068 chips).
ev5 Generate instructions for the EV5 processor (some 21164 chips). (Note that the EV5 and EV56 processors both have the same chip number - 21164.)
ev56
Generate instructions for EV56 processors (some 21164 chips).
This option permits the compiler to generate any EV4 instruction, plus any instructions contained in the BWX extension.
Applications compiled with this option may incur emulation overhead on EV4 and EV5 processors.
pca56
Generate instructions for PCA56 processors (21164PC chips).
This option permits the compiler to generate any EV4 instruction, plus any instructions contained in the BWX or MAX extensions. However, Compaq Pascal does not generate any of the instructions in the MAX (multimedia) extension to the Alpha architecture.
Applications compiled with this option may incur emulation overhead on EV4 and EV5 processors.
ev6 Generate instructions for EV6 processors (21264 chips).
This option permits the compiler to generate any EV4 instruction, any instruction contained in the BWX and MAX extensions, plus any instructions added for the EV6 chip. These new instructions include a floating-point square root instruction (SQRT), integer/floating-point register transfer instructions, and additional instructions to identify extensions and processor groups.
Applications compiled with this option may incur emulation overhead on EV4, EV5, EV56, and PCA56 processors.
A program compiled with any of the above options will run on any Alpha processor with a superset of capabilities compared to the specified target processor. In many cases, code will also move to older processors, though potentially with significant overhead due to emulation, provided the processor is running a recent enough version of the operating system to provide emulation. In particular, Digital UNIX V4.0 emulates the BWX instruction set group on older processors, so -arch ev56 code will run on ev4 and ev5 systems, other than for -ieee code.
Compaq very strongly discourages compiling code with a -arch that is above any projected target system for an application. The -tune option is should be used for performance tuning.
The -arch and -tune options can be used in conjunction to describe the lower bound and the common case for compiling code. For example, -arch ev5 -tune ev6 specifies that the code will never run on a processor older than an ev5 system, but should be tuned to run on ev6 systems preferentially. Note that -tune may cause the compiler to generate instructions not present in the lowest specified architecture level, but if it does, it will generate code such that the new instructions will be guarded against execution on older processors.
Note that -tune defaults to the value of -arch, if it isn’t specified.
The psrinfo -v command can be used to determine which type of processor is installed on any given Alpha system.
−assume keyword
Specifies what the compiler can assume about program behavior indicated by the following options:
[no]accuracy_sensitive
Specifies whether certain code transformations that affect floating-point operations are allowed. These changes may or may affect the accuracy of the program’s results.
If you specify −assume noaccuracy_sensitive, the compiler is free to reorder floating-point operations based on algebraic identities (inverses, associativity, and distribution). This allows the compiler to move additional floating-point operations outside of loops or reduce or remove floating-point operations totally, thereby improving performance.
The default, −assume accuracy_sensitive, directs the compiler to avoid certain floating-point trasformations that might slighly affect the program’s accuracy.
−B Direct cpp(1) to strip comments that begin with "//" and end with newline, in the style of C++.
−bestGnum
Request examination of source module data items during compilation and linking to calculate the best number of bytes to be used for the −G option. Summary information is written to stdout, including a recommended value for −G .
−C keyword
Generate code for run-time checking.
Omitting −C suppresses run-time checking.
The keyword parameter is required. You can specify one of the following:
all Indicates that all keywords are to be used.
bounds
Verifies that an index expression is within the bounds of an array’s index type, that character-string sizes are compatible with the operations being performed, and that schemata are compatible.
case_selectors
Verifies that the value of a case selector is contained in the corresponding case-label list.
declarations
Verifies that schema definitions yield valid types and that uses of GOTO from one block to an enclosing block are correct.
overflow
Verifies that the result of an integer computation does not exceed the machine representation.
pointers
Verifies that the value of a pointer variable is not NIL when being dereferenced.
subrange
Verifies that values assigned to variables of subrange types are within the subrange; verifies that a set expression is assignment compatible with a set variable; verifies that MOD operates on positive numbers.
−c Suppress the linking phase of the compilation and force an object file to be produced even if only one program is compiled.
−call_shared
Directs the linker to search for unresolved references in shared library files (files that end with .so) before searching in archive library files (files that end with .a).
−constant name=value
Creates a Pascal constant with the specified value. The name can be any legal Compaq Pascal identifier. The value can be: an integer-literal; a negative-integer-literal; TRUE or FALSE; or a quoted-string-literal. More than one −constant options may be specified.
The −constant option is designed to be used with the Compaq Pascal conditional compilation syntax, but the constants defined can be used in any Pascal expression just like normal constants defined in the CONST section.
−cord Run the cord(1) the resulting file after linking. The rearrangement reduces the cache conflicts of the program’s text. The output of cord(1) is left in the file specified by the -o "output" option or a.out, by default. At least one −feedback file must be specified.
−cpp The default. Run the C macro preprocessor on all Pascal source files before compiling.
−Dname=def
−Dname
Define name to the cpp(1) preprocessor, as if by #define. If no definition is given, name is defined as "1".
−E Run only the C preprocessor on the files (regardless of the suffix), and send the result to the standard output. Sets the −cpp option.
−enumeration_size value
Control the allocation of enumerated data types. The value parameter is required. You can specify one of the following:
byte
Allocates unpacked enumerated types with fewer than 255 elements in a 8-bit byte. Otherwise unpacked enumerated types are allocated in a 16-bit word. The Boolean data type is considered an enumerated type containing two elements and its allocation is also controlled by this option.
long
Allocates all unpacked enumerated types in a 32-bit longword. The Boolean data type is considered an enumerated type containing two elements and its allocation is also controlled by this option.
−error_limit count
Direct the compiler to stop after count errors. If count is omitted, the default is 30 errors. If −error_limit is omitted, the compiler stops after 500 errors.
−env file
Produce a file containing compressed symbol table information. The file parameter is required. The file is used by subsequent Compaq Pascal compilations of programs that names file with the INHERIT attribute. You can also use the ENVIRONMENT attribute to create environment files. The default is to not produce an environment file.
−feedback file
Specify the feedback file for cord(1) to use. The prof(1) command produces the feedback file with its −feedback option from an execution of the program produced by pixie(1).
−G num
Specify the maximum size, in bytes, of a data item that is to be accessed from the global pointer. The num argument is interpreted as a decimal number. The default value for num is 8 bytes.
−g0 The default. Do not produce symbol table information for symbolic debugging.
−g1 Produce additional symbol table information for accurate but limited symbolic debugging of partially optimized code.
−g or −g2
Produce additional symbol table information for full symbolic debugging and disable optimizations that limit full symbolic debugging. This option also sets the −O0 option to disable optimization unless an explicit −O option is specified.
−g3 Produce additional symbol table information for full symbolic debugging for fully optimized code. This option produces additional debugging information describing the effects of optimizations, but debugging inaccuracies can occur as a result of the optimizations that have been performed.
−granularity keyword
Generate additional code to perserve the indicated memory granularity. The keyword parameter is required. You can specify one of the following:
byte
longword
quadword (default)
All modules must be compiled with the same granularity setting to ensure proper behavior. The -granularity option only affects scalar types.
−I Prevents cpp(1) from searching for #include files in /usr/include. It also prevents the compiler from searching there for files specified in an %INCLUDE directive or [inherit] attribute.
−Idir Directs cpp(1) to search for #include files whose names do not begin with ‘/’, and directs the compiler to search for %INCLUDE files and [inherit] environment files whose names do not begin with ‘/’ in the following order: (1) in the directory of the file argument; (2) in the directories specified by the -I option; (3) in the standard directory /usr/include.
−inline keyword
The keyword parameter is required. You can specify one of the following:
all Inlines every call that it is possible to inline while still generating correct code. However, recursive routines will not cause an infinite loop at compile time.
none
Suppresses all inlining of routines. The is the default for optimization level 0.
manual
Inlines only routines that specify the [OPTIMIZE(INLINE)] attribute. This is the default for optimization levels 1 through 3.
size
Inlines all routines that specify the [OPTIMIZE(INLINE)] attribute plus any additional calls that the compiler determines will improve run-time performance without significantly increasing the size of the program. This option is only available with optimization levels 4 and 5.
speed
Inlines all routines that specify the [OPTIMIZE(INLINE)] attribute plus any additional calls that the compiler determines will improve run-time performance even where it may significantly increase the size of the program. This is the default for optimization levels 4 and 5 and is only available at those optimization levels.
−K Do not remove temporary files created during compilation and linking. The option does not affect naming for temporary files. To see names and locations of temporary files, specify the −v option.
−L Prevent the linker from searching for libraries in the standard directories.
−Ldir Direct the linker to search for libraries in dir before searching the standard directories.
−Lstring
Searches string libraries for ld(1). This option should be placed at the end of the command line.
−M Direct cpp(1) to generate dependency lists suitable for make(1) instead of the normal output. The dependency lists do not contain files included or inherited with the Compaq Pascal %INCLUDE directive or ENVIRONMENT or INHERIT attributes. The output from this command goes to stdout.
−math_library value
Determine whether the compiler uses alternate math library routines. The value parameter is required. You can specify one of the following:
accurate (default)
fast
−nocpp Do not run the cpp(1) preprocessor on Pascal source files before
compiling.
−non_shared
Direct the linker to search for unresolved references in archive library files (.a files). Does not search .so files.
−nowarn
Suppress all warning messages.
−nozero_heap
Disables the default zeroing of memory by the NEW predeclared routine.
−O0 Disable all optimizations.
−O1 Enable local optimizations and recognition of common subexpressions.
−O2 Enable all -O1 optimizations and some global optimizations that include code motion, strength reduction and test replacement, split lifetime analysis, and code scheduling.
−O3 Enable all -O2 optimizations and additional global optimizations that improve speed (at the cost of extra code size), such as integer multiplication and division expansion (using shifts), loop unrolling, and code replication to eliminate branches.
−O or −O4
Enable all -O3 optimizations and, in addition, enable automatic inline expansion of procedures and functions.
−O5 Enables all -O4 optimizations and, in addition, enables software pipelining using dependency analysis, vectorization of some loops on 8-bit and 16-bit data, and insertion of NOP instructions to improve scheduling.
−o file Name the final output file file. If this option is used, the file a.out is undistrubed. Note that you must specify a filename.
−P Run only the C macro preprocessor (cpp) and put the result for each source file (by suffix convention, that is, .p, .P, .pas, .PAS, and .s) in a corresponding .i file. The .i file has no ‘#’ lines in it. This sets the −cpp option.
−p0 The default. Disable profiling. If loading occurs, the standard run-time startup routine (crt0.o) is used and the profiling libraries are not searched.
−p1 or −p
Set up profiling by periodically sampling the value of the program counter. This option only effects the loading. When loading occurs, this option replaces the standard run-time startup routine with the profiling run-time startup routine (mcrt1.o) and searches the level 1 profiling library (libprof1.a). When profiling occurs, the startup routine calls the routine monstartup(3) and produces the file mon .out, which contains execution-profiling data for use with prof(l).
−pg Set up profiling for gprof(l).
−platforms name
Produce informational messages about non-portable language features for the specified platform. The name parameter is required. You can specify one of the following:
common
Displays informational messages for all platforms.
OpenVMS_VAX
Displays informational messages for the OpenVMS VAX platform.
OpenVMS_AXP
Displays informational messages for the OpenVMS Alpha platform.
OSF1_AXP
Displays informational messages for the Tru64 UNIX platform.
−show keyword
Control what is printed in the listing file. The keyword parameter is required. You can specify one of the following:
all Uses all keywords
header
Header lines on each page of the listing
include
%INCLUDE files processed
machine_code
Symbolic generated code
source
Source file
statistics
Compilation summary page
structure_layout
Description of variables and types including size and offset information
xref
Cross reference of the compilation
−std stdname
Issue informational or error messages if the program violates the rules of the specified Pascal standard. Does not run cpp(1) when standards checking is enabled. Valid standard names are:
ansi
ANSI/IEEE703X3.97-1989
ansi_validate
Issue error level messages instead of default informational level messages.
iso ISO 7185-1989
iso_validate
Issue error level messages instead of default informational level messages.
extended
ISO 10206-1989
extended_validate
Issue error level messages instead of default informational level messages.
−tune option
Selects processor-specific instruction tuning for a specific implementation of the Alpha architecture. Tuning for a specific implementation can provide improvements in run-time performance.
Regardless of the setting of the -tune flag, the generated code will run correctly on all implementations of the Alpha architecture. Note that code tuned for a specific target may run more slowly on another target than generically-tuned code.
The option keyword can be one of the following:
generic
Selects instruction tuning that is appropriate for all implementations of the Alpha architecture. This option is the default.
host
Selects instruction tuning that is appropriate for the machine on which the code is being compiled.
ev4 Selects instruction tuning for the 21064, 21064A, 21066, and 21068 implementations of the Alpha architecture.
ev5,ev56
Selects instruction tuning for the 21164 implementation of the Alpha architecture.
ev6 Selects instruction tuning for the 21264 implementation of the Alpha architecture.
−usage ktype
Issue informational messages about unused or uninitialized variables in the program. The ktype parameter is required.
To enable selected keywords, specify -usage with those keywords; only the selected keywords are enabled. If -usage is not specified, the compiler does not display usage information. You can specify one of the following:
all Enables all ktypes.
nongrnacc
Detects code for which the compiler cannot generate requested granularity.
performance
Detects variables, array components, and record fields that will generate less than optimal performance due to alignment or size considerations.
uncertain
Issues informational messages for components of structures that result in unaligned data accesses. Such accesses may cause poor run-time performance.
uninitialized
Detects variables that are uninitialized.
unused
Detects variables that are unused.
uncallable
Detects routines that are unused.
volatile
Detects accesses to volatile data that cannot be protected as atomic operations.
−V Create a listing file of the source file with compile-time information appended. The name of the listing file is the basename of the source file with .l substituted for the suffix of the source file.
−v As the driver program executes, print the passes with their arguments and their input and output files. Print final resource usage in C-shell format.
Diagnostics
The diagnostics produced by pc are intended to be self-explanatory. The assembler or loader may occasionally produce messages.
Files
file.pas input file
file.i output from cpp
file.o object file
a.out loaded output
/lib/cpp C macro preprocessor
/usr/lib/cmplrs/pc/decpascal Compaq Pascal for Tru64 UNIX compiler
/tmp temporary
/usr/bin/pc Compaq Pascal compiler driver
/usr/bin/cc c compiler driver
/usr/lib/cmplrs/pc/crt0.o run-time startup
/usr/lib/libpas.a Pascal runtime library
/usr/shlib/libFutil.so Fortran utility library
/usr/ccs/lib/cmplrs/cc/libexc.a Exception handling library
/usr/shlib/libm.so Math library
/usr/shlib/libots.so OTS library
/usr/shlib/libc.so standard library
/usr/ccs/lib/cmplrs/cc/libexc_init.a Exception handling initialization
/usr/lib/cmplrs/cc/ld Loader
/usr/include Standard directory for #include files
See Also
cc(1), cord(1), cpp(1), dbx(1), ld(1), mon(1), pixie(1), prof(1), the Compaq Pascal Language Reference Manual for a description of the Compaq Pascal alignment, packing, and allocation rules, and the Compaq Pascal User Manual for Tru64 UNIX.