http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55264
Aldy Hernandez <aldyh at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org
--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2012-11-27
15:34:06 UTC ---
When compiled with -fno-weak, we re-use the out-of-line copy in
clone_inlined_nodes(), around here:
/* We may eliminate the need for out-of-line copy to be output.
In that case just go ahead and re-use it. This is not just an
memory optimization. Making offline copy of fuction disappear
from the program will improve future decisions on inlining. */
This happens because the conditional can_remove_node_now_p_1() returns true for
virtuals that are not weak:
/* Inlining might enable more devirtualizing, so we want to remove
those only after all devirtualizable virtual calls are processed.
Lacking may edges in callgraph we just preserve them post
inlining. */
&& (!DECL_VIRTUAL_P (node->symbol.decl)
|| (!DECL_COMDAT (node->symbol.decl)
&& !DECL_EXTERNAL (node->symbol.decl)))
When we re-use the out-of-line copy in clone_inlined_nodes(), we end up setting
inlined_to here:
e->callee->global.inlined_to = e->caller;
This causes the ICE in ipa_make_edge_direct_to_target, because inlined_to is
non-NULL:
/* We can not make edges to inline clones. It is bug that someone removed
the cgraph node too early. */
gcc_assert (!callee->global.inlined_to);
Any tips on how to proceed from here?