diff options
author | Michael Matz <matz@suse.de> | 2011-04-03 11:14:14 +0000 |
---|---|---|
committer | Michael Matz <matz@gcc.gnu.org> | 2011-04-03 11:14:14 +0000 |
commit | ac6a641b41a1c7ee7c50accbffdd54aea8fdd2d5 (patch) | |
tree | 3c556c12ef73e959640212541585499d983a8fcd /gcc | |
parent | 0038d4e09077594de90e1b1a53e5ff8e76cd735d (diff) | |
download | gcc-ac6a641b41a1c7ee7c50accbffdd54aea8fdd2d5.zip gcc-ac6a641b41a1c7ee7c50accbffdd54aea8fdd2d5.tar.gz gcc-ac6a641b41a1c7ee7c50accbffdd54aea8fdd2d5.tar.bz2 |
tree.c (free_lang_data_in_decl): Zero DECL_VINDEX if it's not an integer.
* 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.
From-SVN: r171904
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/tree.c | 7 | ||||
-rw-r--r-- | gcc/tree.h | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a4b56f2..4be06bf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 @@ -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) { @@ -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; }; |