From 2062f77b8b897691f102434aeec3253ad2ea28a5 Mon Sep 17 00:00:00 2001 From: Paul Brook Date: Mon, 31 Oct 2011 14:26:38 +0000 Subject: cgraphunit.c: Don't mark clones as static constructors. 2011-10-31 Paul Brook gcc/ * cgraphunit.c: Don't mark clones as static constructors. gcc/testsuite/ * gcc.dg/constructor-1.c: New test. From-SVN: r180700 --- gcc/cgraphunit.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/cgraphunit.c') diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 25d7561..83c47ab 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -2366,6 +2366,10 @@ cgraph_function_versioning (struct cgraph_node *old_version_node, SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl)); SET_DECL_RTL (new_decl, NULL); + /* When the old decl was a con-/destructor make sure the clone isn't. */ + DECL_STATIC_CONSTRUCTOR(new_decl) = 0; + DECL_STATIC_DESTRUCTOR(new_decl) = 0; + /* Create the new version's call-graph node. and update the edges of the new node. */ new_version_node = -- cgit v1.1