This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]