bjorn3 opened issue #3583:
cranelift_frontend::FunctionBuilder::emit_small_memory_copy
(documentation) takes the argumentsdest_align
andsrc_align
, which it uses only for an assertion and then ignores. It chooses an access size which may be larger than the alignment and callsflags.set_aligned();
and proceeds to doing unaligned memory access. This seems to be a mistake.Reported by Veverak at https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/emit_small_memory_copy.20ignores.20alignment/near/263576215
bjorn3 labeled issue #3583:
cranelift_frontend::FunctionBuilder::emit_small_memory_copy
(documentation) takes the argumentsdest_align
andsrc_align
, which it uses only for an assertion and then ignores. It chooses an access size which may be larger than the alignment and callsflags.set_aligned();
and proceeds to doing unaligned memory access. This seems to be a mistake.Reported by Veverak at https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/emit_small_memory_copy.20ignores.20alignment/near/263576215
bjorn3 labeled issue #3583:
cranelift_frontend::FunctionBuilder::emit_small_memory_copy
(documentation) takes the argumentsdest_align
andsrc_align
, which it uses only for an assertion and then ignores. It chooses an access size which may be larger than the alignment and callsflags.set_aligned();
and proceeds to doing unaligned memory access. This seems to be a mistake.Reported by Veverak at https://bytecodealliance.zulipchat.com/#narrow/stream/217117-cranelift/topic/emit_small_memory_copy.20ignores.20alignment/near/263576215
cfallin commented on issue #3583:
Hmm, yes, this seems to be the case. Fortunately codegen doesn't actually do anything with the alignment flag on x86-64 or aarch64; both architectures support misaligned accesses natively for the integer types that this small-memcpy will use; but for fully correct IR we should fix this.
Last updated: Nov 22 2024 at 17:03 UTC