[Bug c++/46188] -fipa-cp removes destructor call

zsojka at seznam dot cz gcc-bugzilla@gcc.gnu.org
Wed Oct 27 15:44:00 GMT 2010


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

--- Comment #7 from Zdenek Sojka <zsojka at seznam dot cz> 2010-10-27 15:44:20 UTC ---
Created attachment 22179
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22179
reduced testcase, packed

One header file and two C++ files.

This doesn't use any operator overloading, so should be easier to understand.

Tested revisions:
r165915 - OK
r161659 - OK
r159696 - fail
r158095 - fail
4.5 r165781 - fail
4.5.1 - fail
4.4 r165754 - OK

Good output:
$ g++-4.5.1 pr46188_foo.C pr46188_main.C -O2 -fno-ipa-cp && ./a.out
pre-f()
void Array::foo()
void h(T*) [with T = char] ((nil))
void h(T*) [with T = char] ((nil))
void h(T*) [with T = String] (0x603010)
post-f()

Bad output:
$ g++-4.5.1 pr46188_foo.C pr46188_main.C -O2 && ./a.out
pre-f()
void Array::foo()
void h(T*) [with T = char] ((nil))
void h(T*) [with T = String] (0x603010)
post-f()



More information about the Gcc-bugs mailing list