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: HPPA constructor merge patch, PR middle-end/45388


On Mon, 2010-09-27 at 13:33 -0700, Richard Henderson wrote:
> On 09/27/2010 01:29 PM, Steve Ellcey wrote:
> > 	PR middle-end/45388
> > 	* ipa.c: Set TREE_PUBLIC on constructors/destructors.
> 
> Not ok.  Constructors should not be public when we
> do have .ctor/.dtor support.
> 
> This is supposed to be handled in cgraph_build_static_cdtor,
> 
>   if (!targetm.have_ctors_dtors)
>     {
>       TREE_PUBLIC (decl) = 1;
>       DECL_PRESERVE_P (decl) = 1;
>     }
> 
> there.  Can you figure out if that bit isn't being triggered?
> 
> 
> r~

It is being triggered, but for a different routine.  In build_cdtor we
are setting TREE_PUBLIC on _GLOBAL__I__ZN2c12f6Ev.  In
cgraph_build_static_cdtor we are setting TREE_PUBLIC on
_GLOBAL__I_65535_0__ZN2c12f6Ev.  This is for the test case
g++.dg/abi/covariant3.C.

When I look at the code, I see that _GLOBAL__I__ZN2c12f6Ev is never
(directly) called by anything but it calls
_Z41__static_initialization_and_destruction_0ii, which
_GLOBAL__I_65535_0__ZN2c12f6Ev also calls.  Is _GLOBAL__I__ZN2c12f6Ev
the old (premerged) constructor that should no longer be used and has
been replaced by GLOBAL__I_65535_0__ZN2c12f6Ev?  In this case we
wouldn't want it global and collect2 should not see or call it, but
because the HP nm/linker/whatever HP-UX collect2 uses to find global
names sees it, we still try to call it even when we shouldn't.  But if
it has essentially been replaced, why wasn't it just removed entirely?

Steve Ellcey
sje@cup.hp.com


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