From patchwork Sat Oct 28 14:51:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Pan2" X-Patchwork-Id: 1856539 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=ZKV69zWj; dkim-atps=neutral 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=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SHjDb69jFz1yQ7 for ; Sun, 29 Oct 2023 01:52:13 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A2E593861883 for ; Sat, 28 Oct 2023 14:52:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by sourceware.org (Postfix) with ESMTPS id C86E93858414 for ; Sat, 28 Oct 2023 14:51:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C86E93858414 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C86E93858414 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.55.52.136 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698504719; cv=none; b=c52i6Nh59pS/eZUCbYbPJ1WZVRYTeLiOQjMnjyoemaeT6Y2+iSihYKoPBGDDoD8+V1ImaGxn3Iq1XL4e+N8sUagXN6ZoeJYGZmi4FNztMtH+1+6PAnCgAl64RPurdHzbmWaqqYwqIGxpPqKvC35NammHnp2nUQfnaNEyVcFfNtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698504719; c=relaxed/simple; bh=x13ossDffFLW6ZZDK0mw5zrFksDUrdjMJRqZzyX0mO0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=txEZXesoWAqD7aETFtEgsdUQjvnIsAizufNTjBdkXJlX61fQXKU2gEsgCeXGImb3U1X7T/r3foGq/+fPtn9nZjG6F7YcbuqI/bI083T5fZtprh7j3EvHVW1UEJF0B2SRIfZjjQamq2cY5ZGWtGxRfya87BLut97tn0eAALcGNXk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698504717; x=1730040717; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=x13ossDffFLW6ZZDK0mw5zrFksDUrdjMJRqZzyX0mO0=; b=ZKV69zWj4qqXvjQ3Jf9l6Wz7kvUFrw4HD2/XTai9I4mqel/Wye3bID+M El6n7cm4PY+HBfjSO5jXfddy437D//ywHGQz7TixQB47uEfrdVUWK90r5 HxACoTl+XgG6b+8yAlH+c9+BfrNn7y5AQ2PQftW4YBoMj30djTqWw1aqX NkZFsB4h/Cp6M6YF+JVppw3zftS8FGlpPPPCWAGa/MGBilj19loTnTfu2 tKCDQcTs/njQ8KFqwEsJMwgHkfAUvd3mqVFYJJzC+9pugITyP1dyPc2VI nUMJ0rFD1SNq7+xSzuvOim1Du3guxW0PCG2F+zSRXoQQZHaxIr+ICSXTQ A==; X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="367243617" X-IronPort-AV: E=Sophos;i="6.03,259,1694761200"; d="scan'208";a="367243617" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2023 07:51:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10876"; a="709682884" X-IronPort-AV: E=Sophos;i="6.03,259,1694761200"; d="scan'208";a="709682884" Received: from shvmail02.sh.intel.com ([10.239.244.9]) by orsmga003.jf.intel.com with ESMTP; 28 Oct 2023 07:51:53 -0700 Received: from pli-ubuntu.sh.intel.com (pli-ubuntu.sh.intel.com [10.239.159.47]) by shvmail02.sh.intel.com (Postfix) with ESMTP id D7CB110057F4; Sat, 28 Oct 2023 22:51:52 +0800 (CST) From: pan2.li@intel.com To: gcc-patches@gcc.gnu.org Cc: juzhe.zhong@rivai.ai, pan2.li@intel.com, yanzhang.wang@intel.com, kito.cheng@gmail.com Subject: [PATCH v1] RISC-V: Fix one range-loop-construct warning of avlprop Date: Sat, 28 Oct 2023 22:51:50 +0800 Message-Id: <20231028145150.1117903-1-pan2.li@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org From: Pan Li This patch would like to fix one warning of avlprop as below. ../../gcc/config/riscv/riscv-avlprop.cc: In member function 'virtual unsigned int pass_avlprop::execute(function*)': ../../gcc/config/riscv/riscv-avlprop.cc:346:23: error: loop variable 'candidate' creates a copy from type 'const std::pair' [-Werror=range-loop-construct] 346 | for (const auto candidate : m_candidates) | ^~~~~~~~~ ../../gcc/config/riscv/riscv-avlprop.cc:346:23: note: use reference type to prevent copying 346 | for (const auto candidate : m_candidates) | ^~~~~~~~~ | & gcc/ChangeLog: * config/riscv/riscv-avlprop.cc (pass_avlprop::execute): Use reference type to prevent copying. Signed-off-by: Pan Li --- gcc/config/riscv/riscv-avlprop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/riscv/riscv-avlprop.cc b/gcc/config/riscv/riscv-avlprop.cc index 2c79ec81806..c59eb7f6fa3 100644 --- a/gcc/config/riscv/riscv-avlprop.cc +++ b/gcc/config/riscv/riscv-avlprop.cc @@ -343,7 +343,7 @@ pass_avlprop::execute (function *fn) { fprintf (dump_file, "\nNumber of potential AVL propagations: %d\n", m_candidates.length ()); - for (const auto candidate : m_candidates) + for (const auto &candidate : m_candidates) { fprintf (dump_file, "\nAVL propagation type: %s\n", avlprop_type_to_str (candidate.first));