* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
@ 2004-08-16 21:50 ` pinskia at gcc dot gnu dot org
2004-08-17 1:49 ` dje at gcc dot gnu dot org
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-16 21:50 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
Severity|normal |critical
Keywords| |wrong-code
Target Milestone|--- |3.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX 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
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-08-17 1:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dje at gcc dot gnu dot org 2004-08-17 01:49 -------
The divergence appears to occur in cp/decl.c:finish_function(). In the -frepo
case, TREE_NOTHROW (fndecl) is not set, while in the non-frepo case, it is. The
templates are processed a different number of times with the different options,
so it appears that the compiler is noticing something or remembering something
that was not evident with the other option.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX 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
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-08-17 3:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-08-17 03:35 -------
I understand why the NOTHROW bit is changing, and, in fact, I'm not really sure
how my patch made this different. The reason it is changing is that during the
initial build the template is not instantiated (in the hopes that some other
translation unit will instantiate it). Because it is not instantiated, the
compiler does not know whether or not the body of the template could throw an
exception. So, it does not set the NOTHROW bit. When reocmpiling (from
collect2), the template will be instantiated, and so the compiler then cleverly
notices that it cannot throw an exception.
I will look into why this is causing a problem.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (2 preceding siblings ...)
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
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-08-17 3:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-08-17 03:37 -------
OK, now I understand why this is causing a problem -- the next question is what
to do about it...
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (3 preceding siblings ...)
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
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-08-17 5:50 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-08-17 05:50 -------
It looks like collect2.c does template instantiation first, followed by
discovery of global constructors -- on all platforms except those that define
COLLECT_EXPORT_LIST, i.e., all platforms except AIX. On AIX, we do these things
in the opposite order: constructor discovery first, followed by template
instantiation. The AIX order does not seem safe, in general: instantiating
templates can certainly result in the need for additional static constructors.
I'm not sure how best to fix this. In the abstract, it's wrong of the C++ front
end not to instantiate the template in all cases; the standard requires we
instantiate it. However, with -frepo, we've always tried to avoid instantiating
templates unncessarily. Without doing full optimization on the template body,
we wouldn't be assured of getting NOTHROW set correctly anyhow.
I guess I need to understand why collect2 does things in the opposite order in AIX.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (4 preceding siblings ...)
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
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-08-17 5:53 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-08-17 05:53 -------
So we should confirm this.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-08-17 05:53:10
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (5 preceding siblings ...)
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
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-08-17 15:08 UTC (permalink / raw)
To: gcc-bugs
------- 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.
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.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (6 preceding siblings ...)
2004-08-17 15:08 ` dje at gcc dot gnu dot org
@ 2004-08-17 15:49 ` mark at codesourcery dot com
2004-08-17 15:56 ` dje at watson dot ibm dot com
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: mark at codesourcery dot com @ 2004-08-17 15:49 UTC (permalink / raw)
To: gcc-bugs
------- 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
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (7 preceding siblings ...)
2004-08-17 15:49 ` mark at codesourcery dot com
@ 2004-08-17 15:56 ` dje at watson dot ibm dot com
2004-08-17 16:01 ` mark at codesourcery dot com
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dje at watson dot ibm dot com @ 2004-08-17 15:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dje at watson dot ibm dot com 2004-08-17 15:56 -------
Subject: Re: [3.5 Regression] Repo functionality partially broken on AIX
I didn't know if gcc's behavior was correct. If you agree that it
is, I will develop the fix for collect2.c so that you can concentrate on
other things. I didn't know if AIX was raising a problem that was hidden
on other systems.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [3.5 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (8 preceding siblings ...)
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
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: mark at codesourcery dot com @ 2004-08-17 16:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mark at codesourcery dot com 2004-08-17 16:01 -------
Subject: Re: [3.5 Regression] Repo functionality partially
broken on AIX
dje at watson dot ibm dot com wrote:
>------- Additional Comments From dje at watson dot ibm dot com 2004-08-17 15:56 -------
>Subject: Re: [3.5 Regression] Repo functionality partially broken on AIX
>
> I didn't know if gcc's behavior was correct.
>
I believe so, yes. Basically, it is being conservative about whether or
not the template instantiation can throw, until it is sure.
>If you agree that it
>is, I will develop the fix for collect2.c so that you can concentrate on
>other things.
>
Thanks!
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [4.0 Regression] Repo functionality partially broken on AIX
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (9 preceding siblings ...)
2004-08-17 16:01 ` mark at codesourcery dot com
@ 2004-10-14 14:49 ` 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
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dje at gcc dot gnu dot org @ 2004-10-14 14:49 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dje at gcc dot gnu dot org 2004-10-14 14:49 -------
reducing priority
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|critical |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [4.0 Regression] Repo functionality partially broken on AIX (collect2.c)
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (10 preceding siblings ...)
2004-10-14 14:49 ` [Bug c++/17053] [4.0 " dje at gcc dot gnu dot org
@ 2004-11-26 23:28 ` 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
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: neroden at gcc dot gnu dot org @ 2004-11-26 23:28 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From neroden at gcc dot gnu dot org 2004-11-26 23:28 -------
DJE said he'd develop the collect2 fix, so assigning...
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |dje at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Summary|[4.0 Regression] Repo |[4.0 Regression] Repo
|functionality partially |functionality partially
|broken on AIX |broken on AIX (collect2.c)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [4.0/4.1 Regression] Repo functionality partially broken on AIX (collect2.c)
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (11 preceding siblings ...)
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 ` dje at gcc dot gnu dot org
2005-04-17 3:01 ` mmitchel at gcc dot gnu dot org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dje at gcc dot gnu dot org @ 2005-03-24 19:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From dje at gcc dot gnu dot org 2005-03-24 19:58 -------
reducing priority again. I do not see a clean way to rescan the application
from the tlink loop. -frepo is not a primary feature and -frepo continues to
work for most real applications.
--
What |Removed |Added
----------------------------------------------------------------------------
Priority|P2 |P3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [4.0/4.1 Regression] Repo functionality partially broken on AIX (collect2.c)
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (12 preceding siblings ...)
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
15 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-04-17 3:01 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-04-17 03:00 -------
Retargeted to 4.0.1.
AIX maintainer has indicated that this bug is not particularly critical, and
that the problems are difficult to solve.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.0 |4.0.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [4.0/4.1 Regression] Repo functionality partially broken on AIX (collect2.c)
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (13 preceding siblings ...)
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
15 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-07-06 16:45 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2005-07-06 16:44 -------
Postponed until 4.0.2.
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.1 |4.0.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/17053] [4.0/4.1 Regression] Repo functionality partially broken on AIX (collect2.c)
2004-08-16 21:47 [Bug c++/17053] New: [3.5 Regression] Repo functionality partially broken on AIX dje at gcc dot gnu dot org
` (14 preceding siblings ...)
2005-07-06 16:45 ` mmitchel at gcc dot gnu dot org
@ 2005-09-27 16:17 ` mmitchel at gcc dot gnu dot org
15 siblings, 0 replies; 17+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2005-09-27 16:17 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.2 |4.0.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17053
^ permalink raw reply [flat|nested] 17+ messages in thread