http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47817

--- Comment #4 from Andrew Aksyonoff <andrew.aksyonoff at gmail dot com> 
2011-02-19 21:10:21 UTC ---
(In reply to comment #2)
> I think you have some violation of the C/C++ aliasing rules where you access 
> an
> "unsigned int" via an "unsigned long long" which in turn causes undefined
> behavior.

You're referring to aliasing DOCINFO2ID helper, right?

gcc -Wall -Wstrict-aliasing does not result in any warnings.

Replacing DOCINFO2ID body with a more C++ish { return * reinterpret_cast<const
SphDocID_t*>(pDocinfo); } does not help either.

Replacing it with { return (uint64_t(pDocinfo[1])<<32) + uint64_t(pDocinfo[0]);
} does help, so that just might be my workaround, thanks for the pointer!

But given that reinterpret_cast does not, I would still suspect some tricky
things happening inside gcc anyway..

Reply via email to