Tom de Vries <tjvr...@xs4all.nl> writes: > What I am really trying to do, is a bootstrap debug build of 4.3.5. > However, I ran into bug 31230. I minimized the testcase, did an > analysis, created a naive patch to test my hypothesis, tested the > patch and put it in the bug report. Now I'm looking for feedback. > > In the question I asked to this mailing list I tried to abstract away >> From the specific case I analyzed, to get a more conceptual > discussion about the garbage collector, but maybe that was a mistake, > sorry for the confusion. > > My analysis, what I'm trying to get confirmed, is that the the actual > type_hash_marked_p() in gcc is 'such an if_marked property': > ... > static int type_hash_marked_p (const void *p) { > tree type = ((struct type_hash *) p)->type; > return ggc_marked_p (type) || TYPE_SYMTAB_POINTER (type); > }
Interesting. My first reaction is that this is an invalid use of the garbage collector. I think there is really only one valid function that can be used as an if_marked function: one which checks ggc_marked_p on the structure. The only counterexample I can see in the current code is this one. It seems to me that we can work around this by building a separate garbage collector root pointing to all types for which TYPE_SYMTAB_POINTER is true. Ian