what happens with the data previously loaded by a previous pch include file?
I can't figure out why every GTY()-ed global data (extern or static) should
be overwritten at each PCH inclusion, but then maybe I am wrong.

Couple of big limiations of GCC PCH :

- Only one PCH can be loaded during one compiler invocation.
- PCH is loaded when first language specific token is seen. As expected,
various GCC components initializes themselves (e.g. defining builtins)
before this happens. When PCH is loaded, this initialization is ignored(*1)
becuase GCC will continue to use intialized state restored from PCH.

I also don't understand at which point of the compilation is the PCH dumped.
For example, do PCH file contain Gimple-SSA trees (I would guess yes) or
only Generic trees?

PCH is written near the end of compilation. If header file has
function definitions
then it will be optimized (tree-SSA as well as RTL level) and code
will be emitted
before PCH is written. PCH includes entire asm_out_file to collect generated
code.

Maybe such precious knowledge about GTY & PCH should go into the
documentation or the wiki? I did't found much information on this in
http://gcc.gnu.org/onlinedocs/gccint/Type-Information.html

GTY is documented in doc/gty.texi. I am not sure if it answers all your
questions or not.

-
Devang

(*1 = Ignores means, AFAIU, it adds yet another top level scope which
acts as real top level scope and anything that is part of previous top level
scope becomes unreachable)

Reply via email to