summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-05 19:01:20 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-05 19:01:20 +0000
commit8f214cb26e0c4a3dea4fde46e91afa5376b239a4 (patch)
treebde2cf151d7286b5f7f3375f222e5f41d1f11f88
parentcdbd3d67843ca01535bb91f9218bd6a324c11182 (diff)
downloadppe42-gcc-8f214cb26e0c4a3dea4fde46e91afa5376b239a4.tar.gz
ppe42-gcc-8f214cb26e0c4a3dea4fde46e91afa5376b239a4.zip
* tree.c (cp_cannot_inline_tree_fn): Allow inlining of comdat
functions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77330 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/tree.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 8dfd5c1543e..e1d559fbb24 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 3413edee1d2..e07ecd878d5 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;
OpenPOWER on IntegriCloud