summaryrefslogtreecommitdiff
path: root/gcc/ipa-icf.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-03-21 20:33:33 +0100
committerMartin Liska <marxin@gcc.gnu.org>2016-03-21 19:33:33 +0000
commit2a85ddbbf18d68537e919cb5ff5c1621f2bdc0df (patch)
tree3683a2202a7db807159a26090dac04efd8f048a2 /gcc/ipa-icf.c
parent9a72f5f6df7150707d83b533ea356319415b919a (diff)
Skip static ctors/dtors in IPA ICF (PR ipa/70306)
* gcc.dg/ipa/pr70306.c: New test. * ipa-icf.c (sem_function::parse): Skip static constructors and destructors. From-SVN: r234378
Diffstat (limited to 'gcc/ipa-icf.c')
-rw-r--r--gcc/ipa-icf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index d82eb879d05..aa6589c16e1 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -1697,6 +1697,11 @@ sem_function::parse (cgraph_node *node, bitmap_obstack *stack)
if (lookup_attribute_by_prefix ("omp ", DECL_ATTRIBUTES (node->decl)) != NULL)
return NULL;
+ /* PR ipa/70306. */
+ if (DECL_STATIC_CONSTRUCTOR (node->decl)
+ || DECL_STATIC_DESTRUCTOR (node->decl))
+ return NULL;
+
sem_function *f = new sem_function (node, 0, stack);
f->init ();