-
Notifications
You must be signed in to change notification settings - Fork 783
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
GCC-12 fails to inline XXX_FORCED_INLINE functions, XXH3_accumulate_512_sse2(), and XXH3_scrambleAcc_sse2() with -Og flag. #800
Comments
Indeed, there are known issues when compiling Unfortunately, there is no "generic" solution yet, It's unclear if there will be a solution to this problem, or if it's something that can only be fixed on the compiler side. A manual work around involves combining this flag with an appropriate xxhash build macro, such as |
I believe the solution is to not mark the functions that are turned into pointers force inline, as |
Well, this is what |
I think I will define
manually when I compile thunderbird mail client with GCC-12 and -Og flag. |
|
I think #804 fixes this issue. If you can merge it, please let us know what happens in your project. |
Hi, I tried compiling Thunderbird mail client using GCC-12.
Well, with -Og flag, it fails to inline the following two functions and compilation aborts.
XXH3_accumulate_512_sse2()
XXH3_scrambleAcc_sse2()
Without -Og, the compilation succeeds.
Mozilla bugzilla is here.
https://bugzilla.mozilla.org/show_bug.cgi?id=1817565
I was advised to post a bug report at this github repository.
I think we may need to enable/disable XXX_FORCED_INLINE attribute for these two functions depending on the GCC version and
whether -Og is used. But according to gcc bugzilla, there is currently no such macro that is defined when -Og is used on the command line.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107931
Come to think of it, macro is a preprocessor feature and so whether -Og is used or not is no concern to the preprocessor.
So it figures.
I need to settle on a certain macro such as __GCC_12_FAILS_ALWAYS_INLINE_WITH_DEBUG_OPT
and wrap the XXX_FORCED_INLINE attribute for the two functions as follows.
#if ! defined(__GCC_12_FAILS_ALWAYS_INLINE_WITH_DEBUG_OPT)
XXX_FORCED_INLINE
#endif
And then when I use -Og, I will define -D__GCC_12FAILS_ALWAYS_INLINE_WITH_DEBUG_OPT
and unless this macro is defined, all is well. The functions would be inlined. (At least GCC will not complain.)
It seems to be a compiler-specific and version-specific problem (GCC-10, GCC-11 did not report the errors. B now I am not quite convinced whether they really inlined the functions or not. According the gcc bugzilla, sometimes errors were/are not reported.)
So there is not much we can do. I just wanted to let you know the issue exists.
BUT if some measures are taken here, I don't have to modify my local Mozilla source code which imports xxhash source tree, and everybody who would compile xxHash with gcc-12 and -Og will be happier about it. :-)
Thank you for making a very fast hash library available to the general programming community.
The text was updated successfully, but these errors were encountered: