OSDN Git Service

* fr30.c (fr30_print_operand): Fix bug in output of CONST_DOUBLE.
[pf3gnuchains/gcc-fork.git] / gcc / c-objc-common.c
index f5e9579..30c8514 100644 (file)
@@ -34,6 +34,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "varray.h"
 #include "ggc.h"
 #include "langhooks.h"
+#include "target.h"
 
 static bool c_tree_printer PARAMS ((output_buffer *, text_info *));
 static tree inline_forbidden_p PARAMS ((tree *, int *, void *));
@@ -91,7 +92,7 @@ inline_forbidden_p (nodep, walk_subtrees, fn)
        {
          /* We cannot inline functions that take a variable number of
             arguments.  */
-       case BUILT_IN_VARARGS_START:
+       case BUILT_IN_VA_START:
        case BUILT_IN_STDARG_START:
 #if 0
          /* Functions that need information about the address of the
@@ -150,11 +151,13 @@ c_cannot_inline_tree_fn (fnp)
       && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
     return 1;
 
+  /* Don't auto-inline anything that might not be bound within 
+     this unit of translation.  */
+  if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn))
+    goto cannot_inline;
+
   if (! function_attribute_inlinable_p (fn))
-    {
-      DECL_UNINLINABLE (fn) = 1;
-      return 1;
-    }
+    goto cannot_inline;
 
   /* If a function has pending sizes, we must not defer its
      compilation, and we can't inline it as a tree.  */
@@ -164,10 +167,7 @@ c_cannot_inline_tree_fn (fnp)
       put_pending_sizes (t);
 
       if (t)
-       {
-         DECL_UNINLINABLE (fn) = 1;
-         return 1;
-       }
+       goto cannot_inline;
     }
 
   if (DECL_CONTEXT (fn))
@@ -175,10 +175,7 @@ c_cannot_inline_tree_fn (fnp)
       /* If a nested function has pending sizes, we may have already
          saved them.  */
       if (DECL_LANG_SPECIFIC (fn)->pending_sizes)
-       {
-         DECL_UNINLINABLE (fn) = 1;
-         return 1;
-       }
+       goto cannot_inline;
     }
   else
     {
@@ -201,12 +198,13 @@ c_cannot_inline_tree_fn (fnp)
     }
     
   if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL))
-    {
-      DECL_UNINLINABLE (fn) = 1;
-      return 1;
-    }
+    goto cannot_inline;
 
   return 0;
+
+ cannot_inline:
+  DECL_UNINLINABLE (fn) = 1;
+  return 1;
 }
 
 /* Called from check_global_declarations.  */