This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/48585] [4.7 Regression] 483.xalancbmk in SPEC CPU 2006 failed to build


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48585

--- Comment #12 from Martin Jambor <jamborm at gcc dot gnu.org> 2011-04-21 18:02:54 UTC ---
OK, I've been wrong on many accounts above but at least I know what is
going on now.  The segfault happens while materializing cones, not
while inlining.  And we're materializing a clone that is itself
unreachable, it's there only to facilitate materialization of its own
inline clones.  Those have no edges so we did not find any.  Moreover,
creating edges for it is entirely unnecessary too (nd can lead to
ICEs, as we now know.

By the way, in this particular case we could not find a node for the
decl because it was a same_body alias but since all clones that will
survive will redirect the call according the edge anyway, it can in
theory happen even without them.  Nevertheless, the fact that
same_alias nodes apparently get lost with LTO, the first condition in
cgraph_redirect_edge_call_stmt_to_callee will not have any effect and
the calls will be redirected to the real decl from the same body
alias.

Anyway, my (untested) roposed fix is most probably this:

Index: gcc/tree-inline.c
===================================================================
--- gcc/tree-inline.c   (revision 172817)
+++ gcc/tree-inline.c   (working copy)
@@ -1725,6 +1725,7 @@ copy_bb (copy_body_data *id, basic_block
              if ((!edge
                   || (edge->indirect_inlining_edge
                       && id->transform_call_graph_edges ==
CB_CGE_MOVE_CLONES))
+                 && id->dst_node->reachable
                  && (fn = gimple_call_fndecl (stmt)) != NULL)
                { 
                  struct cgraph_node *dest = cgraph_get_node (fn);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]