public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39967] New: Ignored static qualifier on a local variable
@ 2009-04-29 16:28 sergei_lus at yahoo dot com
2009-04-29 16:45 ` [Bug c++/39967] " pinskia at gcc dot gnu dot org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: sergei_lus at yahoo dot com @ 2009-04-29 16:28 UTC (permalink / raw)
To: gcc-bugs
The following (simplified) code originates from peren_c++ (Sec6/7/R06263.r0):
#include <stdio.h>
int ctor_calls;
class A {
int x;
public: // check that was 0 before initialized
A() {ctor_calls++;}
};
main(){
for(int i =0; i < 10; i++)
static A a;
printf("%d\n", ctor_calls);
}
The output with 3.4.6 port is "0", with 4.3.2 it is "10" (-O0,-O2).
--
Summary: Ignored static qualifier on a local variable
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sergei_lus at yahoo dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39967
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/39967] Ignored static qualifier on a local variable
2009-04-29 16:28 [Bug c++/39967] New: Ignored static qualifier on a local variable sergei_lus at yahoo dot com
@ 2009-04-29 16:45 ` pinskia at gcc dot gnu dot org
2009-04-29 16:47 ` paolo dot carlini at oracle dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-29 16:45 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from pinskia at gcc dot gnu dot org 2009-04-29 16:44 -------
Works for me on i386-darwin and i686-linux-gnu on the trunk, I get the output
of 1 which is the correct value.
With i686-linux-gnu it works also with Debian's GCC 4.3.2.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|major |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39967
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/39967] Ignored static qualifier on a local variable
2009-04-29 16:28 [Bug c++/39967] New: Ignored static qualifier on a local variable sergei_lus at yahoo dot com
2009-04-29 16:45 ` [Bug c++/39967] " pinskia at gcc dot gnu dot org
@ 2009-04-29 16:47 ` paolo dot carlini at oracle dot com
2009-04-29 16:48 ` paolo dot carlini at oracle dot com
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-29 16:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from paolo dot carlini at oracle dot com 2009-04-29 16:47 -------
Target? On x86_64, I can't reproduce your outputs, I'm consistently getting 1,
irrespective of the optimization level and of the release branch (by the way,
only 4.3 and 4.4 are maintained today)
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |major
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39967
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/39967] Ignored static qualifier on a local variable
2009-04-29 16:28 [Bug c++/39967] New: Ignored static qualifier on a local variable sergei_lus at yahoo dot com
2009-04-29 16:45 ` [Bug c++/39967] " pinskia at gcc dot gnu dot org
2009-04-29 16:47 ` paolo dot carlini at oracle dot com
@ 2009-04-29 16:48 ` paolo dot carlini at oracle dot com
2009-04-29 18:02 ` sergei_lus at yahoo dot com
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-29 16:48 UTC (permalink / raw)
To: gcc-bugs
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|major |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39967
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/39967] Ignored static qualifier on a local variable
2009-04-29 16:28 [Bug c++/39967] New: Ignored static qualifier on a local variable sergei_lus at yahoo dot com
` (2 preceding siblings ...)
2009-04-29 16:48 ` paolo dot carlini at oracle dot com
@ 2009-04-29 18:02 ` sergei_lus at yahoo dot com
2009-04-29 18:18 ` paolo dot carlini at oracle dot com
2009-04-30 19:32 ` sergei_lus at yahoo dot com
5 siblings, 0 replies; 7+ messages in thread
From: sergei_lus at yahoo dot com @ 2009-04-29 18:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from sergei_lus at yahoo dot com 2009-04-29 18:02 -------
Thanks for prompt response...
This is an unsupported target, so I guess i will have to narrow it down a bit.
Any suggestions on where to start?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39967
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/39967] Ignored static qualifier on a local variable
2009-04-29 16:28 [Bug c++/39967] New: Ignored static qualifier on a local variable sergei_lus at yahoo dot com
` (3 preceding siblings ...)
2009-04-29 18:02 ` sergei_lus at yahoo dot com
@ 2009-04-29 18:18 ` paolo dot carlini at oracle dot com
2009-04-30 19:32 ` sergei_lus at yahoo dot com
5 siblings, 0 replies; 7+ messages in thread
From: paolo dot carlini at oracle dot com @ 2009-04-29 18:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from paolo dot carlini at oracle dot com 2009-04-29 18:18 -------
Well, first, spell-out *which* specific target it is. Actually, however, if it
is a completely unsupported target, I'm not even sure it makes sense to keep
the PR open... Other maintainers may know better than me: it's the first time I
triage a PR asking support for a bug of an unsupported target ;)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39967
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug c++/39967] Ignored static qualifier on a local variable
2009-04-29 16:28 [Bug c++/39967] New: Ignored static qualifier on a local variable sergei_lus at yahoo dot com
` (4 preceding siblings ...)
2009-04-29 18:18 ` paolo dot carlini at oracle dot com
@ 2009-04-30 19:32 ` sergei_lus at yahoo dot com
5 siblings, 0 replies; 7+ messages in thread
From: sergei_lus at yahoo dot com @ 2009-04-30 19:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from sergei_lus at yahoo dot com 2009-04-30 19:32 -------
Please close this issue. I think the real problem is in libc, not in the
compiler. (test passes with -fno-threadsafe-statics). Thank you for support.
--
sergei_lus at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39967
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-04-30 19:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-29 16:28 [Bug c++/39967] New: Ignored static qualifier on a local variable sergei_lus at yahoo dot com
2009-04-29 16:45 ` [Bug c++/39967] " pinskia at gcc dot gnu dot org
2009-04-29 16:47 ` paolo dot carlini at oracle dot com
2009-04-29 16:48 ` paolo dot carlini at oracle dot com
2009-04-29 18:02 ` sergei_lus at yahoo dot com
2009-04-29 18:18 ` paolo dot carlini at oracle dot com
2009-04-30 19:32 ` sergei_lus at yahoo dot com
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).