Domain C Compiler Software Release Document
Software Release 10.1
Part No. 005500-B04
This document describes all changes made to the Domain C Compiler
between SR10 and SR10.1. It lists all bugs fixed during this time, as
well as known bugs that are still current.
Use, duplication, or disclosure by the Government is subject to restrictions
as set forth in subparagraph (c) (1) (ii) of the Rights in Technical Data
and Computer Software clause at DFARS 52.227-7013.
Apollo Computer Inc.
330 Billerica Road
Chelmsford, MA 01824
(508) 256-6600
Notice: Notwithstanding any other lease or license agreement that may
pertain to, or accompany the delivery of, this computer software, the rights
of the Government regarding its use, reproduction and disclosure are as set
forth in Section 52.227-19 of the FARS Computer Software - Restricted Rights
clause.
Confidential and Proprietary. Copyright 1988 Apollo Computer, Inc.,
Chelmsford, Massachusetts. Unpublished -- all rights reserved under the
Copyright Laws of the United States.
This notice shall be marked on any reproduction of these data, in whole or
in part.
Confidential and Proprietary. Copyright 1988
Apollo Computer, Inc., Chelmsford, Massachusetts.
Unpublished -- rights reserved under the Copyright
Laws of the United States. All Rights Reserved.
First Printing: August, 1988
Latest Printing: November, 1988
This document was formatted using the FMT tool distributed with the Domain
computer system.
Apollo and Domain are registered trademarks of Apollo Computer Inc.
UNIX is a registered trademark of AT&T in the USA and other countries.
3DGMR, Aegis, D3M, DGR, Domain/Access, Domain/Ada, Domain/Bridge, Domain/C,
Domain/ComController, Domain/CommonLISP, Domain/CORE, Domain/Debug,
Domain/DFL, Domain/Dialogue, Domain/DQC, Domain/IX, Domain/Laser-26,
Domain/LISP, Domain/PAK, Domain/PCC, Domain/PCI, Domain/SNA, Domain X.25,
DPSS, DPSS/Mail, DSEE, FPX, GMR, GPR, GSR, NLS, Network Computing Kernel,
Network Computing System, Network License Server, Open Dialogue, Open
Network Toolkit, Open System Toolkit, Personal Supercomputer, Personal Super
Workstation, Personal Workstation, Series 3000, Series 4000, Series 10000,
and VCD-8 are trademarks of Apollo Computer Inc.
Apollo Computer Inc. reserves the right to make changes in specifications
and other information contained in this publication without prior notice,
and the reader should in all cases consult Apollo Computer Inc. to determine
whether any such changes have been made.
THE TERMS AND CONDITIONS GOVERNING THE SALE OF APOLLO COMPUTER INC. HARDWARE
PRODUCTS AND THE LICENSING OF APOLLO COMPUTER INC. SOFTWARE PROGRAMS CONSIST
SOLELY OF THOSE SET FORTH IN THE WRITTEN CONTRACTS BETWEEN APOLLO COMPUTER
INC. AND ITS CUSTOMERS. NO REPRESENTATION OR OTHER AFFIRMATION OF FACT
CONTAINED IN THIS PUBLICATION, INCLUDING BUT NOT LIMITED TO STATEMENTS
REGARDING CAPACITY, RESPONSE-TIME PERFORMANCE, SUITABILITY FOR USE OR
PERFORMANCE OF PRODUCTS DESCRIBED HEREIN SHALL BE DEEMED TO BE A WARRANTY BY
APOLLO COMPUTER INC. FOR ANY PURPOSE, OR GIVE RISE TO ANY LIABILITY BY APOLLO
COMPUTER INC. WHATSOEVER.
IN NO EVENT SHALL APOLLO COMPUTER INC. BE LIABLE FOR ANY INCIDENTAL,
INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING BUT NOT
LIMITED TO LOST PROFITS) ARISING OUT OF OR RELATING TO THIS PUBLICATION OR
THE INFORMATION CONTAINED IN IT, EVEN IF APOLLO COMPUTER INC. HAS BEEN
ADVISED, KNEW OR SHOULD HAVE KNOWN OF THE POSSIBILITY OF SUCH DAMAGES.
THE SOFTWARE PROGRAMS DESCRIBED IN THIS DOCUMENT ARE CONFIDENTIAL INFORMATION
AND PROPRIETARY PRODUCTS OF APOLLO COMPUTER INC. OR ITS LICENSORS.
Reader__Notice This document resides online in the /install/doc/apollo
directory. You may print the online copy of this document by using one of
the following commands:
If your installation uses the System V lp print daemon, use an lp command
similar to the following:
lp -dprinter_name pathname
where pathname is the pathname of the release notes.
If your installation uses the Domain print system, use the following Aegis
/com/prf command:
prf pathname -pr printer_name -npag
If your installation uses the BSD lpd print daemon, use an lpr command
similar to the following:
lpr -P printer_name pathname
The pathname of this document is:
/install/doc/apollo/cc.v.6.6.m__notes
iii
Contents
Section
CHAPTER 1 OVERVIEW OF DOMAIN C COMPILER . . . . . . . . . . . . . . . . 1-1
1.1 Strength Reduction. . . . . . . . . . . . . . . . . . . . 1-1
1.2 FPA Support . . . . . . . . . . . . . . . . . . . . . . . 1-1
1.3 Cross-Compilation for the Series 10000 Workstation . . . 1-2
1.4 The -compress and -ncompress Options . . . . . . . . . . 1-2
CHAPTER 2 INSTALLATION INFORMATION. . . . . . . . . . . . . . . . . . . 2-1
CHAPTER 3 DOCUMENTATION . . . . . . . . . . . . . . . . . . . . . . . . 3-1
3.1 The -M Option for /bin/cc . . . . . . . . . . . . . . . . 3-1
3.2 The -A Option for /bin/cc . . . . . . . . . . . . . . . . 3-1
3.3 The -cpu fpa1 and -A cpu,fpa1 Options . . . . . . . . . . 3-3
3.4 The -frnd Compiler Option . . . . . . . . . . . . . . . . 3-3
3.5 builtins.h Header File . . . . . . . . . . . . . . . . . 3-4
CHAPTER 4 BUGS AND BUG FIXES. . . . . . . . . . . . . . . . . . . . . . 4-1
4.1 Fixed Bugs . . . . . . . . . . . . . . . . . . . . . . . 4-1
4.2 Known Bugs . . . . . . . . . . . . . . . . . . . . . . . 4-2
Contents iv
CHAPTER 1
OVERVIEW OF DOMAIN C COMPILER
Version 6.6.m of the Domain C compiler, released with SR10.1, includes some
minor enhancements and changes. These release notes describe only features
made since SR10. For information about features and changes added between
SR9.7 and SR10 see the SR10 Domain C Compiler Software Release Notes
(/install/doc/apollo/cc.v.6.6.m__notes_sr10). For more information about the
Domain C compiler, consult the Domain__C__Language___Reference (order no.
002093). If you are installing the cross-compiler for generating code to run
on a Series 10000 Workstation, read the release notes for version 6.5.mpx of
the C compiler
(/install/doc/apollo/cc.v.6.5.mpx__notes).
NOTE: The version of syslib.xxx released at SR10.1 contains a bug that can
cause programs to fail if they contain conversions from float or double to
unsigned integer types. To avoid this problem, you must install the most
recent version of the syslib.xxx runtime library. See Chapter 4 for more
information.
1.1 Strength Reduction
The 10.1 Domain C compiler includes some major improvements in strength
reduction. This will improve the performance degradation that was seen in
SR10.
1.2 FPA Support
The 10.1 Domain C comiler includes support for the FPA-1 board in the form of
two new compiler options:
1-1 SR10.1 Domain C Compiler
o -cpu fpa1 (/com/cc)
o -A cpu, fpa1 (/bin/cc)
For more information about this feature, please refer to Chapter 3.
1.3 Cross-Compilation for the Series 10000 Workstation
The 10.1 Compiler enables you to compile code to run on a Series 10000
workstation. To produce code that can run on a Series 10000 workstation, use
one of the following options:
o -cpu a88k (/com/cc)
o -A cpu, a88k (/bin/cc)
Note that this feature will work only if you have installed the C
cross-compiler Version 6.5.mpx. For information about installing the
cross-compiler, see the release notes in
/install/doc/apollo/cc.v.6.5.mpx__notes.
1.4 The -compress and -ncompress Options
Domain compilers can store data in the object file in either compressed or
uncompressed form. With uncompressed data, the object file contains an
exact image of the data as they will be loaded into memory. In compressed
form, the object file contains instructions to the loader that describe how
to load the data into memory.
Compressed data can save space in the object file. Consider, for example, an
array of 100 bytes all initialized to zero. Stored in uncompressed form,
this array occupies 100 bytes in the object file. In compressed form, the
array occupies only enough space for a single .rwdi instruction: load 100
bytes with value 0.
Before Version 6.6.m, Domain C compilers stored all data in uncompressed
form.
To link a module with compressed data to a module with uncompressed data, the
linker expands the compressed data. The linker's output file then contains
uncompressed data from two modules, and the .rwdi instructions from the
compressed module. The output file is even larger than it would have been if
SR10.1 Domain C Compiler 1-2
both compilers had stored the data in uncompressed form.
To avoid this problem, Domain C now allows you to specify whether the
compiler stores the data in compressed or in uncompressed form. The
-ncompress option (the defgault for Domain C) stores data in uncompressed
form; the -compress option stores all non-bss data in compressed form.
1-3 SR10.1 Domain C Compiler
CHAPTER 2
INSTALLATION INFORMATION
Domain C is now composed of three different compilers:
With Version... You can run C on a... To generate code for a...
6.6.m 680x0-based workstation 680x0-based workstation
6.5.mpx 680x0-based workstation Series 10000 workstation
6.5.p Series 10000 workstation Series 10000 workstation
Domain C Version 6.5.p runs on a Series 10000 workstation, under SR10.0.p,
and generates code for a Series 10000 workstation.
Domain C Version 6.5.mpx runs on a 680x0-based workstation, under SR10 and
more recent versions of the operating system, and generates code for a Series
10000 workstation. To cross-develop code (that is, to generate code on a
680x0-based workstation that will run on a Series 10000), install this
compiler.
Domain C Version 6.6.m runs on a 680x0-based workstation, under SR10 and more
recent versions of the operating system, and generates code for a 680x0-based
workstation.
This release includes Version 6.6.m and Version 6.5.mpx. You can install the
C Compiler Version 6.6 on a user node (one equipped with monitor and
keyboard) or a Domain Server Processor (DSP) that is running SR10.1 or a more
recent version of the Domain/OS operating system. To install the cross
compiler (version 6.5.mpx), read the release notes in file
doc/apollo/cc.v.6.5.mpx__notes.
For directions about how to install this product, see the manual Installing
Software___with___Apollo's___Release___and__Installation__Tools, (Order No.
008860-A00), as well as the hardcopy installation document that accompanied
your media. the hardcopy document is called Media_Installation_Instructions
for_Optional_Software_Products_and__Custom_Tapes, (Order No. 010854-A02).
If the user node or DSP is not running SR10.1 or a more recent version of
the Domain/OS operating system, follow the appropriate optional software
update procedures as described in Chapter 5 of Installing__Domain__Software
(Order No. 008860 Rev 02).
NOTE: The user node or DSP must have a minimum of 814 blocks of available
disk space for a successful installation of this software.
2-1 SR10.1 Domain C Compiler
CHAPTER 3
DOCUMENTATION
The 10.0 version of the Domain__C__Language__Reference (order no. 002093)
describes the Domain C language. For additional features, please refer to
the SR10 Domain C Compiler Software Release Document
(cc.v.6.6.6__notes_sr10). This chapter describes changes to the
documentation that are not in either of the two documents mentioned above.
If you are installing the cross compiler for generating code to run on the
Series 10000 workstation, you need to read the release notes for version
6.5.mpx of the the C compiler, which are in file
install/doc/apollo/cc.v.6.5.mpx__notes.
3.1 The -M option for /bin/cc
In previous versions of the C compiler, the -M option to /bin/cc was used to
identify the target machine (like -cpu for /com/cc). At SR10 and later
releases, -M is a preprocessor option that directs the compiler to run only
the macro preprocessor on the named C programs, and to generate Makefile
dependencies and send the result to the standard output. Use the new -A
option (described in the next section) to select a target machine type.
3.2 The -A Option for /bin/cc
The -A option identifies Domain/OS extensions to cc.
-A nansi Do not compile with ANSI rules. This option passes -ntype to
the compiler, and does not define the preprocessor symbol
3-1 SR10.1 Domain C Compiler
__STDC__. See the Domain C language Reference for details
about function prototypes.
-A cpu,id Generate code for a particular class of processor; the default
id is any. Values for id are as follows:
a88k DN10000 code (works only if C Version 6.5.mpx is installed)
any Standard M68000 code
160 DSP160 code
460 DSP460 code
660 660 code
90 DSP90 code
330 DN330 code
560 DN560 code
570 DN570 code
580 DN580 code
3000 DN3000 code
4000 DN4000 code
FPA1 FPA Floating-Point Accelerator Board
FPX Floating-Point Accelerator Board
PEB Performance Enhancement Board
-A sys[type],sys
Define the target system type (sys) for the compiled object;
sys may be one of the following:
any Version independent
bsd4.1 Berkeley version 4.1 (obsolete)
bsd4.2 Berkeley version 4.2
bsd4.3 Berkeley version 4.3
sys3 UNIX System III (obsolete)
sys5 UNIX System V
sys5.3 UNIX System V Release 3
This option replaces the -Tsystype option (which is supplied
for backwards compatibility).
-A run[type],sys
Like -A sys[type],sys this option passes runtype information to
the compiler and linker.
3.3 The -cpu fpa1 and -A cpu,fpa1 Options
The -cpu fpa1 option is for use with the /com/cc interface, whereas the -A
cpu, fpa1 option is for use with the /bin/cc interface. These options
direct the compiler to produce optimized code for the Floating-Point
Accelerator (FPA) board that is available with DN4000 workstations. Use of
this switch can produce substantially faster code. Do not use this switch,
however, if the target machine does not have an FPA board.
SR10.1 Domain C Compiler 3-2
3.4 The -frnd Compiler Option
The -frnd ("float rounds") compile option is available only with the /com/cc
interface to the C compiler. If you are using the /bin/cc interface, you
need to use the -W compile switch, as in:
$ /bin/cc -W0, -frnd foo.c
The -frnd option forces the compiler to write all floating-point operands to
memory and then fetch the memory contents before evaluating the expression.
This ensures that each operand will have the same amount of precision so that
floating-point comparisons will produce correct results. If you do not
compile with -frnd, floating-point operands may be kept in registers, which
support more accuracy than memory. Consequently, when a register operand is
compared with a memory operand, the result may not be what is expected. This
is particularly true of equality comparisons. Consider the following C
program:
double fetch( void )
{
return 1.1;
}
int main( void )
{
double x;
x = fetch();
if (x - 0.1 == 1.0)
printf( "Pass\n" );
else
printf( "Fail\n" );
}
If you compile with -cpu 3000 (or -M 3000 if you are using /bin/cc, and
without -frnd, this program fails because the values 0.1 and 1.1 cannot be
represented exactly in base 2 floating-point. Thus, the quantity (x - 0.1)
can only be approximated. This value is calculated in an 80-bit register,
and then a compare is generated to see if this value is exactly equal to 1.0,
which is stored in memory. Since the register has more accuracy than memory,
the comparison fails.
If you compile with -frnd, the 80-bit register is stored (and rounded) in a
3-3 SR10.1 Domain C Compiler
single-precision 32-bit temporary memory location. Now when it is compared
with 1.0, which is also stored in memory, the comparison passes.
Compiling with -frnd could mean that your program will run slower, so you
should only use -frnd when necessary.
The -frnd, -nfrnd, have no meaning if you are compiling code for a Series
10000 Workstation.
3.5 builtins.h Header File
Page 6-47 of the Domain_C_Language_Reference states that you must include
<builtins.h> to get the in-line versions of certain functions. The correct
notation for including this header file is: include <apollo/builtins.h>.
SR10.1 Domain C Compiler 3-4
CHAPTER 4
BUGS AND BUG FIXES
This chapter describes known bugs and bugs that were fixed since the last
release of the compiler (SR10).
The SR10.1 C compiler generates certain runtime calls that are not available
in SR10 versions of the syslib runtime libraries. In particular, programs
that require conversions from "float" or "double" to unsigned integer types
will not run correctly unless the workstation on which the program is
executing has an SR10.1 version of syslib.xxx installed. Note that different
machine types require different versions of the syslib library:
Machine Type Name of syslib Library
------------ ----------------------
DN300 syslib
DN320 syslib.peb
DN460, DN660 syslib.460
DN570, DN580, DN590, DN3000,
DN3500, DN4000, DN4500 syslib.881
If you are compiling programs to run on a workstation with an FPA board,
there is an additional problem. In this case, even the SR10.1 version of
syslib.881 is missing two routines that make the floating-point to unsigned
integer conversions. When you run programs compiled with "-cpu fpa1",
therefore, you need a special version of syslib.881. The SR10.1 release of
the compiler includes this special syslib.881 version so it is automatically
installed when you install Version 6.6.m of the C compiler. For workstations
that do not have the C compiler Version 6.6.m installed, you should ask your
Customer Service Representative for the January patch tape which includes
the corrected version of syslib.881.
To find out if a workstation has the proper version of syslib.881, execute
the following command:
$ /usr/apollo/bin/ts /lib/syslib.881
The system will display the timestamp of the library. For example:
4-1 SR10.1 Domain C Compiler
Ver Name Time Stamp File Name
--------------------------------------------------------------
c 1 syslib_881 1988/11/11 8:46:17 EST (Fri) /lib/syslib.881
If your syslib.881 has the timestamp shown above, or a more recent timestamp,
then it is OK. If it has older timestamp, contact your Customer Service
Representative.
Note that the RAI installation procedure for the C compiler version 6.6.m
automatically replaces the syslib.881 library on the target node with the
updated version. If you plan to run programs on nodes that do not have the
new C compiler installed, you should manually copy the revised syslib.881 to
these nodes. To copy syslib.881 to a node, you need to first rename the
existing syslib.881 file on the target node, then copy the new one, and then
re-boot the node to install the new version. For example:
$ chn //target_node/lib/syslib.881 old_syslib.881
$ cpf //source_node/lib/syslib.881 //target_node/lib
Reboot target node
4.1 Fixed Bugs
The APRs (Apollo Product Reports) with the following numbers have been fixed:
o 0D886696
Prior to SR10, the stack size was limited to 256K bytes. In SR10 and
later releases, you can specify an unlimited stack size.
o 0D884425
If any source line in a C program was greater than 1024 characters
long, the Domain C compiler gave a warning message of "supplied
buffer too small (stream manager/ios)" and did not complete the
compilation. In SR10 and later releases, this line restriction was
removed.
o 0D884446
Prior to SR10, if a filename containing uppercase letters was given
in the line directive within a C source file, and the source file
was compiled using the /sys5/bin/cc compiler, the user was unable to
view the source file while debugging the object code (using the debug
option -src). The debugger was unable to display the filename given
in the line directive and returned the following message: "source
unavailable". This problem with uppercase filenames was fixed in
SR10.
SR10.1 Domain C Compiler 4-2
o 0D884854
Compiler generated labels were not being marked correctly for the
code generator. This was fixed in SR10.
o 0D885804
Functional prototypes were implemented at SR10, thus allowing
argument declarations to be specified in the include files.
The following bugs do not have APR numbers but were also fixed.
o In previous releases, the compiler produced erroneous code for
assignments of "float" or "double" values greater than 2^31 - 1 to
"unsigned long" integers. The code produced by the compiler caused
a floating-point fault to occur at runtime. This bug no longer
exists.
o Prior to this release, calling a function through a pointer to a
function prototype did not convert the constant arguments to the
correct size. This bug has been fixed.
4.2 Known Bugs
The following APR (Apollo Product Report) has not yet been fixed:
o 0D886301
Compiler error messages can only hold 4 digits in the source line
number output. For example, errors on source line 10004 are reported
as being on line 0004.
The following bugs are known:
o Bad code is generated for copying to a structure returned by a
function. When using code of the form
*f() = s;
where s is a structure greater than 8 bytes, and f returns a pointer
to a structure, nothing is assigned.
o There is a compiler bug in evaluating function types in ternary
expressions ( ? :). The following shows the behavior. test_it with
4-3 SR10.1 Domain C Compiler
no parameters should call copywR(); test_it with any parameters
should call copyw(). It always calls copyw(). This causes a bug in
ex/vi.
% cat test_it.c
include <stdio.h>
copywR()
{
printf("copywR\n");
}
copyw()
{
printf("copyw\n");
}
main(ac, av)
int ac;
char **av;
{
(*(ac > 1 ? copywR : copyw))();
}
% cc -o test_it test_it.c
% ./test_it
copyw
% ./test_it 1
copyw
o There is a problem with precedence of operators. The precedence of
++ and casting are the same and they work from right to left.
However, the following program does not compile the casting after
'++'; the compiler takes it as being an expression.
main ()
{
unsigned char *pt;
short this;
this = *++(short *)pt;
}
This generates the following errors:
error 116 improper expression; "short" found
error 116 improper expression; ")" found.
o The -esf option suppresses the -info option. Using both options
generates a message that there are informational messages, but it
does not display those messages.
SR10.1 Domain C Compiler 4-4
4-5 SR10.1 Domain C Compiler