https://gcc.gnu.org/g:931ca9cb5d486d7289896109eb999252cf71a667

commit 931ca9cb5d486d7289896109eb999252cf71a667
Author: Kito Cheng <[email protected]>
Date:   Tue Oct 28 10:15:53 2025 +0800

    RISC-V: Clean up build warnings for VLS calling convention
    
    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.
    
    (cherry picked from commit 27861393a92d00f8ab7b0f139075ad43dd418282)

Diff:
---
 gcc/config/riscv/riscv.cc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 1f1462a0c34c..15da9ee18c60 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -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)
 {

Reply via email to