On Jun 23, 2010, at 16:49, Ian Lance Taylor wrote:

Tom de Vries <tjvr...@xs4all.nl> writes:

static int prop(const_tree type)
{
  return type == A;
}

static int type_hash_marked_p (const void *p) {
 const_tree const type = ((const struct type_hash *) p)->type;
 return ggc_marked_p (type) || prop (type);
}

I would like to question your premise.  The gcc garbage collector is
not some general purpose library.  It's specifically for the use of
gcc.  Why, in gcc, would you want to write such an if_marked property?
Is there some simpler and clearer way to express what you actually
want to have happen?

Ian

Hi Ian,

Thanks for your reaction.

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);
}
...

Regards
  Tom

Reply via email to