[Bug 1577891] Re: Placement new destructor call optimized out
Matthias Klose
doko at ubuntu.com
Fri Oct 14 08:38:23 UTC 2016
** Bug watch added: GCC Bugzilla #77983
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77983
** Also affects: gcc via
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77983
Importance: Unknown
Status: Unknown
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-5 in Ubuntu.
https://bugs.launchpad.net/bugs/1577891
Title:
Placement new destructor call optimized out
Status in gcc:
Unknown
Status in gcc-5 package in Ubuntu:
Confirmed
Bug description:
We have a template class that we are using with placement new. Code works fine in g++ (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4,
however in g++ (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413, the destructor call is optimized out, even though we explicitly call it.
I have attached sample code (reduced down from our project) to show the issue. If we add a NON-POD data type, everything works
fine... this however is not an option for our project, as in our environment this is normally a packed class, though the example fails
either way.
This works:
g++ -O0 -g -ggdb test.cpp -o test0
./test0
Before:000102030405060708090a0b0c0d0e0f10111213
After :0000000000000000000000000000000000000000
These do not:
g++ -O1 -g -ggdb test.cpp -o test1
g++ -O2 -g -ggdb test.cpp -o test2
g++ -O3 -g -ggdb test.cpp -o test3
./test1
Before:000102030405060708090a0b0c0d0e0f10111213
After :000102030405060708090a0b0c0d0e0f10111213
To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/1577891/+subscriptions
More information about the foundations-bugs
mailing list