From: Juzhe-Zhong <juzhe.zh...@rivai.ai>

This patch is depending on 
https://patchwork.sourceware.org/project/gcc/patch/20230504054544.203366-1-juzhe.zh...@rivai.ai/
Fix codes according to comments of Kito.

gcc/ChangeLog:

        * config/riscv/riscv.cc (riscv_get_arg_info): Move RVV type argument 
handling outside.

---
 gcc/config/riscv/riscv.cc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 1a35e02796d..8d3cd4261d2 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -3791,16 +3791,16 @@ riscv_get_arg_info (struct riscv_arg_info *info, const 
CUMULATIVE_ARGS *cum,
   info->gpr_offset = cum->num_gprs;
   info->fpr_offset = cum->num_fprs;
 
+  /* TODO: Currently, it will produce ICE for --param
+     riscv-autovec-preference=fixed-vlmax. So, we just return NULL_RTX here
+     let GCC genearte loads/stores. Ideally, GCC should either report
+     Warning message to tell user do not use RVV vector type in function
+     arg, or GCC just support function arg calling convention for RVV
+     directly.  */
+  if (riscv_v_ext_mode_p (mode))
+    return NULL_RTX;
   if (named)
     {
-      /* TODO: Currently, it will produce ICE for --param
-        riscv-autovec-preference=fixed-vlmax. So, we just return NULL_RTX here
-        let GCC genearte loads/stores. Ideally, GCC should either report
-        Warning message to tell user do not use RVV vector type in function
-        arg, or GCC just support function arg calling convention for RVV
-        directly.  */
-      if (riscv_v_ext_mode_p (mode))
-       return NULL_RTX;
       riscv_aggregate_field fields[2];
       unsigned fregno = fpr_base + info->fpr_offset;
       unsigned gregno = gpr_base + info->gpr_offset;
-- 
2.36.3

Reply via email to