This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix -frepo (PR c++/36364)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 24 Jun 2008 18:30:11 -0400
- Subject: Re: [C++ PATCH] Fix -frepo (PR c++/36364)
- References: <20080623160156.GZ8133@devserv.devel.redhat.com> <48616129.4060808@codesourcery.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Jun 24, 2008 at 02:03:37PM -0700, Mark Mitchell wrote:
> Jakub Jelinek wrote:
>
> > std::basic_string <char, std::char_traits <char>, __gnu_cxx::__mt_alloc
> > <char> > s;
>
> >doesn't link with -frepo. The problem is a static const data member with
> >initializer, which repo_emit_p returns 2 for (to make sure it is properly
> >optimized out when possible), but then import_export_decl sees the
> >-frepo implied -fno-implicit-templates and doesn't emit it at all.
>
> If I understand correctly, the problem is that we have a static data
> member of a template which is marked as required by collect2, but then
> when we recompile the file, is not actually emitted. Is that right?
No. The problem is const static data member, for which:
/* Const static data members initialized by constant expressions must
be processed where needed so that their definitions are
available. */
if (DECL_INTEGRAL_CONSTANT_VAR_P (decl)
&& DECL_CLASS_SCOPE_P (decl))
return 2;
Returning 2 from repo_emit_p means thatg it is handled as in -fno-repo
compilation - it never makes it into the *.rpo file, neither
as O _Z...terminal, nor as C _Z...terminal. But as -frepo implies
-fno-implicit-templates, in this case it works as in -fno-implicit-templates
compilation - which means explicit instantiation is required.
Jakub