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] Fix -frepo (PR c++/36364)


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


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