public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "mark at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
Date: Tue, 17 Aug 2004 15:49:00 -0000	[thread overview]
Message-ID: <20040817154940.4607.qmail@sourceware.org> (raw)
In-Reply-To: <20040816214702.17053.dje@gcc.gnu.org>


------- Additional Comments From mark at codesourcery dot com  2004-08-17 15:49 -------
Subject: Re:  [3.5 Regression] Repo functionality partially
 broken on AIX

dje at gcc dot gnu dot org wrote:

>------- Additional Comments From dje at gcc dot gnu dot org  2004-08-17 15:08 -------
>Note that the divergence occurs with -frepo before the repo file has been 
>updated with information about which templates should be instantiated and 
>recompiled.
>  
>
Right, I understand.  With the "-frepo" switch on the first compilation, 
G++ will avoid instantiating the template, and therefore will not learn 
that it cannot throw.  Without the "-frepo" switch, it will have to 
instantiate the template, will therefore learn that it cannot throw.

>AIX performs constructor discovery first because the garbage collecting linker 
>may find no references to static constructors before the scan, which will cause 
>it not to link in the static constructors, leaving nothing for the scan to find.
>
I understand.

There might have been bugs in this area before; for example, I'd expect:

  int f();

  template <typename T>
  struct S {
    static int i;
  };

 template <typename T>
 int S<T>::i = f();
 
 int main () { return S<int>::i; }

to result in a global constructor call without -frepo, but not with 
-frepo, and therefore have the same problem.  However, it may be that 
the lack of weak symbols means that without -frepo the compiler delays 
instantiation of S<int>::i, and that we therefore skirt this particular 
problem.

In any case, I don't think there's really any way to get NOTHROW set 
correctly 100% of the time unless we actually generate code (all the way 
through the optimizers) for every template that might be instantiated.  
So, I think this problem needs to be addressed in some other way.

I think that that the best thing would be to make the constructor 
discovery process iterative in the case of AIX.  After each cycle of 
recompilation, we need to regenerate the list.  If you agree, I will try 
to write the code, but I don't have an AIX system, so you might have to 
do the testing.

Thanks,



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053


  parent reply	other threads:[~2004-08-17 15:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-16 21:47 [Bug c++/17053] New: " dje at gcc dot gnu dot org
2004-08-16 21:50 ` [Bug c++/17053] " pinskia at gcc dot gnu dot org
2004-08-17  1:49 ` dje at gcc dot gnu dot org
2004-08-17  3:35 ` mmitchel at gcc dot gnu dot org
2004-08-17  3:37 ` mmitchel at gcc dot gnu dot org
2004-08-17  5:50 ` mmitchel at gcc dot gnu dot org
2004-08-17  5:53 ` pinskia at gcc dot gnu dot org
2004-08-17 15:08 ` dje at gcc dot gnu dot org
2004-08-17 15:49 ` mark at codesourcery dot com [this message]
2004-08-17 15:56 ` dje at watson dot ibm dot com
2004-08-17 16:01 ` mark at codesourcery dot com
2004-10-14 14:49 ` [Bug c++/17053] [4.0 " dje at gcc dot gnu dot org
2004-11-26 23:28 ` [Bug c++/17053] [4.0 Regression] Repo functionality partially broken on AIX (collect2.c) neroden at gcc dot gnu dot org
2005-03-24 19:58 ` [Bug c++/17053] [4.0/4.1 " dje at gcc dot gnu dot org
2005-04-17  3:01 ` mmitchel at gcc dot gnu dot org
2005-07-06 16:45 ` mmitchel at gcc dot gnu dot org
2005-09-27 16:17 ` mmitchel at gcc dot gnu dot org

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=20040817154940.4607.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).