re PR tree-optimization/48063 (ICE: verify_stmts failed: conversion of register to...
authorJakub Jelinek <jakub@redhat.com>
Fri, 11 Mar 2011 10:04:30 +0000 (11:04 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 11 Mar 2011 10:04:30 +0000 (11:04 +0100)
PR tree-optimization/48063
* ipa-inline.c (cgraph_decide_inlining): Don't try to
inline functions called once if !tree_can_inline_p (node->callers).

* gcc.dg/torture/pr48063.c: New test.

From-SVN: r170867

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

index 498e45c40a327b3c5e86e8fa7716960cb72d9fb0..9630d36614de1ed98a5f4f87915aa63a5c4b6c7d 100644 (file)
@@ -1,3 +1,9 @@
+2011-03-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/48063
+       * ipa-inline.c (cgraph_decide_inlining): Don't try to
+       inline functions called once if !tree_can_inline_p (node->callers).
+
 2011-03-11  Chen Liqin  <liqin.gcc@gmail.com>
 
        * config.gcc (score-*-elf): Add extra_parts .., update tmake_file and
index e8676c8394b95cccd223e0135fad955c4610938f..7ae5f96dc7ceb0e661da172d4008ffc163d22b8b 100644 (file)
@@ -1,5 +1,5 @@
 /* Inlining decision heuristics.
-   Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
+   Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011
    Free Software Foundation, Inc.
    Contributed by Jan Hubicka
 
@@ -1498,6 +1498,7 @@ cgraph_decide_inlining (void)
              && node->callers->caller != node
              && node->callers->caller->global.inlined_to != node
              && !node->callers->call_stmt_cannot_inline_p
+             && tree_can_inline_p (node->callers)
              && !DECL_EXTERNAL (node->decl))
            {
              cgraph_inline_failed_t reason;
index c3dec73ba13c9665d1394862800b5e3ef0f2dfac..23c94cec8fcf73ecb824f0652ef301e2f28a204f 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-11  Jakub Jelinek  <jakub@redhat.com>
+
+       PR tree-optimization/48063
+       * gcc.dg/torture/pr48063.c: New test.
+
 2011-03-10  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/template/array22.C: New.
diff --git a/gcc/testsuite/gcc.dg/torture/pr48063.c b/gcc/testsuite/gcc.dg/torture/pr48063.c
new file mode 100644 (file)
index 0000000..d861bf0
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR tree-optimization/48063 */
+/* { dg-do compile } */
+/* { dg-options "-fno-early-inlining" } */
+
+extern void abort (void);
+static void bar ();
+
+void
+foo ()
+{
+  bar (1);
+}
+
+static void
+bar (double i)
+{
+  if (i)
+    abort ();
+}