This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6611: [PATCH] Non-weak emission of`std::__default_alloc_template[...]' on platform(s) where it should beweak
- From: Jason Merrill <jason at redhat dot com>
- To: gcc-gnats at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Cc: bkoz at redhat dot com, gcc-bugs at gcc dot gnu dot org, ljrittle at acm dot org,pfeifer at dbai dot tuwien dot ac dot at
- Date: Sat, 18 May 2002 05:42:33 +0100
- Subject: Re: c++/6611: [PATCH] Non-weak emission of`std::__default_alloc_template[...]' on platform(s) where it should beweak
- References: <20020515121446.22146.qmail@sources.redhat.com>
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);