public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17996] New: [3.4/4.0 regression] Destructor run twice
@ 2004-10-14 11:01 reichelt at gcc dot gnu dot org
  2004-10-14 11:25 ` [Bug c++/17996] " reichelt at gcc dot gnu dot org
  2004-10-14 12:28 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-14 11:01 UTC (permalink / raw)
  To: gcc-bugs

The following testcase is miscompiled on the 3.4 branch and mainline:

=========================================================
extern int printf(const char *restrict, ...) throw ();

struct A
{
    A()  { printf("Ctor\n"); }
    ~A() { printf("Dtor\n"); }
};

A a;
extern A a;

int main()
{
    return 0;
}
=========================================================

The output is:

Ctor
Dtor
Dtor

i.e. the destructor of A is run twice.
If I exchange line 9 and 10, the bug goes away.

Btw, the bug was reported at Debian:
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=260747
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=265961

The bug affects gcc 3.4.0 and later.

It was introduced somewhere in Mid August 2003.

Mark, your patch
http://gcc.gnu.org/ml/gcc-cvs/2003-08/msg00621.html
might have caused the regression. Could you please have a look?

-- 
           Summary: [3.4/4.0 regression] Destructor run twice
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,mark at codesourcery dot
                    com


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/17996] [3.4/4.0 regression] Destructor run twice
  2004-10-14 11:01 [Bug c++/17996] New: [3.4/4.0 regression] Destructor run twice reichelt at gcc dot gnu dot org
@ 2004-10-14 11:25 ` reichelt at gcc dot gnu dot org
  2004-10-14 12:28 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-14 11:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-10-14 11:25 -------
Mark, I just checked, the regression indeed appears with your patch
http://gcc.gnu.org/ml/gcc-cvs/2003-08/msg00621.html


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
      Known to fail|                            |3.4.0 3.4.3 4.0.0
      Known to work|                            |3.3.5
   Target Milestone|---                         |3.4.3


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/17996] [3.4/4.0 regression] Destructor run twice
  2004-10-14 11:01 [Bug c++/17996] New: [3.4/4.0 regression] Destructor run twice reichelt at gcc dot gnu dot org
  2004-10-14 11:25 ` [Bug c++/17996] " reichelt at gcc dot gnu dot org
@ 2004-10-14 12:28 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-14 12:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-14 12:28 -------


*** This bug has been marked as a duplicate of 17976 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-10-14 12:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-14 11:01 [Bug c++/17996] New: [3.4/4.0 regression] Destructor run twice reichelt at gcc dot gnu dot org
2004-10-14 11:25 ` [Bug c++/17996] " reichelt at gcc dot gnu dot org
2004-10-14 12:28 ` pinskia at gcc dot gnu dot org

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).