]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix PR 58300...
authorCaroline Tice <cmtice@google.com>
Sun, 8 Sep 2013 21:58:07 +0000 (14:58 -0700)
committerCaroline Tice <ctice@gcc.gnu.org>
Sun, 8 Sep 2013 21:58:07 +0000 (14:58 -0700)
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

gcc/cp/ChangeLog
gcc/cp/vtable-class-hierarchy.c

index 8ab8698378bfc18188291af2257d7e0bfdd02fa3..9ba17c8bc31ec992a802e56cbe0958b7c5b76b90 100644 (file)
@@ -1,3 +1,10 @@
+2013-09-08  Caroline Tice  <cmtice@google.com>
+
+       PR c++/58300
+       * vtable-class-hierarchy.c (vtv_generate_init_routine):  In
+       preinit case, move call to assemble_vtv_preinit_initializer to
+       after call to cgraph_process_new_functions.
+       
 2013-09-08  Tom de Vries  <tom@codesourcery.com>
 
        PR c++/58282
index 276fa1f9966f2f4d6dd6dea802fa89bae6fb765b..78611a832641d8b508d36085ec427f1e99ffc591 100644 (file)
@@ -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 ();
 }