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]

[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)
 	{


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