On 08/21/2009 10:52 AM, Laurynas Biveinis wrote:
Trees and rtxes mostly. I haven't got around to taking a closer look,
but for example folders love allocating temporary trees. For example,
in tree-ssa-ccp.c:fold_gimple_assign,
if (COMPARISON_CLASS_P (op0))
{
fold_defer_overflow_warnings ();
tem = fold_binary_loc (cond_loc,
TREE_CODE (op0), TREE_TYPE (op0),
TREE_OPERAND (op0, 0),
TREE_OPERAND (op0, 1));
/* This is actually a conditional expression, not a GIMPLE
conditional statement, however, the valid_gimple_rhs_p
test still applies. */
set = (tem&& is_gimple_condexpr (tem)
&& valid_gimple_rhs_p (tem));
fold_undefer_overflow_warnings (set, stmt, 0);
}
Here tem should not be allocated on GC memory.
I disagree, as this would not apply to tem only but also to anything
allocated to fold it. This is not going to be maintainable (what if
fold create temporary types, which need to be in GC memory definitely?).
Not having to deal with the lifetime of "temporary" stuff is part of
having a GC, isn't it?
At most, you may want to add more ggc_free calls, but I don't think this
is necessary either. Actually, it would anyway miss any trees that are
not toplevel and are created by the call to fold_binary_loc, so it would
even be wrong in some sense.
Paolo