tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat functions.
authorJan Hubicka <jh@suse.cz>
Thu, 5 Feb 2004 19:01:20 +0000 (20:01 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 5 Feb 2004 19:01:20 +0000 (19:01 +0000)
* tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
functions.

From-SVN: r77330

gcc/cp/ChangeLog
gcc/cp/tree.c

index 8dfd5c1543e7e4857c8a82a1a73d1e32ab436847..e1d559fbb24434eb86b23e26d53a22bceb6492cc 100644 (file)
@@ -1,3 +1,8 @@
+2004-02-05  Jan Hubicka  <jh@suse.cz>
+
+       * tree.c (cp_cannot_inline_tree_fn):  Allow inlining of comdat
+       functions.
+
 2003-02-05  Giovanni Bajo  <giovannibajo@gcc.gnu.org>
 
        PR c++/14008
index 3413edee1d242b534b70a5ec35594664db0d986b..e07ecd878d582ab64590e5828d801501ae0a9b74 100644 (file)
@@ -2080,8 +2080,12 @@ cp_cannot_inline_tree_fn (tree* 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))
+     this unit of translation.
+     Exclude comdat functions from this rule.  While they can be bound
+     to the other unit, they all must be the same.  This is especilly
+     important so templates can inline.  */
+  if (!DECL_DECLARED_INLINE_P (fn) && !(*targetm.binds_local_p) (fn)
+      && !DECL_COMDAT (fn))
     {
       DECL_UNINLINABLE (fn) = 1;
       return 1;