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]

Re: C++ PATCH for mangle11.C


On Tue, Feb 16, 2010 at 01:03:51PM -0800, Andrew Pinski wrote:
> On Tue, Feb 16, 2010 at 1:01 PM, Mike Stump <mikestump@comcast.net> wrote:
> >
> > ? ? ? ?* decl2.c (maybe_make_one_only): Be sure to always
> > ? ? ? ?call cxx_comdat_group, as it can produce abi warnings
> > ? ? ? ?for the symbol.
> >
> > Doing diffs in cp:
> > --- cp/decl2.c.~1~ ? ? ?2010-02-15 17:16:36.000000000 -0800
> > +++ cp/decl2.c ?2010-02-16 12:33:33.000000000 -0800
> > @@ -1622,6 +1622,10 @@ maybe_make_one_only (tree decl)
> > ? if (! flag_weak)
> > ? ? return;
> >
> > + ?/* 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);
> 
> I think you want to move tree name definition before the checking of flag_weak.
> 
> Thanks,
> Andrew Pinski

The variation...

Index: gcc/cp/decl2.c
===================================================================
--- gcc/cp/decl2.c	(revision 156842)
+++ 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)
 	{

eliminates the failing testcases...

FAIL: g++.dg/abi/mangle11.C  (test for warnings, line 10)
FAIL: g++.dg/abi/mangle11.C (test for excess errors)
FAIL: g++.dg/abi/mangle12.C  (test for warnings, line 11)
FAIL: g++.dg/abi/mangle12.C (test for excess errors)
FAIL: g++.dg/abi/mangle17.C  (test for warnings, line 8)
FAIL: g++.dg/abi/mangle17.C  (test for warnings, line 11)
FAIL: g++.dg/abi/mangle17.C (test for excess errors)
FAIL: g++.dg/abi/mangle20-2.C  (test for warnings, line 13)
FAIL: g++.dg/abi/mangle20-2.C (test for excess errors)

...on x86_64-apple-darwin10.
             Jack


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