Re: Need a C compiler for a new processor.

Michael Meissner <meissner@cygnus.com>
18 Oct 1999 00:26:54 -0400

          From comp.compilers

Related articles
Need a C compiler for a new processor. gcome@cyberus.ca (Guillaume Comeau) (1999-10-16)
Re: Need a C compiler for a new processor. tej@melbpc.org.au (Tim Josling) (1999-10-17)
Re: Need a C compiler for a new processor. guerby@acm.org (Laurent Guerby) (1999-10-18)
Re: Need a C compiler for a new processor. meissner@cygnus.com (Michael Meissner) (1999-10-18)
Re: Need a C compiler for a new processor. C.vanReeuwijk@twi.tudelft.nl (Kees van Reeuwijk) (1999-10-18)
Re: Need a C compiler for a new processor. rpgurd@archelon.com (Preston Gurd) (1999-10-21)
Re: Need a C compiler for a new processor. mah@colorado.edu (Haibing Ma) (1999-10-27)
Re: Need a C compiler for a new processor. gaul@ipd.info.uni-karlsruhe.de (Thilo Gaul) (1999-11-09)
Re: Need a C compiler for a new processor. shirleyl@hway.net (Shirley L Coffie) (1999-11-16)
Re: Need a C compiler for a new processor. markg@kepler.emi.net (Mark Grosberg) (1999-11-18)
| List of all articles for this month |

From: Michael Meissner <meissner@cygnus.com>
Newsgroups: comp.compilers
Date: 18 Oct 1999 00:26:54 -0400
Organization: Cygnus Solutions
References: 99-10-080
Keywords: C, GCC

"Guillaume Comeau" <gcome@cyberus.ca> writes:


> 1. I am in charge of writing a C compiler for a new 32-bit
> processor. The processor itself is new, it uses an instruction set
> different than any other processor.


It depends on how different the processor is from other processors.
The more different it is from existing targets, the harder the work
will probably be (this should be true of any retargetable compiler).


> 2. I must support C, and there is no need for any library or
> extension. All it must do is compile straight ANSI-C code.


I find in the embedded world that C only targets, tend to come back in
N months asking for C++ or more recently Java. Of course if you have
a captive audience that is just working on one program and you will
never ever have the chip be used for anything else that is probably a
different matter.


> 3. I am looking for the shortest path solution. I was told a compiler
> was a two man-year job, which is too long for my taste. I'd rather use
> an existing C front-end and map the result into my instruction set if
> at all possible.


Doing a GCC port should be considerably less time than 2 calendar
years. Obviously, there is a long start up time if you aren't already
a core GCC engineer. Assuming the processor has no surprises and you
are working on it full time, I would imagine a 3-6 month time frame
should be adequate to be producing initial code, if you are coming
into it cold. Add 1-2 months if you need to port an assembler and
linker as well (this can be done by another person). Of course there
is a lot of refinement in the machine description that can take months
and years afterwards.


> 4. There are lots of sites and posts pointing to GNU, which could be a
> good start. However, it supports C++ which will complicate my work. I
> also didn't find the processor-specific files (but I still have some
> more digging to do).


The machine/os specific files are in:


gcc/config/<machine>


> [It's probably easier to retarget lcc. It's a smaller compiler, and it
> has a nice book to document it. See the FAQ. -John]


Probably.


--
Michael Meissner, Cygnus Solutions
PMB 198, 174 Littleton Road #3, Westford, Massachusetts 01886
email: meissner@cygnus.com phone: 978-486-9304 fax: 978-692-4482


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.