[comp.os.minix] 68000 and 386 C compiler Patch1: Notes

HBO043%DJUKFA11.BITNET@cunyvm.cuny.edu (Christoph van Wuellen) (03/01/91)

Here is patch1 for c68/c386 Version III.

It consists of several parts:

=>patch1a.uue:
=>patch1b.uue:
=>patch1c.uue:
patches to the compiler files (*.c, *.h)

=>lib68k.uue:
Support library for ACK assembler (MINIX-68K)

=>libgas68.uue:
Support library for 68K GAS assembler

=>lib386.uue:
Support library (actually, one file, supp387.s) for the 386 compiler.
The 386 needs very few support functions since it can do 32-bit multiply
and divide.
The floating point support functions use the 387, they are just models
for what FP support functions should do. In addition, these functions are
defined in comments in file gen386.c
Calls to these functions are generated if c386 is invoked with the
-Qnofpu option. Very few functions (those that affect rounding modes etc.)	are c

=>makefile.uue:
Sorry, no updates for the makefiles.
I know that there was a typo in one of the makefiles, but I have
different versions of the Makefile here on the Workstation and on my
MINIX box. I include my Makefile for the Sun for your convenience as
makefile.uue
It allows me to type
'make ack' ==> makes the 68K version of c68/c386 for the ACK assembler
'make gas' ==> makes the 68K version of c68/c386 for the GAS assembler
'make 386' ==> makes the 386 version of c68/c386 for the Sun assembler

to get a 386 compiler for the GAS assembler, delete the
-DSUN_ASM_SYNTAX form the Makefile. Perhaps I should use cppmake etc.

=========> here is a verbatim copy of the ChangeLog:


Jan 7, 1991:
c68/c386 Version III
====================

changes:

- Full support for double data type in the front end
- enum type abandoned (are ints now)

- support for alloca in 68k and 386 code generators:
  saved registers are restored via references to the frame pointer, not
  the stack pointer

- bug fixes

If compiled with -DNOFLOAT, the compiler does not use floating-point
stuff and cannot generate floating-point constants.
(At least, no floating point code is generated. Floating point declarations
are not bracketed)

Patchlevel 1:
=============

Jan 9,1991: (problems reported by NETlanders)
Excessive popping of the floating point stack now fixed.
reference to save_mask in a target-independent part of genstmt removed.

The FP-stack pop-off in gen386.c was not correct -- lead to
additional fstp %st(0) instructions. --- fixed.

Jan 10,1991:
improved constant optimizations,
e.g. (1.0 > 2.0) is a legal constant integer expression.
optimize.c has changes so dramatically that is will be included as
as whole in the next patch.

Jan 16,1991:
changed all long constants like (long)65535 to 65535l since someone
complained (long)65535 would yield -1l with his compiler

Jan 17,1991:
added \a and \v in getsym.c, getsch()
removed the support function from the user's namespace
support functions now begin with a dot. This dot suppresses a translation
which may take place in outlate()

Jan 18,1991:
nofpu stuff redesigned, module which implements the support functions
on the 80387 hardware stack coded and tested.
Argument passing to support functions now via %ecx (not via the stack)
if possible. This is not possible for the 68000 compiler since there
is no free register.

rounded up .lcomm and .comm storage requests to a multiple of AL_DEFAULT
since someone told me that the 'by hand'-alignment will not work with all
assemblers. This only affects out68k_gas.c and out68k_sun.c

Renamed out386_sun.c into out386_gas.c since there was so much confusion.
Added some #ifdef SUN_ASM_SYNTAX to overcome the differences between
Sun and GAS syntax.

Wrote a file compiler.doc which tells what c68/c386 is.

Jan 23, 1991:
options can be given to in the form -Qoption, e.g. -Qshort or -Qnoshort.
This may make setting up a cc easier since cc now knows immedeately
which option to pass to c68/c386.

Jan 24, 1991:
added bt_void to function alignment() in decl.c:
there was a bug report that
   typdef void t;
wont work.

Jan 30, 1991:
peep_tst in peep68k.c:
There was a bug that lead to a nil pointer reference (the second operand
to a clr instruction was referenced)

Feb 1, 1991:
allowed an expression like
   i ? void_function() : 0; (expr.c, gen68k.c, gen386.c)

or x = i ? y : z; where x,y,z are structures. (gen68k.c)

It was necessary to do the strip-off on structures (which makes the expr.
gen. routines return a pointer to the structure, rather than the struc.
itself) in g_deref(). This code used to reside in g_assign, but when
structs may appear with in ? :, then there is another case.

Casts of constants to 'void' are now possible.

In gen386.c, this was already handled more carefully.

---

some changes to make the compiler error-robust, e.g. no code generation
is attempted if the parser has discovered syntax errors for this function
If c68/c386 gets a signal on ANY input, report it to me.
The compiler should not dump core even on plain english text or FORTRAN
programs

---

Feb 8, 1991:
Fixed the calculation of act_line which always was 1 too high.

Feb 13, 1991:
Added missigng validate-call in gen386.c, g_lsh()/g_rsh()/g_aslsh()/g_asrsh()

Feb 20, 1991:
Made MAX_PARAM a symbolic constant in c.h. It is used in decl.c; this
is the maximum number of parameters a function may have.

Feb 28, 1991:
Fixed genswitch in genstmt.c: use sign-extension to 32 bits for signed types

Mar 1, 1991:

========> This version is my internal (SCCS-)Version 3.5 and this version
========> is submitted to the net as c68 VIII, patchlevel 1

----------------------

If you miss a bug that you reported in the above list, check if c68/c386
still has this bug (I might have forgotten to note this in the list).
If the bug is still there, the bug report may have been lost in my
personal chaos. Do not hesitate to report it once more....

C.v.W.,
Christoph van Wuellen
HBO043@DJUKFA11.bitnet