You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example from spec/compiler/codegen/extern_spec.cr, which currently runs only on x86-64 targets, crashes on AArch64 (both macOS and Alpine):
libLibMylibstructStruct
x : Int32
y : Int32
z : Int32
w : Int32
a : Int32endend
f =->{
s =LibMylib::Struct.new
s.x =1
s.y =2
s.z =3
s.w =4
s.a =5
s
}
s = f.call
s.x &+ s.y &+ s.z &+ s.w &+ s.a
LibMylib::Struct must be passed indirectly according to the AArch64 ABI. The generated LLVM IR shows how this is done:
Apparently, the store %"struct.LibMylib::Struct" %9, ptr %0 instruction is reading %0 from the wrong register, but everything works if the call is adjusted like this:
This example from
spec/compiler/codegen/extern_spec.cr
, which currently runs only on x86-64 targets, crashes on AArch64 (both macOS and Alpine):LibMylib::Struct
must be passed indirectly according to the AArch64 ABI. The generated LLVM IR shows how this is done:Apparently, the
store %"struct.LibMylib::Struct" %9, ptr %0
instruction is reading%0
from the wrong register, but everything works if the call is adjusted like this:That is, the
sret
at the call argument should match thesret
at the function parameter.The text was updated successfully, but these errors were encountered: