This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/12789] [tree-ssa] Miscompilation of small program


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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



------- Additional Comments From bangerth at dealii dot org  2003-10-28 18:02 -------
This is indeed almost certainly the same bug. Here's something smaller: 
----------------------------- 
#include <cstdio> 
 
struct X 
{ 
    X()  { printf ("X::X\n"); } 
    ~X() { printf ("X::~X\n"); } 
}; 
 
void foo (const int i) { 
  X x1, x2; 
  if (i == 1) return; 
  foo (1); 
} 
 
int main () { 
  foo (0); 
} 
------------------------------ 
 
I get 4 calls to the ctor, and 5 to the dtor. 
 
W.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]