Read-only data handling: a proposal

Jeffrey A Law law@cygnus.com
Mon Sep 15 07:20:00 GMT 1997


  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



More information about the Gcc mailing list