Patchwork [PR,58388] Weaken an assert in try_make_edge_direct_simple_call

login
register
mail settings
Submitter Martin Jambor
Date Sept. 13, 2013, 9:37 a.m.
Message ID <20130913093709.GI6732@virgil.suse>
Download mbox | patch
Permalink /patch/274696/
State New
Headers show

Comments

Martin Jambor - Sept. 13, 2013, 9:37 a.m.
Hi,

the assert in try_make_edge_direct_simple_call does not really do the
right thing when we have actually removed a speculation rather than
just a previously indirect edge direct because the cs->callee might
have been inlined or cloned and thus be different from the constant in
the jump function.  So I added a condition that triggers when the edge
made direct was speculative to make the assert happy in these
situations.

I have bootstrapped and tested the patch on x86_64-linux without any
issues.  I have also checked that the error goes away when I do
profiled LTO bootstrap but the process then halted on Werror caliming
that anchor in get_section_anchor in varasm.c can be used
uninitialized.  When I "fixed" that by initializing it to NULL, the
bootstrap failed on something else, I've only started to look why.
Nevertheless, the patch fixes the problem with my code in ipa.cp.  It
has been pre-approved by Honza in bugzilla, I will commit it later
today.

Thanks,

Martin


2013-09-12  Martin Jambor  <mjambor@suse.cz>

	PR bootstrap/58388
	* ipa-prop.c (try_make_edge_direct_simple_call): Be less strict in
	the assert if the edge was a speculative one.

Patch

Index: src/gcc/ipa-prop.c
===================================================================
--- src.orig/gcc/ipa-prop.c
+++ src/gcc/ipa-prop.c
@@ -2603,7 +2603,8 @@  try_make_edge_direct_simple_call (struct
     {
       bool ok;
       gcc_checking_assert (cs->callee
-			   && (jfunc->type != IPA_JF_CONST
+			   && (cs != ie
+			       || jfunc->type != IPA_JF_CONST
 			       || !cgraph_node_for_jfunc (jfunc)
 			       || cs->callee == cgraph_node_for_jfunc (jfunc)));
       ok = try_decrement_rdesc_refcount (jfunc);