]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Clean up build warnings for VLS calling convention
authorKito Cheng <kito.cheng@sifive.com>
Tue, 28 Oct 2025 02:15:53 +0000 (10:15 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Tue, 28 Oct 2025 04:56:41 +0000 (12:56 +0800)
gcc/ChangeLog:

* config/riscv/riscv.cc (riscv_get_vls_cc_attr): Fix error message
parameter order and add check_only condition.  Improve diagnostic
message formatting with proper quoting.
(riscv_handle_rvv_vls_cc_attribute): Anonymize unused node parameter.

gcc/config/riscv/riscv.cc

index 74701b735082f5542523741eb325351054fa3261..63404d3d514351516ecf2eb02bb26c5693cdeb94 100644 (file)
@@ -7101,13 +7101,13 @@ riscv_get_vls_cc_attr (const_tree args, bool check_only = false)
        abi_vlen = TREE_INT_CST_LOW (vlen_arg);
     }
 
-  if (!riscv_valid_abi_vlen_vls_cc_p (abi_vlen))
+  if (!riscv_valid_abi_vlen_vls_cc_p (abi_vlen) && !check_only)
     {
       error_at (input_location,
-               "unsupported ABI_VLEN value %d for %qs attribute;"
-               "ABI_VLEN must be in the range [32, 16384] and must be "
-               "a power of 2.",
-               "riscv_vls_cc", abi_vlen);
+               "unsupported %<ABI_VLEN%> value %d for %qs attribute;"
+               "%<ABI_VLEN must%> be in the range [32, 16384] and must be "
+               "a power of 2",
+               abi_vlen, "riscv_vls_cc");
       return RISCV_CC_UNKNOWN;
     }
 
@@ -7258,7 +7258,7 @@ riscv_handle_type_attribute (tree *node ATTRIBUTE_UNUSED, tree name, tree args,
 }
 
 static tree
-riscv_handle_rvv_vls_cc_attribute (tree *node, tree name, tree args,
+riscv_handle_rvv_vls_cc_attribute (tree *, tree name, tree args,
                                   ATTRIBUTE_UNUSED int flags,
                                   bool *no_add_attrs)
 {