Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmHasher breaks without -fno-strict-aliasing #16

Open
GoogleCodeExporter opened this issue Jun 9, 2015 · 0 comments
Open

SmHasher breaks without -fno-strict-aliasing #16

GoogleCodeExporter opened this issue Jun 9, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

A change in revision 145 caused MurmurHash3 to start failing the "keyset 
'Window' tests" with:

  Keyset 'Windowed' -  64-bit key,  20-bit window - 64 tests, 1048576 keys per test
  Window at   0 - Testing collisions   - Expected   128.00, actual 1048575.00 (8192.00x) !!!!!
  Window at   1 - Testing collisions   - Expected   128.00, actual 1048575.00 (8192.00x) !!!!!
  ... etc ...

I applies the r145 changes one by one to r144 and found that the removal of the 
following line from CMakeLists.txt is the cause.

  set(CMAKE_CXX_FLAGS "-g -fno-strict-aliasing -Wall")

After about an hour I've come to the conclusion that strict-aliasing is complex 
:). GCC has __attribute__((__may_alias__)) that I believe should allow 
strict-aliasing to be enabled project wide but disabled in the places that 
cause the problem, but I can't get it to work.

Adding the line back into CMakeLists.txt fixes the problem, but the logs say it 
was removed to stop Visual Studio from complaining. Perhaps that problem can be 
solved by some other means.

(I'm using Debian-6 with GCC 4.4.5)

Shane Day

Original issue reported on code.google.com by shane.a....@gmail.com on 16 Jul 2012 at 4:33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant