tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers): Do not stream DECL_VINDEX.
authorJan Hubicka <jh@suse.cz>
Wed, 29 Aug 2018 17:07:35 +0000 (19:07 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 29 Aug 2018 17:07:35 +0000 (17:07 +0000)
* tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers):
Do not stream DECL_VINDEX.
* tree-streamer-out.c (write_ts_function_decl_tree_pointers): Likewise.
* tree.c (free_lang_data_in_decl): Clear DECL_VINDEX.
(decl_function_context): Use DECL_VIRTUAL_P rather than DECL_VINDEX.

From-SVN: r263962

gcc/ChangeLog
gcc/tree-streamer-in.c
gcc/tree-streamer-out.c
gcc/tree.c

index dcec935d5beee031e23f0ad48772a23ae0fdb5c1..00d6f3067444f6a31e883ca8064d7ebacde9fec6 100644 (file)
@@ -1,3 +1,11 @@
+2018-08-29  Jan Hubicka  <jh@suse.cz>
+
+       * tree-streamer-in.c (lto_input_ts_function_decl_tree_pointers):
+       Do not stream DECL_VINDEX.
+       * tree-streamer-out.c (write_ts_function_decl_tree_pointers): Likewise.
+       * tree.c (free_lang_data_in_decl): Clear DECL_VINDEX.
+       (decl_function_context): Use DECL_VIRTUAL_P rather than DECL_VINDEX.
+
 2018-08-29  Richard Biener  <rguenther@suse.de>
 
        * tree-ssa-sccvn.c (vuse_ssa_val): Return NULL for unvisited
index 43cd9a4cad1323f1a208883302c4bfbd20755953..34cbb193b8bd447b9b9c2850e1581ee307b01cb4 100644 (file)
@@ -769,7 +769,6 @@ static void
 lto_input_ts_function_decl_tree_pointers (struct lto_input_block *ib,
                                          struct data_in *data_in, tree expr)
 {
-  DECL_VINDEX (expr) = stream_read_tree (ib, data_in);
   /* DECL_STRUCT_FUNCTION is loaded on demand by cgraph_get_body.  */
   DECL_FUNCTION_PERSONALITY (expr) = stream_read_tree (ib, data_in);
 #ifndef ACCEL_COMPILER
index a68cd4b135bf9c44ea613952d8a2cf86a664a638..d86f3524e3a18f4743f92fcde7a8b24792952a33 100644 (file)
@@ -657,7 +657,6 @@ static void
 write_ts_function_decl_tree_pointers (struct output_block *ob, tree expr,
                                      bool ref_p)
 {
-  stream_write_tree (ob, DECL_VINDEX (expr), ref_p);
   /* DECL_STRUCT_FUNCTION is handled by lto_output_function.  */
   stream_write_tree (ob, DECL_FUNCTION_PERSONALITY (expr), ref_p);
   /* Don't stream these when passing things to a different target.  */
index 5ae467437b5ace5ba0e6f97675658046c5722fd7..d1e1b3048d4bbb300c0f9e23b849bd307a07a8c6 100644 (file)
@@ -5339,12 +5339,7 @@ free_lang_data_in_decl (tree decl)
               (DECL_CONTEXT (DECL_ABSTRACT_ORIGIN (decl))))
        DECL_ABSTRACT_ORIGIN (decl) = NULL_TREE;
 
-      /* Sometimes the C++ frontend doesn't manage to transform a temporary
-         DECL_VINDEX referring to itself into a vtable slot number as it
-        should.  Happens with functions that are copied and then forgotten
-        about.  Just clear it, it won't matter anymore.  */
-      if (DECL_VINDEX (decl) && !tree_fits_shwi_p (DECL_VINDEX (decl)))
-       DECL_VINDEX (decl) = NULL_TREE;
+      DECL_VINDEX (decl) = NULL_TREE;
     }
   else if (VAR_P (decl))
     {
@@ -8989,7 +8984,7 @@ decl_function_context (const_tree decl)
 
      C++ should really be fixed to use DECL_CONTEXT for the real context,
      and use something else for the "virtual context".  */
-  else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VINDEX (decl))
+  else if (TREE_CODE (decl) == FUNCTION_DECL && DECL_VIRTUAL_P (decl))
     context
       = TYPE_MAIN_VARIANT
        (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));