Index: gcc/ipa-inline.c
===================================================================
--- gcc/ipa-inline.c	(revision 203381)
+++ gcc/ipa-inline.c	(working copy)
@@ -1765,7 +1765,16 @@ inline_small_functions (void)
 	    fprintf (dump_file, " Peeling recursion with depth %i\n", depth);
 
 	  gcc_checking_assert (!callee->global.inlined_to);
-	  inline_call (edge, true, &new_indirect_edges, &overall_size, true);
+	  if (inline_call (edge, true, &new_indirect_edges, &overall_size, true))
+            {
+              /* Update max_count if new edges were found */
+              int i;
+              cgraph_edge_p edge;
+              FOR_EACH_VEC_ELT (new_indirect_edges, i, edge)
+                if (max_count < edge->count)
+                  max_count = edge->count;
+            }
+
 	  if (flag_indirect_inlining)
 	    add_new_edges_to_heap (edge_heap, new_indirect_edges);
 
