OSDN Git Service

* tree.c: Include target.h.
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 31 Aug 2002 02:37:09 +0000 (02:37 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 31 Aug 2002 02:37:09 +0000 (02:37 +0000)
        (cp_cannot_inline_tree_fn): Don't auto-inline functions that
        don't bind locally.
        * Makefile.in (tree.o): Update.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56692 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/Make-lang.in
gcc/cp/tree.c

index adb6f13..4c650c1 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-30  Richard Henderson  <rth@redhat.com>
+
+       * tree.c: Include target.h.
+       (cp_cannot_inline_tree_fn): Don't auto-inline functions that
+       don't bind locally.
+       * Makefile.in (tree.o): Update.
+
 2002-08-27  Mark Mitchell  <mark@codesourcery.com>
 
        * class.c (layout_virtual_bases): Warn about bugs in G++ that
index d174691..3235149 100644 (file)
@@ -280,7 +280,7 @@ cp/method.o: cp/method.c $(CXX_TREE_H) toplev.h $(GGC_H) $(RTL_H) $(EXPR_H) \
 cp/cvt.o: cp/cvt.c $(CXX_TREE_H) cp/decl.h flags.h toplev.h convert.h
 cp/search.o: cp/search.c $(CXX_TREE_H) stack.h flags.h toplev.h $(RTL_H)
 cp/tree.o: cp/tree.c $(CXX_TREE_H) flags.h toplev.h $(GGC_H) $(RTL_H) \
-  insn-config.h integrate.h tree-inline.h real.h gt-cp-tree.h
+  insn-config.h integrate.h tree-inline.h real.h gt-cp-tree.h $(TARGET_H)
 cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(SYSTEM_H)
 cp/rtti.o: cp/rtti.c $(CXX_TREE_H) flags.h toplev.h
 cp/except.o: cp/except.c $(CXX_TREE_H) flags.h $(RTL_H) except.h toplev.h \
index 6e09285..b0bd4fe 100644 (file)
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA.  */
 #include "insn-config.h"
 #include "integrate.h"
 #include "tree-inline.h"
+#include "target.h"
 
 static tree bot_manip PARAMS ((tree *, int *, void *));
 static tree bot_replace PARAMS ((tree *, int *, void *));
@@ -2211,6 +2212,14 @@ cp_cannot_inline_tree_fn (fnp)
        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))
+    {
+      DECL_UNINLINABLE (fn) = 1;
+      return 1;
+    }
+
   if (varargs_function_p (fn))
     {
       DECL_UNINLINABLE (fn) = 1;