diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-02 15:23:56 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-02 15:23:56 +0000 |
commit | 752098c83a84a75dc1fc565cfa12e1ede3ad149a (patch) | |
tree | aa99241265ddf88291e648e9f877d111090e5833 /gcc/c/c-decl.c | |
parent | d57c59236cf53035a2402f6656dba43ed4db8276 (diff) | |
download | gcc-752098c83a84a75dc1fc565cfa12e1ede3ad149a.tar.gz |
* c-decl.c (duplicate_decls): CLear DECL_STRUCT_FUNCTION before
releasing symbol.
* gcc.c-torture/compile/section.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212234 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c/c-decl.c')
-rw-r--r-- | gcc/c/c-decl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 7c37edfd372..3dec90b23ed 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -2575,7 +2575,14 @@ duplicate_decls (tree newdecl, tree olddecl) merge_decls (newdecl, olddecl, newtype, oldtype); - /* The NEWDECL will no longer be needed. */ + /* The NEWDECL will no longer be needed. + + Before releasing the node, be sure to remove function from symbol + table that might have been inserted there to record comdat group. + Be sure to however do not free DECL_STRUCT_FUNCTION because this + structure is shared in between NEWDECL and OLDECL. */ + if (TREE_CODE (newdecl) == FUNCTION_DECL) + DECL_STRUCT_FUNCTION (newdecl) = NULL; if (TREE_CODE (newdecl) == FUNCTION_DECL || TREE_CODE (newdecl) == VAR_DECL) { |