This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH][revised] C++ PATCH for mangle11.C
- From: Jack Howarth <howarth at bromo dot med dot uc dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: mikestump at comcast dot net
- Date: Tue, 23 Feb 2010 09:28:49 -0500
- Subject: [PATCH][revised] C++ PATCH for mangle11.C
The attached patch is Mike's original proposed patch
from http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00641.html
to solve PR 4059 adjusted as requested by Andrew Pinski in
http://gcc.gnu.org/ml/gcc-patches/2010-02/msg00642.html. This
change eliminates the g++.dg/abi/mangle*.C failures without
regressions on x86_64-apple-darwin10. Okay for gcc trunk?
Jack
2010-02-23 Mike Stump <mikestump@comcast.net>
Jack Howarth <howarth@bromo.med.uc.edu>
PR 40459
* decl2.c (maybe_make_one_only): Be sure to always
call cxx_comdat_group, as it can produce abi warnings
for the symbol.
Index: gcc/cp/decl2.c
===================================================================
--- gcc/cp/decl2.c (revision 157003)
+++ gcc/cp/decl2.c (working copy)
@@ -1613,6 +1613,10 @@
void
maybe_make_one_only (tree decl)
{
+ /* Do this first, as this can produce abi warnings, and we want to
+ ensure the context of those warnings doesn't change. */
+ tree name = cxx_comdat_group (decl);
+
/* We used to say that this was not necessary on targets that support weak
symbols, because the implicit instantiations will defer to the explicit
one. However, that's not actually the case in SVR4; a strong definition
@@ -1631,7 +1635,7 @@
|| (! DECL_EXPLICIT_INSTANTIATION (decl)
&& ! DECL_TEMPLATE_SPECIALIZATION (decl)))
{
- make_decl_one_only (decl, cxx_comdat_group (decl));
+ make_decl_one_only (decl, name);
if (TREE_CODE (decl) == VAR_DECL)
{