This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: GCC source code


Ahsan Kamal wrote:

> I am a CS doing my final year project realted to a C compiler 
> for a parallel processor.

That's a popular subject recently :-)

> The major portion of the project includes code optimization. Due to
> limited time I was hoping to use a front-end for my compiler. Is
> there any way to use GCC as the front-end, if there is then how can
> I extract the front end from the whole compiler.

You probably don't want to do that.

The GCC front ends currently generate an intermediary representation of
the code called 'RTL'. Rather than invent your own, it's probably easier
to work with this and just replace or augment the optimisation passes of
the compiler. You'll also need a code generation phase; GCC contains a
generic code generation backend customised by the code and by the .md
(machine description) files in the gcc/config subdirectories where you
can configure/enhance the compiler to support your specific case.

Probably the best thing to do, though, if you'd like to separate out the
compiler passes, is to read gcc/toplev.c

> And lastly, can I get the source code for GNU C Compiler.

Yes, from any GNU mirror in the 'gcc' directory. You can follow links
from http://gcc.gnu.org/.

If you'd like to develop against the most-recent-stable version of GCC
then look for 'download/releases'. If you'd like to work with the
development version, look for 'development/CVS read access'. If you're
planning to contribute any improvements you make in your project back to
GCC then it would be easier to use the development version.

Rup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]