gimplify.c (gimplify_call_expr): Don't set CALL_CANNOT_INLINE_P for functions for...
authorAdam Nemet <anemet@caviumnetworks.com>
Thu, 12 Mar 2009 01:02:16 +0000 (01:02 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Thu, 12 Mar 2009 01:02:16 +0000 (01:02 +0000)
* gimplify.c (gimplify_call_expr): Don't set CALL_CANNOT_INLINE_P
for functions for which the parameter types are unknown.

testsuite/
* gcc.dg/inline-33.c: New test.

From-SVN: r144801

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

index c4cccf2..45380b9 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-11  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * gimplify.c (gimplify_call_expr): Don't set CALL_CANNOT_INLINE_P
+       for functions for which the parameter types are unknown.
+
 2009-03-11  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/39137
index b0c6592..8ed4263 100644 (file)
@@ -2355,11 +2355,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
   else if (parms)
     p = parms;
   else
-    {
-      if (nargs != 0)
-       CALL_CANNOT_INLINE_P (*expr_p) = 1;
-      p = NULL_TREE;
-    }
+    p = NULL_TREE;
   for (i = 0; i < nargs && p; i++, p = TREE_CHAIN (p))
     ;
 
index 66e0fe3..75f76d8 100644 (file)
@@ -1,3 +1,7 @@
+2009-03-11  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * gcc.dg/inline-33.c: New test.
+
 2009-03-11  Nathan Froyd  <froydnj@codesourcery.com>
 
        * gcc.dg/vect/vect-82.c: Combine dg-do and
diff --git a/gcc/testsuite/gcc.dg/inline-33.c b/gcc/testsuite/gcc.dg/inline-33.c
new file mode 100644 (file)
index 0000000..c830c7d
--- /dev/null
@@ -0,0 +1,20 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -fdump-tree-optimized"  } */
+
+int i;
+
+int foo ();
+
+main ()
+{
+  return foo (i);
+}
+
+int foo (i)
+     int i;
+{
+  return bar(i);
+}
+
+/* { dg-final { scan-tree-dump-times "bar"  2 "optimized"  } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */