[PR,58388] Weaken an assert in try_make_edge_direct_simple_call

Submitted by Martin Jambor on Sept. 13, 2013, 9:37 a.m.


Message ID 20130913093709.GI6732@virgil.suse
State New
Headers show

Commit Message

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

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

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



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 hide | download patch | download mbox

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);