RELEASE NOTES FOR VAX C V3.0
These notes contain information on the following aspects of VAX C
V3.0:
o Installation
o Functional Enhancements
o Bug Fixes
o Documentation Errata
o Restrictions and Known Bugs
1 INSTALLATION
This version of the compiler contains License Management Facility
support. The compiler cannot be run unless a license has been
installed on the machine.
This release of VAX C has an installation option for installing a new
version of PPLRTL.EXE. Answer "Y" to this question during
installation if you are going to do any parallel processing work.
This new version of PPLRTL.EXE is necessary to utilize the new
parallel malloc.
For more information, see the VAX C Installation Guide.
2 FUNCTIONAL ENHANCEMENTS
The following is a list of new features implemented in VAX C V3.0:
o Compiler-assisted loop decomposition -- This feature allows
for the execution of for and while loops in parallel, with
the compiler automatically generating code to run the loops
concurrently. If the compiler determines that a loop cannot
be run safely in parallel, it generates informational
messages. You then have a chance to give the compiler more
information, or to recode the algorithm to allow the loop to
decompose.
o Function-inlining optimization -- Also called function
unrolling, this performance enhancement can eliminate call
overhead to functions whose definitions appear in the same
file they are called from.
Page 2
o Access to specialized VAX instructions -- New builtin C
functions allow you direct access to some specialized VAX
instructions from your C code.
o Separate preprocessor output -- A new qualifier has been
added which causes the compiler to write the preprocessed
source to a file.
o Direct calls to MTH$SIN, MTH$COS, and MTH$TANH -- This is a
performance improvement. This feature eliminates the extra
level of call which occurs if the C run-time library
interface is used to call sin, cos, or tanh. You must
include math.h in the module which calls these functions in
order to take advantage of this support.
o Minor ANSI C extensions -- The new syntax for float and
unsigned int constants is accepted, as well as the function
designator syntax.
o Longer variable names -- Variable names are now allowed to be
up to 255 characters long.
o No /STANDARD=PORTABLE messages against include files -- The
qualifier /STANDARD=PORTABLE no longer generates messages
against the contents of VAX C-provided include files.
o The VAX C include files were updated to match VMS V5.0. In
addition, many new include files were created.
These features are covered in more detail below.
This release of VAX C includes new versions of all three associated
manuals: The Guide to VAX C, the VAX C Run-Time Library Reference
Manual, and the VAX C Installation Guide. Please see the manuals for
detailed information on new features.
2.1 Compiler-Assisted Loop Decomposition
In V3.0 of VAX C, a new qualifier, /[NO]PARALLEL has been added. When
the /PARALLEL qualifier is specified, the compiler analyzes all for
and while loops in a program to determine if they can be run in
parallel across multiple processes. When the main program is compiled
with /PARALLEL, the compiler generates code to start up a number of
processes. When a loop can be decomposed, the compiler generates code
which causes these processes to each execute some number of iterations
of the loop.
NOTE
The main program for the application must be in C, and
must either be named "main" or be declared with the
Page 3
main_program option. If this is not the case, memory
allocated with malloc will not be accessible from the
subprocesses. The most common manifestation of this
problem is an access violation at runtime.
If the compiler determines that a for or while loop is not safe to
decompose, informational messages are generated. You then have the
following options:
o Ignore the messages (or insert the new sequential_loop
decomposition pragma to turn off decomposition analysis for
that loop)
o Give the compiler additional information through the
safe_call or ignore_dependency decomposition pragmas to allow
the compiler to determine the loop is safe to decompose
o Recode the algorithm in the loop to allow it to decompose
/PARALLEL is only in effect when /OPTIMIZE is also in effect, since
the decomposition loop analysis occurs during the optimization phase
of the compiler. /NOPARALLEL is the default.
Another qualifier, /SHOW=DECOMPOSITION_ANALYSIS, has also been
implemented in V3.0 of VAX C. This qualifier, when used in
conjunction with /PARALLEL and /LISTING, shows which loops in your
program were decomposed.
VAX C V3.0 provides additional Language Sensitive Editor (LSE) support
to assist with the insertion of appropriate pragmas to allow
decomposition.
2.1.1 Linking Against VAX C Parallel Processing Support -
2.1.1.1 Parallel Processing Memory Management Library - An object
library has been provided with the compiler which contains a parallel
processing version of malloc, calloc, free, cfree, and realloc. This
file is named VAXCPAR.OLB. The version of malloc contained in this
library will allocate memory that is globally accessible from all
subprocesses in a decomposed program. The memory allocated with this
malloc/calloc must be de-allocated with the version of free/cfree
included in this library.
To prevent possible errors, these memory allocation functions have
different names than the versions found in the C RTL libraries.
However, you do not have to rename your calls to C memory allocation
functions in order to access them. The include file stdlib.h uses a
new predefined macro name, CC$parallel, to redefine the names of the
memory allocation functions to the parallel names when /PARALLEL is
Page 4
specified. (The macro is defined to 1 when /PARALLEL is specified,
and 0 when /NOPARALLEL is specified.) If you compile your program with
/PARALLEL and declare the memory allocation functions using stdlib.h,
calls to the memory allocation functions will correctly resolve to the
parallel versions. If you neglect to use stdlib.h to declare the
functions, a potential mismatch can occur.
After compiling with /PARALLEL to get the appropriate memory
management routines, you must link with the VAXCPAR.OLB library in
addition to the normal VAX C runtime libraries or shareable images you
use.
The advantage of using these functions is that any memory allocated by
malloc can be accessed by any of the subprocesses in the parallel
program. This allows for the correct decomposition of loops which act
on dynamically allocated arrays.
These functions act slightly differently than the normal C RTL
versions. The free function does not return a value, and malloc does
not set errno; both of these behaviors conform to the draft ANSI
standard, but differ from the current behavior of the usual C RTL
routines.
2.1.1.2 Creating A Shared Image Using VAX C Parallel Processing
Support - The VAX C parallel processing support is based upon
the VAX FORTRAN parallel processing support run-time library. To
create a shareable image that uses VAX C parallel processing, you need
to include the following object modules from STARLET.OLB other than
the FORRTL2 shareable image itself:
(modules from SYS$LIBRARY:STARLET.OLB)
FOR$INISHR
LIB$INITIALIZE, and
SYS$P1_VECTOR
The following is an example of a linker option file:
SYS$LIBRARY:STARLET.OLB/INCLUDE=(FOR$INISHR,-
LIB$INITIALIZE, -
SYS$P1_VECTOR)
SYS$LIBRARY:FORRTL2.EXE/SHAREABLE
2.1.1.3 Using Parallel Processing Object Modules - Please note that
the parallel processing support routines reference a global symbol
CTL$GLPSTFLAGS, which is defined in the system symbol table
(SYS$SYSTEM:SYS.STB). If you prefer to include the parallel
processing run-time object modules (included in
SYS$LIBRARY:STARLET.OLB) in your image, you need to include the system
symbol table as input in your linking operation.
Page 5
2.2 Function-Inlining Optimization
In V3.0 of VAX C, the compiler automatically attempts to inline the
code of a function body at the locations from which the function is
called, eliminating the overhead of a call instruction. This
optimization is only attempted for functions defined in the module.
Not all functions are automatically inlined. The compiler estimates
the code size and amount of CPU time that the function consumes, and
uses these heuristics to select candidates for automatic inlining.
Functions will not be automatically inlined if the compiler judges
that performance would not be significantly improved. However, you
are able to override the compiler's decision on any individual
eligible function by specifying the function in a pragma:
#pragma [no]inline (function_name [,function_name...])
The [no]inline pragma must appear before the definitions of the
functions named. However, the definition of a function need not
precede its calls for the function to be inlined.
Some functions cannot be inlined at all. Functions that take the
address of their parameters, functions that call LIB$ESTABLISH or
VAXC$ESTABLISH, or functions that use varargs or stdarg are not
inlined by the compiler. If the compiler is unable to inline a
function that you have suggested be inlined (with #pragma inline),
informational messages are generated.
You can also specify that no function inlining be performed by using
the qualifier /OPTIMIZE=NOINLINE on the command line.
/OPTIMIZE=INLINE is the default.
2.3 Access To Specialized VAX Instructions
In V3.0 of VAX C, access to some VAX instructions is possible directly
from C code. In particular, access to the following instructions is
provided:
o ADAWI
o BBCCI
o BBSSI
o FFC
o FFS
o HALT
Page 6
o INSQHI
o INSQTI
o INSQUE
o LDPCTX
o LOCC
o MFPR
o MOVC3
o MOVC5
o MOVPSL
o MTPR
o PROBER
o PROBEW
o REMQHI
o REMQTI
o REMQUE
o SCANC
o SKPC
o SPANC
o SVPCTX
These instructions are accessed through a function call syntax. A new
pragma has been added to V3.0 of VAX C to allow you to selectively
enable or disable compiler recognition of these instruction functions.
The syntax of the new pragma is:
#pragma [no]builtins
The default setting is #pragma nobuiltins. See the Guide to VAX C for
information on how to access these builtin functions.
2.4 Separate Prepreprocessor Output
Page 7
A new qualifier has been added in V3.0 of VAX C:
/[NO]PREPROCESS_ONLY[=filename]. The default value is
/NOPREPROCESS_ONLY.
When this qualifier is turned on, the compiler writes the final
version of preprocessed source text to a file. If the file name is
not specified, it defaults to the name of the source file, with a
default file name extension of .I.
When /PREPROCESS_ONLY is specified, the parsing, semantic, code
generation, and optimization phases of the compiler are completely
bypassed. No listing, object, .ANA, or .DIA files are produced.
Non-C files can be passed through the C compiler for preprocessing
when this qualifier is used; however, this is of limited usefulness
since #line directives are placed in the output.
2.5 Direct Calls To MTH$SIN, MTH$COS, And MTH$TANH
In V3.0 of VAX C, calls made to sin, cos, and tanh are recognized by
the compiler and transformed into direct calls to MTH$SIN, MTH$COS,
and MTH$TANH. This only occurs if math.h is included in the file
being compiled.
2.6 Minor ANSI C Extensions
In V3.0 of VAX C, floating point constants can take the following
suffixes, as allowed by the draft ANSI C standard:
o Lower case "l"
o Upper case "L"
o Lower case "f"
o Upper case "F"
If the constant has the suffix "l" or "L", then it has type double.
If the constant has the suffix "f" or "F", then it has type float.
Unsuffixed floating point constants continue to be interpreted as
having type double.
If an integer constant has the upper case "U" or lower case "u"
suffix, it is an unsigned constant. The "U" or "u" suffix can be used
in conjunction with the "l" or "L" suffix to create constants of type
unsigned long.
Also, the draft ANSI C standard has effectively extended the function
call operator by allowing it to operate on expressions of type pointer
to function. This has been implemented in V3.0 of VAX C. Thus, if p
Page 8
is a pointer to a function, the following expressions are equivalent:
(*p)()
and
p()
These expressions are calls to the function pointed at by p.
2.7 Longer Variable Names
VAX C variable names are now allowed to be up to 255 characters long.
The VMS linker still accepts only 31 characters for external names, so
the compiler truncates extern variable names to 31 characters in the
object file. Also, the compiler generates a warning if two different
names from the same module truncate to the same 31-character name.
2.8 No /STANDARD=PORTABLE Messages Against Include Files
In V3.0 of VAX C, a new pragma has been implemented which allows you
to selectively turn off the /STANDARD=PORTABLE qualifier for sections
of your code.
The syntax for this new qualifier is:
#pragma [no]standard
If #pragma nostandard is specified, it turns off /STANDARD=PORTABLE
checking; this pragma has no effect if /STANDARD=PORTABLE has not been
specified on the command line. If #pragma standard is specified, it
allows the previous setting of /STANDARD=PORTABLE to be in effect.
These pragmas can be nested; if two nostandard pragmas are specified
in a row, two standard pragmas are required to restore portability
checking.
A combination of nostandard and standard pragmas have been inserted
into VAX C-provided include files, so that these include files no
longer generate messages when they are used in a compilation where
/STANDARD=PORTABLE is specified.
2.9 Include File Changes
The following list summarizes changes made to other VAX C provided
include files since V2.4 of VAX C.
Page 9
1. Updated VMS interface include files
The following files were updated to VMS V5.0:
ACCDEF.H ATRDEF.H DCDEF.H DEVDEF.H
DVIDEF.H FIBDEF.H IODEF.H JPIDEF.H
LCKDEF.H LIBDEF.H LKIDEF.H LNMDEF.H
MNTDEF.H MSGDEF.H OPCDEF.H PQLDEF.H
PRCDEF.H PRDEF.H PRVDEF.H PSLDEF.H
RMSDEF.H SECDEF.H SFDEF.H SHRDEF.H
SMGDEF.H SMGMSG.H SSDEF.H STSDEF.H
SYIDEF.H TT2DEF.H TTDEF.H XWDEF.H
A few of the above files changed to a degree that programs
that use those files may need to be modified:
o ACCDEF.H -- change in structure layout, bit mask macros
became bit field members of structs
o PRDEF.H -- bit mask macros became bit field members of
structs
o PRVDEF.H -- bit mask macros became bit field members of
structs
o PSLDEF.H -- bit mask macros became bit field members of
structs
o SECDEF.H -- bit mask macros became bit field members of
structs
o SMGDEF.H -- some changes in struct tags of nested structs
As the above list shows, the most common change was that bit
mask macros became bit field members of structs. Previously,
bit field members of data structures were specified using
macros that defined masks for accessing the bits. The
programmer was responsible for using the masks in conjunction
with logical AND, OR, NOT, and shift operations to manipulate
the target bits. The header files have been changed to use
bitfield members of structs to accomplish the same task.
This allows simple assignment statements to be used to set or
clear bits. For example:
#include prvdef
union prvdef privs;
set()
{
privs.prv$vcmkrnl = 1;
}
Page 10
2. New VMS interface include files
The following are new VMS include files:
ACEDEF.H ACLDEF.H ACRDEF.H ARGDEF.H
ARMDEF.H BASDEF.H BRKDEF.H CHKPNTDEF.H
CHPDEF.H CLIDEF.H CLISERVDEF.H CLIVERBDEF.H
CLSDEF.H COBDEF.H CQUALDEF.H CRDEF.H
CREDEF.H CRFDEF.H CRFMSG.H DIBDEF.H
DMPDEF.H DMTDEF.H DSTDEF.H DTK$ROUTINES.H
DTKDEF.H DTKMSG.H ENVDEF.H EOMDEF.H
EOMWDEF.H EPMDEF.H EPMMDEF.H EPMVDEF.H
EPMWDEF.H ERADEF.H FALDEF.H FDLDEF.H
FIDDEF.H FMLDEF.H FORDEF.H FSCNDEF.H
GPSDEF.H GSDEF.H GSYDEF.H HLPDEF.H
IACDEF.H IDCDEF.H JBCMSGDEF.H KGBDEF.H
LADEF.H LATDEF.H LBRCTLTBL.H LBRDEF.H
LEPMDEF.H LHIDEF.H LIB$ROUTINES.H LIBCLIDEF.H
LIBDCFDEF.H LIBDTDEF.H LIBVMDEF.H LMFDEF.H
LNKDEF.H LPDEF.H LPRODEF.H LSDFDEF.H
LSRFDEF.H LSYDEF.H MAILDEF.H MHDDEF.H
MHDEF.H MT2DEF.H MTADEF.H MTDEF.H
MTHDEF.H NCS$ROUTINES.H NCSDEF.H NSARECDEF.H
OBJRECDEF.H OPDEF.H OPRDEF.H OTS$ROUTINES.H
OTSDEF.H PCCDEF.H PLVDEF.H PPL$DEF.H
PPL$ROUTINES.H PPLDEF.H PRODEF.H PROMDEF.H
PROVDEF.H PROWDEF.H PRTDEF.H PSMMSGDEF.H
PSWDEF.H QUIDEF.H RMEDEF.H SBKDEF.H
SCRDEF.H SDFDEF.H SDFMDEF.H SDFVDEF.H
SDFWDEF.H SGPSDEF.H SJCDEF.H SMG$ROUTINES.H
SMGTRMPTR.H SMRDEF.H SOR$ROUTINES.H SORDEF.H
SRFDEF.H SRMDEF.H STARLET.H STR$ROUTINES.H
STRDEF.H TIRDEF.H TPADEF.H TRMDEF.H
UAIDEF.H UICDEF.H USGDEF.H USRIDEF.H
3. assert.h -- The assert macro now calls abort if the assertion
fails.
4. ctype.h -- Declarations for toupper and tolower have been
added.
5. descrip.h -- Descriptor declarations have been updated to
conform to the most recent revision of the VAX Procedure
Calling and Condition Handling Standard: two new descriptor
classes have been added, and there are minor changes to
fields in array descriptors. The file has also been modified
to allow inclusion more than once without causing warnings.
6. float.h -- The values defined in float.h have been upgraded,
and are now correct when /G_FLOAT is used on the compilation.
7. iodef.h -- Has been updated for VMS V5.0.
Page 11
8. limits.h -- The minimum values have been adjusted.
9. math.h
o The definitions of div_t and ldiv_t have been deleted;
these are now only in stdlib.h.
o The name of the HUGE macro definition has been changed to
HUGE_VAL to match the draft ANSI standard.
o All functions except frexp and modf are named in
safe_call pragmas. This informs the compiler that calls
to these functions should not inhibit parallel
decomposition of loops.
10. prdef.h -- New processor numbers have been added.
11. setjmp.h -- The file has been modified to allow setjmp.h to
be included more than once without causing warnings.
12. stddef.h -- size_t and ptrdiff_t are now typedefs.
13. stdio.h
o fpos_t and size_t are now typedefs.
o SEEK_END is now defined.
o The remove function is now declared in this file.
o The include file stdarg is now included.
o The redundant declaration of _IONBF has been removed.
o NULL is now correctly defined as (void *) 0.
o Values have been defined for FOPEN_MAX and FILENAME_MAX.
o The function perror is now declared.
o The declarations of vfprintf, vprintf, and vsprintf have
been modified to use va_list.
14. stdlib.h
o The declarations of the div_t and ldiv_t have been
corrected.
o The file has been modified to allow stdlib.h to be
included more than once without causing warning messages.
Page 12
o The definitions of ERANGE and HUGE_VAL have been removed;
ERANGE is defined in errno.h and HUGE_VAL is defined in
math.h.
o Definitions have been added for EXIT_FAILURE and
EXIT_SUCCESS.
o Additional prototype arguments have been added to the
declarations of bsearch and qsort.
o Definitions have been added to cause different versions
of free, cfree, realloc, malloc, and calloc to be called
when /PARALLEL is specified.
o The return types of free and cfree have been changed to
void to conform to the draft ANSI standard. The C RTL
functions will continue to return an int value for
existing programs which depend on it; however, programs
which use the return value will get compiler errors if
recompiled.
15. time.h
o The CLK_TCK macro has been added.
o The declaration of mktime has been corrected.
16. unixio.h
o The declarations of stat and fstat are now int functions,
instead of void.
o The declaration of the remove function has been moved to
stdio.h.
o The definition of size_t has been removed.
17. unixlib.h -- This is a new include file that declares
prototypes for various unix emulation functions.
3 BUG FIXES
VAX C V3.0 contains several bug fixes and SPR fixes. Details of
changes made as a result of SPRs since V2.4 of VAX C can be found in
the file SYS$LIBRARY:VAXCSPR.DAT.
Previously, if _align was used in a declaration, and there were other
variables declared in the function which were the same type, but did
Page 13
not have the _align modifier, the VAX C compiler might treat these
variables as if the _align modifier was there. This is corrected in
V3.0 of VAX C.
Automatic variables with the const specifier can now be initialized.
4 DOCUMENTATION ERRATA
This section contains information on errors and missing information
from the manuals.
4.1 Guide To VAX C.
In section 11.2.14, the description of the "unmoved_src" operand of
the _MOVC5 builtin says that it "Is a pointer to a short integer..."
The description should say that it "Is a pointer to an unsigned short
integer..." The function prototypes at the start of the _MOVC5
section do show the correct type for this argument. Because of a last
minute bug in the compiler, the unmoved_src argument is no longer
optional. A future version of the compiler will make this argument
optional again.
In Appendix B, the text of the UNSUPPORTOP informational message is
wrong. The correct text is:
Variable "***" has post/pre increment/decrement operator, which
inhibited decomposition at loop control variable "***".
4.2 VAX C Run-time Library Reference Manual.
On the reference page for VAXC$ESTABLISH, the format should read:
void VAXC$ESTABLISH (int (*exception_handler)( void *sigarr,
void *mecharr));
On the reference pages for brk,chdir, chmod, chown, ctermid, cuserid,
mkdir, nice, sbrk, and umask, under format, the line
#include stdlib
should be removed.
On the reference pages for fstat and stat, under format, the lines
Page 14
#include stat
#include statbuf
should be changed to:
#include unixio
#include stat
On the reference pages for rand and srand, under format, the line
#include math
should be changed to:
#include stdlib
5 RESTRICTIONS AND KNOWN BUGS
The following are the known bugs in this update of T3.0:
o When executing a parallel processing application multiple
times in succession, there should be a delay between the
executions. This is needed to allow VMS to complete the
unmapping of any global sections used by an application. The
unmapping is not completed when the image is executed. If
there is not enough time between exectuions of parallel
applications, there may not be enough global resources,
global pages, and/or global sections available to properly
execute additional invocations of parallel applications.
o Images using the VAX C parallel processing support cannot run
from a detached process where there is no CLI.
o There is a known interaction problem between the VAX C
parallel processing support, routines compiled with
/PARALLEL, and the run-time library PPL$ routines. The
result of this problem is that the VAX C parallel processing
application completes, but the subprocesses that are created
during its execution are not properly deleted and are left in
a spin loop, using up CPU time. These subprocesses must be
stopped by the user. The easiest way to stop them is to
either log out of the account that executed the parallel
application or explicitly stop them.
o PPL$INITIALIZE cannot be called from within a C decomposed
program. When the C main program is compiled with /PARALLEL
the routine PPL$INITIALIZE is automatically called to set up
the parallel processing environment for the parallel memory
allocation routines.
Page 15
o There is a known problem where the compiler will sometimes
bugcheck during code-generation while processing an inlined
function call. This is a extremely rare occurrence, and can
be worked around by either specifying the function in a
noinline pragma, or by compiling with the qualifier
/OPT=NOINLINE.
o Because of a last minute bug in the optimizer, the sixth
argument to the _MOVC5 builtin is no longer optional. You
must call _MOVC5 with at least six arguments. If you pass
only five arguments, the compiler will issue an ARGSTOOFEW
error message stating 'Argument list for builtin function
"_MOVC5" contains too few arguments; the builtin function is
being ignored.'
Please note that the type of the sixth argument is pointer to
unsigned short. The "Guide to VAX C" erroneously states that
the type is pointer to short.
A future version of the compiler will make the sixth argument
to _MOVC5 optional again.