GH-Actions (todo) : Add -Og and gcc-12 #810
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#810
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
v0.8.1andHEADmay have issue which is not related toinlineproblems. But-Oghelps us to detect it.Here's actual warning messages.
It warns that at xxhash.h#L4733, if
(statePtr != NULL) && (seed != 0) && !(seed != seedPtr->seed), we may read uninitialized variablestatePtr->extSecret.https://github.com/Cyan4973/xxHash/blob/v0.8.1/xxhash.h#L4733
Our initizliation is done by
XXH3_INITSTATE(). Note that we don't have any explicit initializer list forstate.https://github.com/Cyan4973/xxHash/blob/v0.8.1/cli/xsum_bench.c#L158
XXH3_INITSTATE()only setstatePtr->seed. But it doesn't touchstatePtr->extSecret.https://github.com/Cyan4973/xxHash/blob/v0.8.1/xxhash.h#L1113
I think adding
(XXH3_state_ptr)->extSecret = NULL;toXXH3_INITSTATE()is the most easy and safe fix for users who doesn't care about internals of XXH3.But not sure about benchmarks.
Since this is a false positive, splitting the condition may help compiler to understand the code.
It's ugly, and not sure about performance/codegen and maintainability.
I assure you that a single store is going to have no effect on performance.
However we should avoid double evaluation and use a do-while to make it a single statement (to avoid the
if (x) MACRO;issue)