public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Jason Merrill <jason@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: [C++ PATCH] Fix -frepo (PR c++/34178, c++/34340, take 3)
Date: Fri, 07 Dec 2007 17:55:00 -0000	[thread overview]
Message-ID: <47598920.7090900@codesourcery.com> (raw)
In-Reply-To: <20071207103256.GD13207@devserv.devel.redhat.com>

Jakub Jelinek wrote:

> No, I'm talking about the original compilation, which creates the .rpo file.
> 
> Perhaps even shorter testcase with ./cc1plus -frepo testcase.C is:
> struct A { int a; };
> template <typename T> struct D { static const A b; };
> template<typename T> const A D<T>::b = { 2 };
> template class D<A>;
> int main () { }
> 
> Here there is just one static data member.
> finish_static_data_member_decl marks D<T>::b as TREE_USED because it is
> const. 

Do you really mean D<T> or D<A>?  TREE_USED on D<T>::b should not matter
as that's not a real thing; only D<A>::b might show up in the object file.

Anyhow, the explicit instantiation directive should result in us
emitting D<A>::b.  I don't think that -frepo should cause us not to emit
things that the user has explicitly instantiated.

I would expect that the right code in repo_emit_p would be:

  /* Variables that can appear in integral constant-expressions must
     be instantiated so that the values of th variables are
     available.  */
  if (DECL_INTEGRAL_CONSTANT_VAR_P (decl))
    return 2;
  /* Explicit instantiations should be handled normally even when using
     a repository.  */
  if (DECL_EXPLICIT_INSTANTIATION (decl))
    return 2;

Does that work?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

  reply	other threads:[~2007-12-07 17:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-27 22:30 [C++ PATCH] Fix -frepo (PR c++/34178) Jakub Jelinek
2007-12-05 15:14 ` [C++ PATCH] Fix -frepo (PR c++/34178, take 2) Jakub Jelinek
2007-12-06  1:03   ` Mark Mitchell
2007-12-06 10:48     ` Jakub Jelinek
2007-12-07  4:28       ` Mark Mitchell
2007-12-07 10:35         ` [C++ PATCH] Fix -frepo (PR c++/34178, c++/34340, take 3) Jakub Jelinek
2007-12-07 17:55           ` Mark Mitchell [this message]
2007-12-07 22:53             ` Jakub Jelinek
2007-12-08  1:27               ` Mark Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47598920.7090900@codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jason@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).