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: 1675971 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=sifive.com header.i=@sifive.com header.a=rsa-sha256 header.s=google header.b=kkzT0821; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MPBWC2bCLz1yhP for ; Fri, 9 Sep 2022 20:07:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D048D385741B for ; Fri, 9 Sep 2022 10:07:29 +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-Google-Smtp-Source: AA6agR5ZS7Lm8AZ/IKgALHUg0Q6I5hUEImbuuoElbXcL0Bq1+37u+qE3c7PMGFATdfkcEE3IjQYaqA== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" ../../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 (