From: xuli <xu...@eswincomputing.com>

The reason is that in the following code, icode = movmisalignv8si has
already been rejected by TARGET_VECTOR_MISALIGN_SUPPORTED, but it is
allowed by targetm.slow_unaligned_access,which is contradictory.

(((icode = optab_handler (movmisalign_optab, mode))
           != CODE_FOR_nothing)
          || targetm.slow_unaligned_access (mode, align))

misaligned vector access should be enabled by -mno-vector-strict-align option.

PR Target/115862

gcc/ChangeLog:

        * config/riscv/riscv.cc (riscv_slow_unaligned_access): Disable vector 
misalign.

Signed-off-by: Li Xu <xu...@eswincomputing.com>
---
 gcc/config/riscv/riscv.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 61fa74e9322..87270fd7af4 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -10271,7 +10271,7 @@ riscv_cannot_copy_insn_p (rtx_insn *insn)
 static bool
 riscv_slow_unaligned_access (machine_mode, unsigned int)
 {
-  return riscv_slow_unaligned_access_p;
+  return !TARGET_VECTOR && riscv_slow_unaligned_access_p;
 }
 
 static bool
-- 
2.17.1

Reply via email to