Re: question about if_marked construct

2010-07-08 Thread Tom de Vries
I can image a few ways to go from here: - leave as is, fix this when it really bothers us (risk: exchange a known problem for unknown hard-to-debug and/or hard-to-reproduce problems) - instrument if_marked functions like the one for value_expr_for_decl to assert if the from field is live

Re: question about if_marked construct

2010-07-07 Thread Richard Guenther
On Tue, Jul 6, 2010 at 6:12 PM, Tom de Vries tjvr...@xs4all.nl wrote: Hi Richard, I can image a few ways to go from here: - leave as is, fix this when it really bothers us (risk: exchange a known problem for unknown hard-to-debug and/or hard-to-reproduce problems) - instrument if_marked

Re: question about if_marked construct

2010-07-06 Thread Richard Guenther
On Mon, Jul 5, 2010 at 5:57 PM, Tom de Vries tjvr...@xs4all.nl wrote: Hi, The tree_map_base_marked_p checks ggc_marked_p on the from field. During ggc_scan_cache_tab, if the from field is live, also the to field is marked live. I wrote some code to do sanity testing and found a similar

Re: question about if_marked construct

2010-07-05 Thread Tom de Vries
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. Then how about tree_map_base_marked_p, the if_marked

Re: question about if_marked construct

2010-07-05 Thread Richard Guenther
On Mon, Jul 5, 2010 at 1:54 PM, Tom de Vries tjvr...@xs4all.nl wrote: 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

Re: question about if_marked construct

2010-07-05 Thread Tom de Vries
Hi, The tree_map_base_marked_p checks ggc_marked_p on the from field. During ggc_scan_cache_tab, if the from field is live, also the to field is marked live. I wrote some code to do sanity testing and found a similar scenario as before: - a register attribute is not marked live during

question about if_marked construct

2010-06-23 Thread Tom de Vries
Hi, In the context of bug 31230, I have a question about the if_marked construct. [DOC http://gcc.gnu.org/onlinedocs/gccint/GTY-Options.html] if_marked (expression) Suppose you want some kinds of object to be unique, and so you put them in a hash table. If garbage collection marks the

Re: question about if_marked construct

2010-06-23 Thread Ian Lance Taylor
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

Re: question about if_marked construct

2010-06-23 Thread Tom de Vries
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

Re: question about if_marked construct

2010-06-23 Thread Ian Lance Taylor
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

Re: question about if_marked construct

2010-06-23 Thread Basile Starynkevitch
On Wed, 2010-06-23 at 08:56 -0700, Ian Lance Taylor wrote: 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,

Re: question about if_marked construct

2010-06-23 Thread Ian Lance Taylor
Basile Starynkevitch bas...@starynkevitch.net writes: On Wed, 2010-06-23 at 08:56 -0700, Ian Lance Taylor wrote: 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

Re: question about if_marked construct

2010-06-23 Thread Tom de Vries
On Jun 23, 2010, at 19:40, Ian Lance Taylor wrote: Basile Starynkevitch bas...@starynkevitch.net writes: On Wed, 2010-06-23 at 08:56 -0700, Ian Lance Taylor wrote: 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