This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch] PR c/7490
- From: Philippe Trebuchet <Philippe dot Trebuchet at sophia dot inria dot fr>
- To: Philippe dot Trebuchet at sophia dot inria dot fr, gdr at integrable-solutions dot net
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Nov 2002 00:00:52 +0100 (MET)
- Subject: Re: [Patch] PR c/7490
After making the changes you suggested it looks like:
testcase
void foo()
{
extern bar() __attribute__((alias "BAR"));
bar()
}
2002-11-20 Philippe Trebuchet <ptrebuc@farewell.inria.fr>
* c-semantics.c (genrtl_scope_stmt): Fix nested alias handling
Index: gcc/c-semantics.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/c-semantics.c,v
retrieving revision 1.47
diff -c -3 -p -r1.47 c-semantics.c
*** gcc/c-semantics.c 22 Sep 2002 02:03:15 -0000 1.47
--- gcc/c-semantics.c 20 Nov 2002 22:53:31 -0000
*************** genrtl_scope_stmt (t)
*** 620,628 ****
&& !TREE_ASM_WRITTEN (fn)
&& TREE_ADDRESSABLE (fn))
{
! push_function_context ();
! output_inline_function (fn);
! pop_function_context ();
}
}
}
--- 620,642 ----
&& !TREE_ASM_WRITTEN (fn)
&& TREE_ADDRESSABLE (fn))
{
! tree alias;
! alias = lookup_attribute ("alias", DECL_ATTRIBUTES (fn));
! if (alias)
! {
! alias = TREE_VALUE (TREE_VALUE (alias));
! alias = get_identifier (TREE_STRING_POINTER (alias));
! assemble_alias (fn, alias);
! }
! else if (DECL_SAVED_INSNS (fn) != NULL)
! {
! push_function_context ();
! output_inline_function (fn);
! pop_function_context ();
! }
! else
! error ("no definition for auto nested function `%s'",
! IDENTIFIER_POINTER (DECL_NAME (fn)));
}
}
}
Thanks.
--Philippe