Integrating a new front end to GCC - avoiding flames later

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Fri Dec 31 23:54:00 GMT 1999


> Can you point me to any doc/code on the garbage collection? Just
> a starting point will do. 

There is no texinfo for it, yet. I suggest you browse through ggc.h.
This defines an interface between the compiler and the garbage
collector. Actual garbage collectors are ggc-page.c and ggc-simple.c.

Usage is quite simple: You need to declare all GC "roots" (object that
are in use, but not necessarily otherwise referenced). For
language-specific stuff, you'll need to explain where the embedded
pointers are. Everything else is done by the collector, which is
normally activated between passes. It can be activated in-between as
well, but you need to be careful not to have "roots" in local
variables on the stack.

> I have downloaded the full 21 Dec snapshot.

If you have a somewhat decent internet connection, you'll find that
CVS is more convenient than downloading snapshots. Just do "cvs
update", to get any bug fixes (and new bugs :( that have been
integrated since you got the snapshot last time.

> COBOL has funny things like the fact that duplicate names are OK
> as long as you don't reference them. Also the BCD data does not
> map into the trees at all. Decimal numerics have attibutes of
> number of digits, format (packed, ascii, binary!), signed or not,
> sign a separate byte or not, sign leading or trailing or
> "overpunched".

You'll have to define new tree codes for that. You need tree codes for
the types, and tree codes for the constants. If you have specific
expressions, you also need type codes for those.

You can make the tree codes either language specific (like
cp/template_decl), or common (like most types).

If you have those as language-specific trees, you later need to
transform them to tree nodes understood by the middle end,
eg. structures or arrays. Operations would then need to be converted
to function calls.

Alternatively, you can put BCD support further down. If you want the
hardware support, it probably has to go into the machine definitions
as well (as a new mode??).

Regards,
Martin



More information about the Gcc mailing list