|
Boost : |
From: Rene Rivera (grafik.list_at_[hidden])
Date: 2004-08-06 00:08:52
Gennadiy Rozental wrote:
>>I'm asking for help in tracking this down. I'm not familiar at all with
>>the dynamic_bitset code so some direction as to likely causes of the
>>problems, or where to start looking are much appreciated. For now I'll
>>just be single stepping through the code, oh fun :-(
>
> Just small note: why do you use BOOST_CHECK instead of BOOST_CHECK_EQUAL?
> It may clarify some of the errors
I think Gennaro uses it because it's simpler, i.e. he's using
test/minimal.hpp.
Changing it doesn't help anyway... I've narrowed the error down to a
curious situation:
When the block type is "unsigned long long" only this sequence passes:
Bitset b(lhs);
BOOST_CHECK(b.size() == 0);
b.resize(2);
b.reset(1);
b.set(0);
BOOST_CHECK(b.size() == 2);
BOOST_CHECK(b.test(0) == true);
BOOST_CHECK(b.test(1) == false);
But this one fails:
Bitset b(lhs);
BOOST_CHECK(b.size() == 0);
b.resize(2);
b.set(0);
b.reset(1); //NOTE, the different order!
BOOST_CHECK(b.size() == 2);
BOOST_CHECK(b.test(0) == true); //FAILS!
BOOST_CHECK(b.test(1) == false);
WHich means the reset() somehow generates bad code when optimized. I've
tried manipulating the reset() in various ways to see if anything makes
a difference, to the point of complete manual inlining, and nothing
makes a difference.
Clues anyone??
PS. For those that don't know, I didn't until I looked, dyn_bitset
stores the bits in a std::vector<block_type>, and does the usual bit
masking manipulations.
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk