]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/51519 (ICE: in inline_small_functions, at ipa-inline.c:1410...
authorRichard Guenther <rguenther@suse.de>
Tue, 13 Dec 2011 12:54:57 +0000 (12:54 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 13 Dec 2011 12:54:57 +0000 (12:54 +0000)
2011-12-13  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/51519
* ipa-inline.c (edge_badness): Use edge growth in non-guessed
branch probability case as well.

* gcc.dg/pr51519.c: New testcase.

From-SVN: r182279

gcc/ChangeLog
gcc/ipa-inline.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr51519.c [new file with mode: 0644]

index efb530229810cf76b833636d6bc9f0d13ddafa49..df45f4448c47b7cef9c03e68db2d1ddaee42a74e 100644 (file)
@@ -1,3 +1,9 @@
+2011-12-13  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/51519
+       * ipa-inline.c (edge_badness): Use edge growth in non-guessed
+       branch probability case as well.
+
 2011-12-13  Revital Eres  <revital.eres@linaro.org>
 
        * modulo-sched.c (mark_loop_unsched): Free bbs.
index 3cb35e924c141671f2abef2d80dd4f1610bcf191..14bd89a67bcb9708e1268d6525a1f87844aa665a 100644 (file)
@@ -861,7 +861,7 @@ edge_badness (struct cgraph_edge *edge, bool dump)
   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)
index 70269cdf830fc9e419820f0af98101df761a0aa7..5de35b0d7ffd8911116db69ea1a88f2a67501dd1 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-13  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/51519
+       * gcc.dg/pr51519.c: New testcase.
+
 2011-12-13  Richard Guenther  <rguenther@suse.de>
 
        * gcc.dg/lto/20111213-1_0.c: New testcase.
diff --git a/gcc/testsuite/gcc.dg/pr51519.c b/gcc/testsuite/gcc.dg/pr51519.c
new file mode 100644 (file)
index 0000000..3d5d3f2
--- /dev/null
@@ -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);
+}