On 12/02/11 19:26, Patrick Marlier wrote:
Hi,
PR51347 shows up a problem due to the TM IPA rework.
tree_function_versioning segfault because the cfg of old_decl (alias) is
NULL.
Indeed, an alias can get called but tm cg data are in the parent of the
alias.
[Richard, this one's for you :-)].
Using the parent node for aliases (as in your patch) makes sense, but I
don't see tree_function_versioning() segfaulting as you claim. What I
see is estimate_function_body_sizes() failing because it is trying to
analyze an edge that doesn't exist here:
if (is_gimple_call (stmt))
{
struct cgraph_edge *edge = cgraph_edge (node, stmt);
struct inline_edge_summary *es = inline_edge_summary (edge);
In this particular case, STMT is an indirect call through the runtime:
D.2511_16 = __builtin__ITM_getTMCloneOrIrrevocable (__comp_dtor );
D.2512_17 = (void Info::<T438> (struct Info *) *) D.2511_16;
D.2512_17 (D.2504_2);
^^^^^^^^^^^^^^^^^^^^^ **EDGELESS STATEMENT**
The edge in this call was removed because we couldn't find an
appropriate static replacement:
/* As we've already skipped pure calls and appropriate builtins,
and we've already marked irrevocable blocks, if we can't come
up with a static replacement, then ask the runtime. */
Be that as it may, I am lost in a plethora of complete and base
destructors, so I am hoping Richard can review your patch more thoroughly.
Aldy