From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4625 invoked by alias); 17 Aug 2004 15:49:41 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 4608 invoked by alias); 17 Aug 2004 15:49:40 -0000 Date: Tue, 17 Aug 2004 15:49:00 -0000 Message-ID: <20040817154940.4607.qmail@sourceware.org> From: "mark at codesourcery dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040816214702.17053.dje@gcc.gnu.org> References: <20040816214702.17053.dje@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX X-Bugzilla-Reason: CC X-SW-Source: 2004-08/txt/msg01680.txt.bz2 List-Id: ------- 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 struct S { static int i; }; template int S::i = f(); int main () { return S::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::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