Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Commit cb6ae98

Browse files
author
Yanzhang Wang
committed
fix: pass the right field type and other comments.
1 parent f9bafb8 commit cb6ae98

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

gcc/config/riscv/riscv.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,7 +3732,7 @@ riscv_pass_fpr_pair (machine_mode mode, unsigned regno1,
37323732
intrinsic vector type. Because we can't get the decl for the params. */
37333733

37343734
static bool
3735-
riscv_arg_has_vector_size_attribute (const_tree type)
3735+
riscv_scalable_vector_type_p (const_tree type)
37363736
{
37373737
tree size = TYPE_SIZE (type);
37383738
if (size && TREE_CODE (size) == INTEGER_CST)
@@ -3756,20 +3756,21 @@ riscv_arg_has_vector (const_tree type)
37563756
for (tree f = TYPE_FIELDS (type); f; f = DECL_CHAIN (f))
37573757
if (TREE_CODE (f) == FIELD_DECL)
37583758
{
3759-
if (!TYPE_P (TREE_TYPE (f)))
3759+
tree field_type = TREE_TYPE (f);
3760+
if (!TYPE_P (field_type))
37603761
break;
37613762

3762-
/* If there's vector_size attribute, ignore it. */
3763-
if (VECTOR_TYPE_P (TREE_TYPE (f)))
3764-
is_vector = !riscv_arg_has_vector_size_attribute (type);
3763+
/* Ignore it if it's fixed length vector. */
3764+
if (VECTOR_TYPE_P (field_type))
3765+
is_vector = !riscv_scalable_vector_type_p (field_type);
37653766
else
3766-
is_vector = riscv_arg_has_vector (TREE_TYPE (f));
3767+
is_vector = riscv_arg_has_vector (field_type);
37673768
}
37683769

37693770
break;
37703771

37713772
case VECTOR_TYPE:
3772-
is_vector = !riscv_arg_has_vector_size_attribute (type);
3773+
is_vector = !riscv_scalable_vector_type_p (type);
37733774
break;
37743775

37753776
default:

0 commit comments

Comments
 (0)