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, take 2)
Date: Fri, 07 Dec 2007 04:28:00 -0000	[thread overview]
Message-ID: <4758CBCB.3030604@codesourcery.com> (raw)
In-Reply-To: <20071206104553.GG25112@devserv.devel.redhat.com>

Jakub Jelinek wrote:

> But in repo7.C the const static data member is aggregate, not integral or
> enum.  finish_static_data_member has
>   /* Force the compiler to know when an uninitialized static const
>      member is being used.  */
>   if (CP_TYPE_CONST_P (TREE_TYPE (decl)) && init == 0)
>     TREE_USED (decl) = 1;
> Later on duplicate_decls clears DECL_EXTERNAL on this decl (because a
> definition was parsed) and after tsubst finish_static_data_member
> sets TREE_USED again.  Next in instantiate_decl we call
> 14742     if (TREE_PUBLIC (d) && !DECL_REALLY_EXTERN (d) && !repo_emit_p (d))
> on this, and with DECL_INTEGRAL_CONSTANT_VAR_P test in repo_emit_p that
> returns 0, which means the rest of instantiate_decl is bypassed for this
> decl.  Then this makes into cgraph, which emits it, as the decl
> is !DECL_EXTERNAL, TREE_USED etc. (and even emits it without the
> initialized as common symbol, as DECL_INITIAL is NULL).

I'm confused.  Are we talking about the second time we process the file,
at link-time?

And, at that point, does the .rpo file tells the compiler that it needs
to define "A D<B>::b"?  If so, repo_emit_p should be returning true anyhow.

Otherwise, I think something is just going wrong with explicit template
instantiation.  Once we decide that D<B>::b is going to be emitted in
the front end (i.e., clear DECL_EXTERNAL), we have to process its
initializer.  But, the fact that it's const doesn't seem relevant to me
at all.

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

  reply	other threads:[~2007-12-07  4:28 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 [this message]
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
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=4758CBCB.3030604@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).