Pb when building with gcc-12 -Og #720
No reviewers
Labels
No labels
announcement
bug
build
CI
dependencies
documentation
duplicate
enhancement
experience feedback
feature request
github_actions
help wanted
install
invalid
Long-term
optimization
portability
question
target-specific
test issue
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-Cyan4973/xxHash!720
Loading…
Reference in a new issue
No description provided.
Delete branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes:
| xxhash.h:3932:1: error: inlining failed in call to 'always_inline' 'XXH3_accumulate_512_sse2': function not considered for inlining
| 3932 | XXH3_accumulate_512_sse2( void* XXH_RESTRICT acc,
| | ^~~~~~~~~~~~~~~~~~~~~~~~
| xxhash.h:4369:9: note: called from here
| 4369 | f_acc512(acc,
| | ^~~~~~~~~~~~~
| 4370 | in,
| | ~~~
| 4371 | secret + n*XXH_SECRET_CONSUME_RATE);
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Mingli Yu mingli.yu@windriver.com
Hi @Mingli-Yu,
thank you for sending PR. But unfortunately your PR has failed to pass our test. Also I couldn't repro your issue with
gcc-12.1.First of all, please understand that we can't accept your PR for now. Because your PR failed to pass our test. But I also must say that our test is not perfect. So feel free to point out our mistake.
I failed to reproduce your issue with
gcc-12.1I've tried to build
xxhsumandmake testwithgcc-12.1by the following commands which found at reddit.During the build and test process, I don't see any warning and error. Since you've posted specific error message, I think I missed something. But honestly, I have no idea.
I don't understand intention of your PR.
(1) Same question again, but I don't see any warning (as an error) from these
__inline__and__attribue__((always_inline))in the macro. How can we reproduce your issue?(2) Why you removed
__attribute__((unused))? According to thegccmanual, I think this attribute may help to ease/resolve yor situation. At least it may help our test.Looks like @Mingli-Yu forgot to mention that the issue only shows up when using
-Og.Hi @jrosdahl, thanks for the info!
Now I can reproduce this issue with the following command:
Since I have no idea so far, I just put some random commands for further investigation.
Just to add another data point, I can also confirm this. I have been investigating a little bit on my end.
I have fixed the meson build in https://github.com/mesonbuild/wrapdb/pull/580, specifically https://github.com/mesonbuild/wrapdb/pull/580/commits/e9b59a653f0b77a37aabe61d555f5a449649a455.
I think this PR has to do something similar, but I am not going to touch it because I have no clue how to tell what optimization level the compiler is using in Makefiles. I haven't found a pure C preprocessor solution. I would seriously just recommend using Meson for xxhash though :).
Indeed,
-Ogseems to be "a compilation mode optimized for debugging".Given the definition, I would expect this compilation mode to be rather hostile to inlining, since inlining can make debugging more difficult.
Somehow,
-Ogfeels superficially similar to-O0 -g.-O0is detectable, by checking macro__NO_INLINE__(cc @easyaspi314).For some reason,
-Ogongcc-12doesn't expose the__NO_INLINE__macro when selected.If it's not going to respect the
inlinestatements, it probably should.At least, that's the situation with
gcc-12. Butclangon the other hand has no such problem.I don't have access to older versions of
gccto check if the same pb happens.Will try again later, when I can access another system with more compilers.
Hmm, this is a tricky one. GCC 12 doesn't seem to emit any different macros on
-Ogvs-O2.github.com/gcc-mirror/gcc@c952126870might be the culpritThe problem seems to be specifically -Og preventing GCC from inlining the accumulate functions because they are accessed through function pointers.
My guess is to either disable force inline on the accumulate functions themselves or force GCC into -O3 mode if neither
-O0,-Os, or-fno-inlineis used, similar to how GCC is forced to do in AVX2 (which by the way the load splitting bug seems to have been fixed, might need to find the commit to disable it on newer versions)If we can get them to be inlined naturally (such as via
static inline) this might work.I have also encountered this issue. Any workarounds except removing -Og from our compiler options?
Using the Meson build will fix this issue if that is possible for you.
Hi @eugeneko, please try the HEAD of
devbranchor apply the following patch
Since #814 added CI test for
gcc-12 -Og, we're sure that HEAD ofdevbranch has no problem withgcc-12 -Og.You can also try it in your terminal
Fixed in #804
Pull request closed