From patchwork Sun Dec 10 15:20:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xndcn X-Patchwork-Id: 176361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6571174vqy; Sun, 10 Dec 2023 07:29:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IG6AMx1RfImBqa2AE/Nk5WtSQdlanRZ5UsogNQLtPuRsk7ozoYeQ8VjKS0E5qHBrpAGihL9 X-Received: by 2002:a05:620a:4009:b0:77f:601f:1976 with SMTP id h9-20020a05620a400900b0077f601f1976mr3608809qko.98.1702222183844; Sun, 10 Dec 2023 07:29:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702222183; cv=pass; d=google.com; s=arc-20160816; b=UuQsO0d1cj6VCSCIMvIF72fcKi0cU5vxdvFFoQzZyA2gLNJK5iaPLfKFjXH2EN5Cze qJt5GEF3d6HARYGMkdl5rrAgp8YTY5+rOH/1jhCczgIoqGNnVk2SslwtVOU2va31i0s3 DHtm0qIjO0BVgrJdEw0Z2u1UEAVELoC0Ken9Iyk2wEDUY2OY1gW4QeF9IVK6/47yy64f BFM4gEg8Nzqx2fIK8HO+40os/L9VwyrzdwNeI0eIeTtj/j5Xm9vIJ42CFu6hndgeBKVh 2F4BaB4w194nnSr/dIIC+29f7T3ji6dfoFhV5mfhZ8n1Fkj0fYtWCIW+X7N0o/2eri2b 2xAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=X7hcLWxiVmp00olQSD1jGyuS/qrE2I1YMK4YCbXooII=; fh=yZuC9+UBRVDj6bEKQGCo3a2K64/rWoBExGdU5Lj5RLw=; b=AvjqAcqgIjCHWNp6DzOHSC5oJyDR4tAHLvCfT63bMH4oNwvc2SMbRiGuogv/yXygs3 CRJ69byYEUVkGNsJ3EAGCGY7MK303oAuqgIuTK/UIDrvifoJfWTrpW1idzzLZPldNbB0 sKuppsNSBDnW3khR7ww+Ca35g6VVSXEjf3SMC3dEBXgHILnIM/EDkjIwDxGq/w+T6cGN 8/OlbuTUCo17rLYiAcKXCZukv9JSacBW2Xngg7m4WeSjlSwuli/KWBzbfErTRZ4He6xg LvlYxAdoAOXGtwvdSKOxRMrUiVQYNhD65HEZE9Z0Hvh+wLloMLx+RWXvmUY+C4OrizmN WTYQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JOZVuzd9; arc=pass (i=1); 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"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d18-20020a05620a241200b0077bcd1f26a0si6550888qkn.163.2023.12.10.07.29.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 07:29:43 -0800 (PST) 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=@gmail.com header.s=20230601 header.b=JOZVuzd9; arc=pass (i=1); 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"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C178385842B for ; Sun, 10 Dec 2023 15:29:43 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 24AEF3858D28 for ; Sun, 10 Dec 2023 15:29:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24AEF3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 24AEF3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::231 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702222161; cv=none; b=H0KqB2Xamd+n5rgzstyEq3y/Ef8ex959GLDSuy85wwqt8xvn7fb6eJkWxUEVRf0BQXPsGBkXAcBvzgnUeDfvbS+VokwH/DbeDZXussauKRzal3QRvZDRl1YX8xqc7j35vJQJTnqYZ2uOlUopfav31Dq7L7jUjFgRI5Tdv09C7hs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702222161; c=relaxed/simple; bh=JoZV777WlMJojgtTjZtKAcsU1UOu7KM6BgqnQZL5Ty0=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=lrG7/VqkJ3Hhdq2OubfmGDG6XswzAkqNU7gcqgFyiWEzEc/mdaJ4YXRt2PDr2eMsWVuCFO6DiUMMQJMSA5EbMuAjqwlrxnf/KVOS7pIAF6CpMLLxlsoxyh5dShvfgCzAae2hhHtFdM6I5FAu8awEy066eduB+h4kBBSzb6Xpk5I= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3b9e2d50e61so2274234b6e.2 for ; Sun, 10 Dec 2023 07:29:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702222158; x=1702826958; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X7hcLWxiVmp00olQSD1jGyuS/qrE2I1YMK4YCbXooII=; b=JOZVuzd9a02x/NRzz/aCJOjuRa5XwswXJXHEE3RiEXUvfxbIDxlayrLlsM+1GbuzxO x2cVoayLQGDNUwDxpGfXNbB8SV1NLTWxEPSMxB2oa2eZWWaJtj3Ifb4DEzSR4HYEvyR+ X9axiyf6zrH5rC8sO+U6bE13A53If+4De5VRCTtBAv1ijck3EkA7IGohLFem53HDjby7 4U0Zobth5Vwqj6c1JoE/5zw984FFWTD9D09KB+BeCVbJRxhy2eL75XmbkU/K3Fb4x6oL 8QYVmcQyjfrdOc090I8nFs2gQNdrU450/UQKjyQNvge9wlymw+L/3l4wiywcBBgBg+g7 Siyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702222158; x=1702826958; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X7hcLWxiVmp00olQSD1jGyuS/qrE2I1YMK4YCbXooII=; b=CG8OkR0qmdnTu4zbMqJWnBhPmpDTvF00pBrkEq01M6tHPQcGLLaz/qmaW3dN37PKA2 w6xLAVutuqJ80rLMEsTgJRnVs2Z1TjQ4rUsO0ZBi7fO5ZhQkuPLa8yZuAIQ5nTc5OKyk L1JyospFpaVCp3pnLMqWcM9F8oPHpodMcG4wWf5mQ5vS8aZOVPrAJpe9CP19t68c07ix 8czdYqjS1svOoE8UbYVpciaskHTiciFEXFBZw+iwu9BiBst2d9JGrSrPADtfTnThl9P3 ulqtvqy7E04Pi/w319l7cMjO//JZzLztBex73KC87EGDSgBuptNv+nKnpehwe2md/pVk lclA== X-Gm-Message-State: AOJu0YzC88PWzfpuuyP7RDnd4vMj+CJStKJK8hm5dtozhq2xxMVOae81 /lL2GVwaavkbTKDuti9hd0t4s2CFhGRqppze X-Received: by 2002:a05:6358:7e0e:b0:170:82a3:f6e8 with SMTP id o14-20020a0563587e0e00b0017082a3f6e8mr4449372rwm.62.1702222158328; Sun, 10 Dec 2023 07:29:18 -0800 (PST) Received: from localhost.localdomain ([222.131.165.216]) by smtp.googlemail.com with ESMTPSA id d16-20020a656210000000b005ca0ae17983sm841451pgv.8.2023.12.10.07.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 07:29:17 -0800 (PST) From: xndcn To: gcc-patches@gcc.gnu.org Cc: xndcn Subject: [PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single. Date: Sun, 10 Dec 2023 23:20:15 +0800 Message-Id: <20231210152015.126126-2-xndchn@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231210152015.126126-1-xndchn@gmail.com> References: <20231210152015.126126-1-xndchn@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784909328295147895 X-GMAIL-MSGID: 1784909328295147895 gcc/ChangeLog: * tree-cfg.cc (verify_gimple_assign_single): Fix misleading error, from "invalid LHS ..." to "invalid RHS ..." Signed-off-by: xndcn --- gcc/tree-cfg.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index d784b9115..f041786b3 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -4695,7 +4695,7 @@ verify_gimple_assign_single (gassign *stmt) if (!is_gimple_reg (lhs) && is_gimple_reg_type (TREE_TYPE (lhs))) { - error ("invalid RHS for gimple memory store: %qs", code_name); + error ("invalid LHS for gimple memory store: %qs", code_name); debug_generic_stmt (lhs); debug_generic_stmt (rhs1); return true; @@ -4721,7 +4721,10 @@ verify_gimple_assign_single (gassign *stmt) && !is_gimple_reg (rhs1) && is_gimple_reg_type (TREE_TYPE (lhs))) { - error ("invalid RHS for gimple memory store: %qs", code_name); + if (!is_gimple_reg (rhs1)) + error ("invalid RHS for gimple memory store: %qs", code_name); + else + error ("invalid LHS for gimple memory store: %qs", code_name); debug_generic_stmt (lhs); debug_generic_stmt (rhs1); return true;