Pre Compiled Headers

2007-02-11 Thread Brendon Costa
Hi All, I am coding an extension for GCC and am having some difficulty with pre-compiled headers. I dont know if my understanding of how they work is completely correct and so my code is getting a segfault. I have a hook into gimplify_function_tree() and I process functions as they pass through

Re: Pre Compiled Headers

2007-02-12 Thread Mike Stump
On Feb 11, 2007, at 1:17 PM, Brendon Costa wrote: I am coding an extension for GCC and am having some difficulty with pre-compiled headers. I dont know if my understanding of how they work is completely correct and so my code is getting a segfault. You _must_ have clean data structures and

Re: Pre Compiled Headers

2007-02-12 Thread Basile STARYNKEVITCH
Hello On Mon, 12 Feb 2007 19:46:35 -0800 Mike Stump wrote > The mental model you should use for PCH is this, when processing a header, > the compiler does a complete memory walk and dumps it to a file. Upon > `reading' the pch file, it mmaps all that memory back in, throwing out all > previousl

Re: Pre Compiled Headers

2007-02-12 Thread Paolo Bonzini
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. There can be only one PCH inclusion in every compilation. Paolo

Re: Pre Compiled Headers

2007-02-13 Thread Devang Patel
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

Re: Pre Compiled Headers

2007-02-13 Thread Brendon Costa
that the way i was going about it was going to fail. Mike Stump wrote: > On Feb 11, 2007, at 1:17 PM, Brendon Costa wrote: >> I am coding an extension for GCC and am having some difficulty with >> pre-compiled headers. I dont know if my understanding of how they work >> is comp

Re: Pre Compiled Headers

2007-02-13 Thread Mike Stump
On Feb 13, 2007, at 1:34 PM, Brendon Costa wrote: Sorry for the long email Complex questions are better long, as that allows for better answers, which should be more useful to you. This was based on an idea from Mike in Nov 2006 when i needed to ensure that the FUNCTION_DECL nodes were no

Re: Pre Compiled Headers

2007-02-13 Thread Brendon Costa
Thanks for the response. >> * Is it possible to explicitly free garbage collected memory if i know i >> will not be needing it any more > > Yes, ggc_free.[1] > > 1 - Some people think that all the savings you'd get from this aren't > work the pain of doing it, if you have to track down any over

Re: Pre Compiled Headers

2007-02-13 Thread Mike Stump
On Feb 13, 2007, at 3:16 PM, Brendon Costa wrote: There is no "additional" pain in doing this as I have already developed my code using manual malloc/free in such a way that i am reasonably sure there are no leaks, or double free calls or the like. No, the pain would be a dangling pointer.

Re: Pre Compiled Headers

2007-02-13 Thread Brendon Costa
Mike Stump wrote: > On Feb 13, 2007, at 3:16 PM, Brendon Costa wrote: >> There is no "additional" pain in doing this as I have already >> developed my code using manual malloc/free in such a way that i am >> reasonably sure there are no leaks, or double free calls or the like. > > No, the pain wou

Re: Pre Compiled Headers

2007-02-13 Thread Mike Stump
On Feb 12, 2007, at 10:42 PM, Basile STARYNKEVITCH wrote: A big thanks for the explanation, which is something I partly guessed, but which leaves me in a deep trouble :-) Glad to turn on the flashlight so that you may see the hole. I hope you know which way to dig now. :-) I can't figure