This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: HPPA constructor merge patch, PR middle-end/45388
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, hubicka at ucw dot cz, dave at hiauly1 dot hia dot nrc dot ca
- Date: Mon, 27 Sep 2010 14:05:00 -0700
- Subject: Re: HPPA constructor merge patch, PR middle-end/45388
- References: <201009272029.o8RKTDM18735@lucas.cup.hp.com> <4CA0FF88.3080900@redhat.com>
- Reply-to: sje at cup dot hp dot com
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