This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Read-only data handling: a proposal
- To: "David S. Miller" <davem at jenolan dot rutgers dot edu>
- Subject: Re: Read-only data handling: a proposal
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Mon, 15 Sep 1997 08:07:41 -0600
- cc: mj at mj dot gts dot cz, egcs at cygnus dot com
- Reply-To: law at cygnus dot com
In message <199709151328.JAA05717@jenolan.rutgers.edu>you write:
> Why not just defer all static's. Add them to a chain of tree nodes.
> Once you reach the end of the compilation unit, call something like
> compile_deferred_statics().
That's basically how it worked.
The problem is you you to copy the tree structure for the static variable
_and_ all the nodes that it references that might be examined during
output of the initializer. Remember you can have statics at function
scope (and thus their memory lives on the function obstack, which gets
wiped at the end of each function).
You also have to handle tenative definitions. ie
static int foo;
[ ... use foo somewhere ... ]
static int foo = 5;
jeff