summaryrefslogtreecommitdiff
path: root/gcc/cp/vtable-class-hierarchy.c
diff options
context:
space:
mode:
authorCaroline Tice <cmtice@google.com>2013-09-08 14:58:07 -0700
committerCaroline Tice <ctice@gcc.gnu.org>2013-09-08 14:58:07 -0700
commitf085f27e124563b5cbede337426695c4ed43693b (patch)
tree1ceaae2103d7fc8be5800b25735bb38bf0eb3d2b /gcc/cp/vtable-class-hierarchy.c
parent7b395dddb5c4c14bf5f9f9e75a60f2b549d193ff (diff)
downloadgcc-f085f27e124563b5cbede337426695c4ed43693b.tar.gz
Fix PR 58300...
Fix PR 58300: Re-order events with -fvtable-verify=preinit flag, so constructor init function is not written to assembly file until after call to cgraph_process_new_functions. From-SVN: r202371
Diffstat (limited to 'gcc/cp/vtable-class-hierarchy.c')
-rw-r--r--gcc/cp/vtable-class-hierarchy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/cp/vtable-class-hierarchy.c b/gcc/cp/vtable-class-hierarchy.c
index 276fa1f9966..78611a83264 100644
--- a/gcc/cp/vtable-class-hierarchy.c
+++ b/gcc/cp/vtable-class-hierarchy.c
@@ -1179,15 +1179,16 @@ vtv_generate_init_routine (void)
TREE_USED (vtv_fndecl) = 1;
DECL_PRESERVE_P (vtv_fndecl) = 1;
if (flag_vtable_verify == VTV_PREINIT_PRIORITY)
- {
- DECL_STATIC_CONSTRUCTOR (vtv_fndecl) = 0;
- assemble_vtv_preinit_initializer (vtv_fndecl);
- }
+ DECL_STATIC_CONSTRUCTOR (vtv_fndecl) = 0;
gimplify_function_tree (vtv_fndecl);
cgraph_add_new_function (vtv_fndecl, false);
cgraph_process_new_functions ();
+
+ if (flag_vtable_verify == VTV_PREINIT_PRIORITY)
+ assemble_vtv_preinit_initializer (vtv_fndecl);
+
}
pop_lang_context ();
}