This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[pretty-ipa] Fix handling of weak functions
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 19 Mar 2009 13:31:42 +0100
- Subject: [pretty-ipa] Fix handling of weak functions
Hi,
weak functions can be localized, the test in ipa-sra in fact
disqualified all inline functions from headers.
Honza
2009-03-15 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_make_node_local): Weak functions needs localizing
too.
* ipa-sra.c (ipa_early_sra): Do not disqualify weak fce.
Index: cgraph.c
===================================================================
*** cgraph.c (revision 144931)
--- cgraph.c (working copy)
*************** void
*** 1763,1769 ****
cgraph_make_node_local (struct cgraph_node *node)
{
gcc_assert (cgraph_node_can_be_local_p (node));
! if (DECL_COMDAT (node->decl) || DECL_EXTERNAL (node->decl))
{
DECL_COMDAT (node->decl) = 0;
DECL_ONE_ONLY (node->decl) = 0;
--- 1763,1771 ----
cgraph_make_node_local (struct cgraph_node *node)
{
gcc_assert (cgraph_node_can_be_local_p (node));
! if (DECL_WEAK (node->decl)
! || DECL_COMDAT (node->decl)
! || DECL_EXTERNAL (node->decl))
{
DECL_COMDAT (node->decl) = 0;
DECL_ONE_ONLY (node->decl) = 0;
Index: ipa-sra.c
===================================================================
*** ipa-sra.c (revision 144931)
--- ipa-sra.c (working copy)
*************** ipa_early_sra (void)
*** 2644,2653 ****
VEC (new_parm_note_t, heap) *notes;
int ret = 0;
! /* DECL_WEAK test is required because otherwise we might get $symbolis
! already defined assembler messages (as we e.g. get for libgomp
! collapse-2.exe test case (at -O1). */
! if (!cgraph_node_can_be_local_p (node) || DECL_WEAK (current_function_decl))
{
if (dump_file)
fprintf (dump_file, "Function not local to this compilation unit.\n");
--- 2644,2650 ----
VEC (new_parm_note_t, heap) *notes;
int ret = 0;
! if (!cgraph_node_can_be_local_p (node))
{
if (dump_file)
fprintf (dump_file, "Function not local to this compilation unit.\n");