From patchwork Fri Sep 9 10:06:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kito Cheng X-Patchwork-Id: 1112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp640728wrt; Fri, 9 Sep 2022 03:07:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR5Ud5m9iEE2iA7hQ4LGlJjxiXz/9CF5z7J+uaTGS//Kbd7Q6R3Y9oS20Ijq6tYOOaKEkaYC X-Received: by 2002:a17:907:1ca6:b0:741:9b0b:1988 with SMTP id nb38-20020a1709071ca600b007419b0b1988mr9174623ejc.195.1662718067828; Fri, 09 Sep 2022 03:07:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662718067; cv=none; d=google.com; s=arc-20160816; b=0mC7fo0kyFxPBxA3lrPIR+N8ZFomnL2JsAswOIAknPbya0XtMIz1GfNu6G2IdZYr2/ 9EgwkQEfOxrKUtb6Zepds6UQrULxzIPi0K2FTsIXid05JUbjKK96RfxrhFOTJipY0rkb c4YmufMvh1idAzdoZ23xpSM7m6RPSe45DiJRzkZ5/UGVKDFbXJ6KGR6ltHWQpvIkIm+f T6HYQSyqgLmxothr184zcjVYqOCKeJynqRPd85V3/1JJVYs7oXF7nxPpWKl/65cd8CQE 7vjKxTrqXlM3FkBRAoeE9cQpqUVZBRYva5CVsdSgkMvJWcNNBfCDkHkht39O4/qZVx6C rwMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :dmarc-filter:delivered-to; bh=uUPxCQYJbUsYMp92O6QUPc/FpI6hmKCMhL09I6HUDhs=; b=w7sAAvSuEKX7aaZPUZqPIGvPyR7Wzk5k/I0Aspk3dEItLTaVKJI7qbUNpOLcSqZlz5 BqEu0Zrp6DAXb8cw3mx2U3jO9K2mk6W/aTI7s17n30kVcjesLBS5e7paeblL3+Y8AK4S bzBdIs7e2s0H1vFjuef+/Ock56d41rs/5Ko4+NFLYbPTzRBx7b5b8M8JGaIoRLcYGb1u 3P1wJTH+6WqwNs5Knd9LpWHJOiS6FLSsk3czcjVWb1HEN+/e/7t4EPRU8mMVXzdJD/rz mvcnf0EvgAdX78k/wc5EPXcZay+33XOyJ/ulkFgMuz4I5y4OPKqhZkB6vK4b2dvxWDHB Rtgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=kkzT0821; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m17-20020a056402511100b0044ea701dba9si107642edd.471.2022.09.09.03.07.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 03:07:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=kkzT0821; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2E98A3857357 for ; Fri, 9 Sep 2022 10:07:46 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 7F9EF38582BF for ; Fri, 9 Sep 2022 10:07:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7F9EF38582BF Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-pj1-x102a.google.com with SMTP id pj10so1072917pjb.2 for ; Fri, 09 Sep 2022 03:07:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=uUPxCQYJbUsYMp92O6QUPc/FpI6hmKCMhL09I6HUDhs=; b=kkzT0821WYXCbfxTXtquf2MlasoRlHcdnNfxYTdWEDULsWGv7WJ+h+xyBMZwqq98E4 J+H07/MY/czaRkLTfeLJslGtRYboPgN6jdr5OUluiv/eQ3O+YqjHMK8cpeL24i64Itva zFUgbqcqsCXvT2h19f+uRPtTdzwEZ1kpwr4DznmanQ3NBk6bUvKXuEj0NgbdBufXrB/F G296mWSFzZYG6frjO/oDOpy144ZgbLxbeQ83vNB6C18gfQJYIbPZ31w6pMYgJmZ8fiqG VVKvj8DYAAqIrMlh0ty+Ua4fu9APUCcmUYZYBY2WbCtuYilbSEcYhrIUFhQW2BHd4jIZ FCgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=uUPxCQYJbUsYMp92O6QUPc/FpI6hmKCMhL09I6HUDhs=; b=VWDxH3rynqlYdcSBalLeSHXObT+Pze0ycBkNzuy7v9jPaCsIzx8TnOZqjcpVmjmRwp GVPYVyv1pxx68qTK2ZMljNL1ReNhKcx/De2mEiCfZbhILwU58JbDVChxJNiXFMOTTvWU nQEbg7q6EgWdQR7EF70T8bXpQnspoiKNmr/Co6u6EBARjI+gvGsi87ewUwlT496v/mTd eJp15zNHPbo6P5k3Ac39kzeCX3h1cYIWCx9gwLMQNUdNvawpVbnvGpQTaLz7fqmexZZh LmB9VcLnXnAlcFzlF3bR6h+9xrCOA8ACBYUVpKhxZh/b8e/PPNurtcKfheEB+8DCgwxf UkIw== X-Gm-Message-State: ACgBeo2vz5AoNgwzBz3caEva8hBDnHNg723BpBqBAonZ/v9RSxDxPLPG WDZsH2OhvdJCfS28rw9uujqUQrzLobFGjw== X-Received: by 2002:a17:90b:1c01:b0:1f3:2f26:e7b2 with SMTP id oc1-20020a17090b1c0100b001f32f26e7b2mr9032459pjb.111.1662718023251; Fri, 09 Sep 2022 03:07:03 -0700 (PDT) Received: from hsinchu02.internal.sifive.com (59-124-168-89.hinet-ip.hinet.net. [59.124.168.89]) by smtp.gmail.com with ESMTPSA id t62-20020a625f41000000b0053e72ed5252sm158334pfb.42.2022.09.09.03.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 03:07:02 -0700 (PDT) From: Kito Cheng To: gcc-patches@gcc.gnu.org, kito.cheng@gmail.com, jim.wilson.gcc@gmail.com, schwab@linux-m68k.org Subject: [committed] RISC-V: Suppress build warnings Date: Fri, 9 Sep 2022 18:06:59 +0800 Message-Id: <20220909100659.48211-1-kito.cheng@sifive.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kito Cheng Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1743486260823438251?= X-GMAIL-MSGID: =?utf-8?q?1743486260823438251?= ../../gcc/common/config/riscv/riscv-common.cc: In function 'const char* riscv_multi_lib_check(int, const char**)': ../../gcc/common/config/riscv/riscv-common.cc:1451:11: error: bare apostrophe ''' in format [-Werror=format-diag] 1451 | "Can't find suitable multilib set for %<-march=%s%>/%<-mabi=%s%>", | ^ ../../gcc/common/config/riscv/riscv-common.cc:1451:7: note: if avoiding the apostrophe is not feasible, enclose it in a pair of '%<' and '%>' directives instead 1451 | "Can't find suitable multilib set for %<-march=%s%>/%<-mabi=%s%>", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../gcc/common/config/riscv/riscv-common.cc: At global scope: ../../gcc/common/config/riscv/riscv-common.cc:1492:1: error: 'int riscv_check_conds(const switchstr*, int, int, const std::vector >&)' defined but not used [-Werror=unused-function] 1492 | riscv_check_conds ( | ^~~~~~~~~~~~~~~~~ ../../gcc/common/config/riscv/riscv-common.cc:1374:1: error: 'const char* find_last_appear_switch(const switchstr*, int, const char*)' defined but not used [-Werror=unused-function] 1374 | find_last_appear_switch ( | ^~~~~~~~~~~~~~~~~~~~~~~ cc1plus: all warnings being treated as errors make[3]: *** [Makefile:2442: riscv-common.o] Error 1 gcc/ChangeLog: * common/config/riscv/riscv-common.cc (RISCV_USE_CUSTOMISED_MULTI_LIB): Move forward for cover all all necessary functions for suppress unused function warnings. (riscv_multi_lib_check): Move forward, and tweak message to suppress -Werror=format-diag warning. --- gcc/common/config/riscv/riscv-common.cc | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc index 120a0384686..77219162eeb 100644 --- a/gcc/common/config/riscv/riscv-common.cc +++ b/gcc/common/config/riscv/riscv-common.cc @@ -1366,6 +1366,24 @@ riscv_expand_arch_from_cpu (int argc ATTRIBUTE_UNUSED, return xasprintf ("-march=%s", arch.c_str()); } +/* Report error if not found suitable multilib. */ +const char * +riscv_multi_lib_check (int argc ATTRIBUTE_UNUSED, + const char **argv ATTRIBUTE_UNUSED) +{ + if (riscv_no_matched_multi_lib) + fatal_error ( + input_location, + "Cannot find suitable multilib set for %<-march=%s%>/%<-mabi=%s%>", + riscv_current_arch_str.c_str (), + riscv_current_abi_str.c_str ()); + + return ""; +} + +/* We only override this in bare-metal toolchain. */ +#ifdef RISCV_USE_CUSTOMISED_MULTI_LIB + /* Find last switch with the prefix, options are take last one in general, return NULL if not found, and return the option value if found, it could return empty string if the option has no value. */ @@ -1440,21 +1458,6 @@ riscv_multi_lib_info_t::parse ( return true; } -/* Report error if not found suitable multilib. */ -const char * -riscv_multi_lib_check (int argc ATTRIBUTE_UNUSED, - const char **argv ATTRIBUTE_UNUSED) -{ - if (riscv_no_matched_multi_lib) - fatal_error ( - input_location, - "Can't find suitable multilib set for %<-march=%s%>/%<-mabi=%s%>", - riscv_current_arch_str.c_str (), - riscv_current_abi_str.c_str ()); - - return ""; -} - /* Checking ARG is not appeared in SWITCHES if NOT_ARG is set or ARG is appeared if NOT_ARG is not set. */ @@ -1534,9 +1537,6 @@ riscv_check_conds ( return match_score + ok_count * 100; } -/* We only override this in bare-metal toolchain. */ -#ifdef RISCV_USE_CUSTOMISED_MULTI_LIB - /* Implement TARGET_COMPUTE_MULTILIB. */ static const char * riscv_compute_multilib (