From 042d26c8e62bd203dcf904f2eb4d7de0500ad1b1 Mon Sep 17 00:00:00 2001 From: davidxl Date: Tue, 29 Apr 2014 23:44:57 +0000 Subject: [PATCH] Fix SPEC06 failure -- do not clear DECL_CONTEXT to allow devirt hook to do cleanup git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/google@209917 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc-4_9/gcc/l-ipo.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gcc-4_9/gcc/l-ipo.c b/gcc-4_9/gcc/l-ipo.c index 623befb0a9d..057f42d79ac 100644 --- a/gcc-4_9/gcc/l-ipo.c +++ b/gcc-4_9/gcc/l-ipo.c @@ -1707,7 +1707,10 @@ externalize_weak_decl (tree decl) DECL_EXTERNAL (decl) = 1; TREE_STATIC (decl) = 0; DECL_INITIAL (decl) = NULL; - DECL_CONTEXT (decl) = NULL; + + /* Keep the context so that devirt_variable_node_removal_hook + can do cleanup properly for vtables. + DECL_CONTEXT (decl) = NULL; */ } /* Return a unique sequence number for NAME. This is needed to avoid @@ -1890,7 +1893,9 @@ promote_static_var_func (unsigned module_id, tree decl, bool is_extern) DECL_EXTERNAL (decl) = 1; /* Keep the initializer to allow const prop. */ /* DECL_INITIAL (decl) = 0; */ - DECL_CONTEXT (decl) = 0; + /* Keep the context so that devirt_variable_node_removal_hook + can do cleanup properly for vtables. + DECL_CONTEXT (decl) = 0; */ } /* else Function body will be deleted later before expansion. */ @@ -1925,7 +1930,9 @@ process_module_scope_static_var (struct varpool_node *vnode) { DECL_ASSEMBLER_NAME (decl); } - DECL_CONTEXT (decl) = NULL; + /* Keep the context so that devirt_variable_node_removal_hook + can do cleanup properly for vtables. + DECL_CONTEXT (decl) = NULL; */ } } else -- 2.11.4.GIT