From 6039a93dd7214d5f1effdd2c165dc4e52b950139 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 5 Feb 2004 20:01:20 +0100 Subject: [PATCH] tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat functions. * tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat functions. From-SVN: r77330 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/tree.c | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8dfd5c1543e7..e1d559fbb244 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2004-02-05 Jan Hubicka + + * tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat + functions. + 2003-02-05 Giovanni Bajo PR c++/14008 diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 3413edee1d24..e07ecd878d58 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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;