Fix ICE in do_estimate_edge_time

Message ID
State New
Headers show
  • Fix ICE in do_estimate_edge_time
Related show

Commit Message

Jan Hubicka Nov. 18, 2019, 7:30 p.m.
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
	* ipa-inline-analysis.c (do_estimate_edge_time): Fix sanity check.


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;