OSDN Git Service

* tree.c (free_lang_data_in_decl): Zero DECL_VINDEX if it's not
authormatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 3 Apr 2011 11:14:14 +0000 (11:14 +0000)
committermatz <matz@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 3 Apr 2011 11:14:14 +0000 (11:14 +0000)
an integer.
* tree.h (tree_decl_non_common.vindex): Adjust comment.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171904 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree.c
gcc/tree.h

index a4b56f2..4be06bf 100644 (file)
@@ -1,5 +1,11 @@
 2011-04-03  Michael Matz  <matz@suse.de>
 
+       * tree.c (free_lang_data_in_decl): Zero DECL_VINDEX if it's not
+       an integer.
+       * tree.h (tree_decl_non_common.vindex): Adjust comment.
+
+2011-04-03  Michael Matz  <matz@suse.de>
+
        * cgraphbuild.c (record_reference): Canonicalize constructor
        values.
        * gimple-fold.c (canonicalize_constructor_val): Accept being called
index eec4a8b..f1ac7a6 100644 (file)
@@ -4647,6 +4647,13 @@ free_lang_data_in_decl (tree decl)
          && RECORD_OR_UNION_TYPE_P
               (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) && !host_integerp (DECL_VINDEX (decl), 0))
+       DECL_VINDEX (decl) = NULL_TREE;
     }
   else if (TREE_CODE (decl) == VAR_DECL)
     {
index b503361..053076f 100644 (file)
@@ -3229,7 +3229,7 @@ struct GTY(())
   tree arguments;
   /* Almost all FE's use this.  */
   tree result;
-  /* C++ uses this in namespaces.  */
+  /* C++ uses this in namespaces and function_decls.  */
   tree vindex;
 };