-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Segfault when unsafe_load
ing inbounds pointer
#56265
Labels
compiler:codegen
Generation of LLVM IR and native code
regression 1.11
Regression in the 1.11 release
Comments
FWIW, it "works" on 1.10. julia> using SIMD
julia> s = b"AAAAAAAAAAAAAABBBBBCBCBBBBBBBBCDE";
julia> foo(s) = GC.@preserve s unsafe_load(Ptr{Vec{32, UInt8}}(pointer(s)));
julia> s_vec = foo(s)
<32 x UInt8>[0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 0x42, 0x43, 0x42, 0x43, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x43, 0x44]
julia> transcode(String, collect(Tuple(s_vec)))
"AAAAAAAAAAAAAABBBBBCBCBBBBBBBBCD" |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
compiler:codegen
Generation of LLVM IR and native code
regression 1.11
Regression in the 1.11 release
I'm not sure if this is expected behaviour, but I couldn't find any information about expected alignment in Julia.
Code to reproduce:
I believe this may be a Julia bug, because SIMD doesn't add methods to
unsafe_load
.Edit: Looks like the generated code changed between 1.10 and 1.11. In 1.11, it emits a
vmovaps
, which requires the pointer to be 16-byte aligned, which strings aren't always, whereas in 1.10, it emittedvmovups
instead.This is on Julia 1.11.1 and SIMD 3.6.0
The text was updated successfully, but these errors were encountered: