This is the mail archive of the gcc-bugs@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]

Re: c++/6611: [PATCH] Non-weak emission of`std::__default_alloc_template[...]' on platform(s) where it should beweak


We clear DECL_EXTERNAL when we start to define a function.  In this case
when we were supposed to clear it again, it was already referenced, so
DECL_NEEDED_P was true, so we ended up emitting it even though
import_export_decl tried to suppress it.

Yet another ugly tweak to the C++ linkage morass.  I'll get back to work on
the rewrite RSN.

Tested i686-pc-linux-gnu, applied to trunk.  I'll come up with a testcase
soon, but I want to get this in now so it stops interfering with libstdc++
work.

2002-05-18  Jason Merrill  <jason@redhat.com>

	* decl2.c (import_export_decl): If we clear
	DECL_NOT_REALLY_EXTERN, make sure DECL_EXTERNAL is set.

*** decl2.c.~1~	Thu May 16 05:52:12 2002
--- decl2.c	Fri May 17 22:59:52 2002
*************** import_export_decl (decl)
*** 2481,2487 ****
  	    comdat_linkage (decl);
  	}
        else
! 	DECL_NOT_REALLY_EXTERN (decl) = 0;
      }
    else if (DECL_FUNCTION_MEMBER_P (decl))
      {
--- 2481,2490 ----
  	    comdat_linkage (decl);
  	}
        else
! 	{
! 	  DECL_EXTERNAL (decl) = 1;
! 	  DECL_NOT_REALLY_EXTERN (decl) = 0;
! 	}
      }
    else if (DECL_FUNCTION_MEMBER_P (decl))
      {
*************** import_export_decl (decl)
*** 2497,2502 ****
--- 2500,2508 ----
  			 && ! flag_implement_inlines
  			 && !DECL_VINDEX (decl)));
  
+ 	      if (!DECL_NOT_REALLY_EXTERN (decl))
+ 		DECL_EXTERNAL (decl) = 1;
+ 
  	      /* Always make artificials weak.  */
  	      if (DECL_ARTIFICIAL (decl) && flag_weak)
  		comdat_linkage (decl);

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