-
Notifications
You must be signed in to change notification settings - Fork 980
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
misuse of __AVX2__
etc., likely to cause miscompilation with GCC14
#2163
Comments
Thanks for the thorough analysis. We will apply your recommendation. Note that GCC 14 is not released. Even so, I find that simdjson builds fine with GCC 14 under the current Fedora Rawhide:
I have removed the 'bug' marker. We only support released compilers. Thanks again for the excellent analysis. |
Sorry that I haven't made it clear. Current version builds which is the bad case. But the resulting binary is wrong, for example after
|
Thanks. The issue should be solved in any case in the current release. If not, just open a new pull request. |
singleheader/simdjson.cpp
contains:Expanded:
Simplified:
GCC 13 and below defines
__AVX2__
only when specified on command line.This has been considered a bug, and was fixed for GCC14 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87299
In GCC 14,
__AVX2__
is also defined with#pragma GCC target("avx2")
. Thus the second__AVX2__
check will be always false andpop_options
will never be called.So all functions in the rest of the source file will be compiled with this instruction set added.
This is the underlying issue behind #2116
The fix should hopefully be straightforward (though I do not plan to fix it myself).
SIMDJSON_CAN_ALWAYS_RUN_HASWELL
and any value guardingSIMDJSON_UNTARGET_REGION
should not change in time:The text was updated successfully, but these errors were encountered: