This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/51929] [4.7 Regression] ICE: verify_cgraph_node failed with -O2 -fno-guess-branch-probability -fipa-cp-clone
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 10 Feb 2012 10:33:33 +0000
- Subject: [Bug middle-end/51929] [4.7 Regression] ICE: verify_cgraph_node failed with -O2 -fno-guess-branch-probability -fipa-cp-clone
- Auto-submitted: auto-generated
- References: <bug-51929-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51929
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-02-10 10:33:33 UTC ---
This is related to same body aliases. The verification fails because IPA-CP
decides to cgraph_redirect_edge_callee a call_stmt that calls a same_body_alias
of B<char>::B(A, int) (__comp_ctor) to a clone of not that node (i.e. not the
same_body_alias), but of its ->thunk.alias (i.e. the alias with the actual body
of the ctor, __base_ctor). I don't find anything wrong on that, so I've tried
to adjust just the verification:
- function. This ping-pong has to go, eventaully. */
+ function. This ping-pong has to go, eventually. */
&& (node != cgraph_function_or_thunk_node (e->callee, NULL))
- && !clone_of_p (node, e->callee))
+ && !clone_of_p (node, e->callee)
+ /* If decl is a same body alias of some other decl, allow e->callee to
be
+ a clone of a clone of that other decl too. */
+ && (!node->same_body_alias
+ || !clone_of_p (cgraph_get_node (node->thunk.alias), e->callee)))
but unfortunately it just cures one of the two error: edge points to wrong
declaration: errors.