diff --git a/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp b/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp index b9ebd49779e98..1b5c511360ff5 100644 --- a/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp +++ b/src/hotspot/cpu/riscv/c1_LIRGenerator_riscv.cpp @@ -772,7 +772,7 @@ void LIRGenerator::do_ArrayCopy(Intrinsic* x) { ciArrayKlass* expected_type = nullptr; arraycopy_helper(x, &flags, &expected_type); if (x->check_flag(Instruction::OmitChecksFlag)) { - flags = 0; + flags = (flags & LIR_OpArrayCopy::unaligned); } __ arraycopy(src.result(), src_pos.result(), dst.result(), dst_pos.result(), length.result(), tmp, diff --git a/src/hotspot/share/c1/c1_LIR.cpp b/src/hotspot/share/c1/c1_LIR.cpp index c1c94244fcc7b..2a7b0adc3c339 100644 --- a/src/hotspot/share/c1/c1_LIR.cpp +++ b/src/hotspot/share/c1/c1_LIR.cpp @@ -351,7 +351,7 @@ LIR_OpArrayCopy::LIR_OpArrayCopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_ , _expected_type(expected_type) , _flags(flags) { #if defined(X86) || defined(AARCH64) || defined(S390) || defined(RISCV) || defined(PPC64) - if (expected_type != nullptr && flags == 0) { + if (expected_type != nullptr && ((flags & ~LIR_OpArrayCopy::unaligned) == 0)) { _stub = nullptr; } else { _stub = new ArrayCopyStub(this);