This is the mail archive of the gcc@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: Read-only data handling: a proposal


  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


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