> The problem is that the references to object C1 and C2 live in > a hash table, and that although the referenced nodes will be retained > by the garbage collector, their mapping in int_cst_hash_table is > deleted by the GC.
This isn't a simple hash table, is it? > I am not familiar with the details of garbage collection and > pretty much just try use existing code as a model. Apparently, > this sequence of statements is insufficient to tell the GC that it should > mark the integer constants referenced in this hash table as "in use". > > static GTY ((if_marked ("tree_map_marked_p"), > param_is (struct tree_map))) > htab_t upc_block_factor_for_type; > [...] > upc_block_factor_for_type = htab_create_ggc (512, tree_map_hash > tree_map_eq, 0); This is a map so it is garbage-collected as a map: if the key isn't marked, then the value isn't either. Hence 2 questions: - why using a map and not a simple hash table? - what is the key and why isn't it marked? -- Eric Botcazou