Commit 22e1cf1c by Jan Hubicka Committed by Jan Hubicka

c-decl.c (duplicate_decls): CLear DECL_STRUCT_FUNCTION before releasing symbol.

	* c-decl.c (duplicate_decls): CLear DECL_STRUCT_FUNCTION before
	releasing symbol.

	* gcc.c-torture/compile/section.c: New testcase.

Co-Authored-By: Chen Gang <gang.chen.5i5j@gmail.com>

From-SVN: r212234
parent 9490fda6
2014-07-02 Jan Hubicka <hubicka@ucw.cz>
Chen Gang <gang.chen.5i5j@gmail.com>
* c-decl.c (duplicate_decls): CLear DECL_STRUCT_FUNCTION before
releasing symbol.
2014-07-01 Marek Polacek <polacek@redhat.com>
* c-typeck.c (convert_for_assignment): Pass OPT_Wint_conversion
......
......@@ -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)
{
......
2014-07-02 Jan Hubicka <hubicka@ucw.cz>
Chen Gang <gang.chen.5i5j@gmail.com>
* gcc.c-torture/compile/section.c: New testcase.
2014-07-02 Christian Bruel <christian.bruel@st.com>
PR target/29349
......
/* { dg-do compile } */
/* { dg-require-effective-target named_sections } */
extern int __attribute__ ((__section__(".init.text"))) elv_register(void)
{
return 0;
}
extern typeof(elv_register) elv_register;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment