diff mbox series

Fix ICE in do_estimate_edge_time

Message ID 20191118193034.o37elysskdjqn3nz@kam.mff.cuni.cz
State New
Headers show
Series Fix ICE in do_estimate_edge_time | expand

Commit Message

Jan Hubicka Nov. 18, 2019, 7:30 p.m. UTC
Hi,
this patch fixes two problems triggered by lto boostrap lean.  First
inline_small_functions starts adding new edges before reseting old data
in cache. Second is about disabling the test for functions with IPA
count (since updating it triggers small roundoff errors) which
incorrectly ask count of edge->callee which may be an alias.

lto-lean-profiledbootstrapped/regtested x86_64-linux, comitted.

	PR ipa/92508
	* ipa-inline.c (inline_small_functions): Add new edges after reseting
	caches.
	* ipa-inline-analysis.c (do_estimate_edge_time): Fix sanity check.
diff mbox series

Patch

Index: ipa-inline.c
===================================================================
--- ipa-inline.c	(revision 278390)
+++ ipa-inline.c	(working copy)
@@ -2136,9 +2135,8 @@  inline_small_functions (void)
 
 	  gcc_checking_assert (!callee->inlined_to);
 	  inline_call (edge, true, &new_indirect_edges, &overall_size, true);
-	  add_new_edges_to_heap (&edge_heap, new_indirect_edges);
-
 	  reset_edge_caches (edge->callee);
+	  add_new_edges_to_heap (&edge_heap, new_indirect_edges);
 
 	  update_callee_keys (&edge_heap, where, updated_nodes);
 	}
Index: ipa-inline-analysis.c
===================================================================
--- ipa-inline-analysis.c	(revision 278390)
+++ ipa-inline-analysis.c	(working copy)
@@ -211,7 +211,7 @@  do_estimate_edge_time (struct cgraph_edg
 	  nonspec_time = e->entry.nonspec_time;
 	  hints = e->entry.hints;
 	  if (flag_checking
-	      && !edge->callee->count.ipa_p ())
+	      && !callee->count.ipa_p ())
 	    {
 	      sreal chk_time, chk_nonspec_time;
 	      int chk_size, chk_min_size;