This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21528] Boost shared_ptr_test.cpp fails with -O3
- From: "redi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 May 2005 12:23:02 -0000
- Subject: [Bug c++/21528] Boost shared_ptr_test.cpp fails with -O3
- References: <20050512084056.21528.pdimov@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From redi at gcc dot gnu dot org 2005-05-12 12:22 -------
Also, I *do* still see the failure if I replace BOOST_TEST() with assert().
This still fails with -finline-functions -finline-limit=80
#include <boost/shared_ptr.hpp>
#include <cassert>
int main()
{
boost::shared_ptr<int> pi(new int);
boost::shared_ptr<void> pv(pi);
boost::shared_ptr<int> pi2 = boost::static_pointer_cast<int>(pv);
assert(pi.get() == pi2.get());
assert(pi.use_count() == 3); // fails here
return 0;
}
*however* if I remove the first assertion it succeeds.
--
What |Removed |Added
----------------------------------------------------------------------------
Known to fail| |4.0.0 4.0.1
Known to work| |3.4.3 4.1.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21528