Subject: [Boost-bugs] [Boost C++ Libraries] #11135: SIMD optimizations for UUIDs break operator< comparisons
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-23 20:20:54
#11135: SIMD optimizations for UUIDs break operator< comparisons
----------------------------------------+------------------------
Reporter: Krishna Ersson <kersson@â¦> | Owner: atompkins
Type: Bugs | Status: new
Milestone: To Be Determined | Component: uuid
Version: Boost 1.57.0 | Severity: Regression
Keywords: uuid simd |
----------------------------------------+------------------------
The addition of SIMD optimizations for UUIDs in Boost 1.57 causes
`operator<` to fail. Here's an example test case that now fails unless
SIMD optimizations are turned off via `#define BOOST_UUID_NO_SIMD`.
{{{#!c++
BOOST_AUTO_TEST_CASE(testUuidBasicComparisons)
{
auto uuid1 =
boost::uuids::string_generator()("0123456789abcdef0123456789abcdee");
auto uuid2 =
boost::uuids::string_generator()("0123456789abcdef0123456789abcdef");
// These pass.
BOOST_CHECK(uuid1 <= uuid1);
BOOST_CHECK(uuid1 >= uuid1);
BOOST_CHECK(uuid1 == uuid1);
BOOST_CHECK(uuid1 != uuid2);
BOOST_CHECK(uuid1 <= uuid2);
BOOST_CHECK(uuid2 >= uuid1);
// These fail, but are expected to fail.
BOOST_CHECK(uuid1 > uuid2);
BOOST_CHECK(uuid2 < uuid1);
// These fail, but should pass.
BOOST_CHECK(uuid1 < uuid2);
BOOST_CHECK(uuid2 > uuid1);
}
}}}
When I step through the code, I find that the `operator<` function in
`boost/uuid/detail/uuid_x86.hpp` considers the two UUIDs in the test case
to be equal, hence `(uuid1 < uuid2)` and `(uuid1 > uuid2)` both evaluate
to `false`. Something is wrong with this code.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11135> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC