[Coco] [Color Computer] Multiple C compiler projects

James Jones jamesjones01 at mchsi.com
Sun Jul 17 22:05:09 EDT 2005


John R. Hogerhuis wrote:
> I think it would make sense to focus effort on one compiler. It seemed
> like we had concensus to focus on the sdcc port, abandoning the old gcc
> 6809 port as it needed too much work and GCC is targeted at beefier
> CPUs.
> 
> Within the last week it seems we have two new initiatives (Boisy got C
> code for a 6809 C compiler, but I don't understand the license terms at
> all) and now a GCC 4.0 port.
> 
> Of course whatever would get us a C compiler first is where we should
> focus. But before you get too far with GCC 4.0 you should take a look at
> sdcc.

I'd say that it would be nice to still have a compiler that could 
actually run on the CoCo itself (or an emulated CoCo). GCC 4.0 is a fine 
thing--especially since they've moved to SSA (static single assignment) 
form internally--but I seriously doubt that it will be possible to make 
it run on a 6809.

People working on compilers targeting OS-9/6809 (or NitrOS9) might want 
to keep in mind taking full advantage of C type qualifiers. Currently,

int a[] = {1, 2, 3, 4, 5};

in a way has to appear twice in the address space of the process running 
the program it appears in: once in the process's data area , and once in 
code as the initialized data that is copied to the array in the data 
area. (It also chews up time for the copying.)

OTOH, a compiler can realize that

const int a[] = {1, 2, 3, 4, 5};

can be placed in the code area and accessed with a PC-relative 
reference. It's only there once, and is initialized when the module is 
loaded rather than when the process is spawned or as part of cstart.

WARNING! Because of the way OS-9 works, you CANNOT do this with 
pointers, and hence by induction any data that (transitive closure of 
contain)s a pointer. Initialized data that contains pointers has to be 
adjusted either by where the module is, if it points at something in the 
module, or by where the process's data area starts, if it points at 
something in the process's data. You can't do that to data in the 
program module itself.

	James Jones



More information about the Coco mailing list