Newsgroups: | comp.compilers |
From: | fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) |
Organization: | Computer Science, University of Melbourne, Australia |
Date: | Sat, 25 Jul 1992 10:21:32 GMT |
References: | 92-07-068 92-07-086 |
Keywords: | storage, C, question |
acha@CS.CMU.EDU (Anurag Acharya) writes:
>Wish list:
>
>1. label variables. Any kind of label variables with any resonable
>restrictions
>
> (statically scoped, no jumping to inside blocks etc.). This would
> greatly facilitate compilation of both functional languages and parallel
> languages. It would also facilitate parallelizing compilers for other
> languages. To this, add a C compiler that does not limit the size
> of individual functions and you are close to using C as an assembly
> language
If you are willing to restrict yourself to gcc 2.X then I think that you
will find what you need here. gcc 2.X supports label variables and
reportedly has no limits on function size. Beware though, that many
optimizers (and I think gcc falls in this category) use algorithms that
are O(n^2) time & space or worse, where n is the length of a function, so
you may find that even though there are no arbitrary hard limits,
compilation becomes unacceptably slow. (In the worst case, the compiler
thrashes itself to death for a few hours before running out of virtual
memory :-( ).
>2. A portable way of looking at the stack. Supporting garbage collection
> and call/cc (user-level continuations) would be easier if one could
> traipse up and down the C stack. Currently, such schemes are machine and
> compiler dependent.
>3. Some form of global register assignment. Some annotation scheme that
> allows me to indicate to the C compiler that I would like a particular
> global variable to be stuck in a register (may be a particular register
> if I am willing to give up portability).
Again, if you are willing to restrict youself to gcc 2.X then this
facility is provided. Unfortunately you *have* to specify which particular
register, so porting will require a bit more work with #if's and so forth.
[You could specify that for machine X, use register A1, for machine Y, use
register SI, for any other machines don't use a register - that way the
code will port easily to any machine, and the extra work is only required
if you want it to be efficient.]
--
Fergus Henderson fjh@munta.cs.mu.OZ.AU
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.