aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2013-08-26 17:38:33 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2013-08-26 15:38:33 +0000
commit0987ffe7c18bf1bf5830364e405009ed8f4a61bb (patch)
tree3ec32a1c6bd6cd7a7bdd38b621d91f13749517a2 /gcc/ipa.c
parentbefe864770708c7799ea2dee9c1db77309089932 (diff)
downloadgcc-0987ffe7c18bf1bf5830364e405009ed8f4a61bb.zip
gcc-0987ffe7c18bf1bf5830364e405009ed8f4a61bb.tar.gz
gcc-0987ffe7c18bf1bf5830364e405009ed8f4a61bb.tar.bz2
ipa.c (comdat_can_be_unshared_p_1): C++ constructors and destructors can be unshared.
* ipa.c (comdat_can_be_unshared_p_1): C++ constructors and destructors can be unshared. From-SVN: r202001
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 370032b..778a88f 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -574,9 +574,13 @@ static bool
comdat_can_be_unshared_p_1 (symtab_node node)
{
/* When address is taken, we don't know if equality comparison won't
- break eventually. Exception are virutal functions and vtables,
- where this is not possible by language standard. */
+ break eventually. Exception are virutal functions, C++
+ constructors/destructors and vtables, where this is not possible by
+ language standard. */
if (!DECL_VIRTUAL_P (node->symbol.decl)
+ && (TREE_CODE (node->symbol.decl) != FUNCTION_DECL
+ || (!DECL_CXX_CONSTRUCTOR_P (node->symbol.decl)
+ && !DECL_CXX_DESTRUCTOR_P (node->symbol.decl)))
&& address_taken_from_non_vtable_p (node))
return false;