diff --git a/src/hotspot/cpu/riscv/vm_version_riscv.cpp b/src/hotspot/cpu/riscv/vm_version_riscv.cpp index dddded795fa..3b8d8119a8e 100644 --- a/src/hotspot/cpu/riscv/vm_version_riscv.cpp +++ b/src/hotspot/cpu/riscv/vm_version_riscv.cpp @@ -150,11 +150,12 @@ void VM_Version::common_initialize() { } if (FLAG_IS_DEFAULT(AvoidUnalignedAccesses)) { - if (unaligned_access.value() != MISALIGNED_FAST) { - FLAG_SET_DEFAULT(AvoidUnalignedAccesses, true); - } else { - FLAG_SET_DEFAULT(AvoidUnalignedAccesses, false); - } + FLAG_SET_DEFAULT(AvoidUnalignedAccesses, + unaligned_access.value() != MISALIGNED_FAST); + } + + if (FLAG_IS_DEFAULT(AlignVector)) { + FLAG_SET_DEFAULT(AlignVector, AvoidUnalignedAccesses); } // See JDK-8026049