===================================================================
@@ -861,7 +861,7 @@ edge_badness (struct cgraph_edge *edge,
else
{
int nest = MIN (inline_edge_summary (edge)->loop_depth, 8);
- badness = estimate_growth (callee) * 256;
+ badness = growth * 256;
/* Decrease badness if call is nested. */
if (badness > 0)
===================================================================
@@ -0,0 +1,39 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-guess-branch-probability -findirect-inlining" } */
+
+void fe (void);
+int i;
+
+static inline void
+FX (void (*f) (void))
+{
+ fe ();
+ (*f) ();
+}
+
+static inline void
+f4 ()
+{
+ if (i)
+ FX (fe);
+}
+
+static inline void
+f3 (void)
+{
+ f4 ();
+ if (i)
+ FX (f4);
+}
+
+static inline void
+f2 (void)
+{
+ FX (&f3);
+}
+
+void
+f1 (void)
+{
+ FX (&f2);
+}