From patchwork Sun Dec 10 14:59:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: xndcn X-Patchwork-Id: 176349 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp6555875vqy; Sun, 10 Dec 2023 07:00:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVmbPJheZl+G5XwYZ7CWfY1X5rIF8vASKZK+htBXzuHBr2adPRkMixZPNEhhvtnIx4AUaa X-Received: by 2002:a25:ae8a:0:b0:db7:dacf:61f6 with SMTP id b10-20020a25ae8a000000b00db7dacf61f6mr1647923ybj.72.1702220426034; Sun, 10 Dec 2023 07:00:26 -0800 (PST) Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id k1-20020a67e3c1000000b00464806b7207si1062345vsm.118.2023.12.10.07.00.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Dec 2023 07:00:26 -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=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=iO6B9jn+; arc=fail (body hash mismatch); 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=fail (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 B1E393858296 for ; Sun, 10 Dec 2023 15:00:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by sourceware.org (Postfix) with ESMTPS id 194FD3858CD1 for ; Sun, 10 Dec 2023 15:00:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 194FD3858CD1 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 194FD3858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::635 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702220402; cv=none; b=mi6lbppAXvPRlDi5H+s/vBLq7scxlGMDQ1Ybl0IFFwYU4mPJ1AjTxq7TMY/RvQesVXajVbyYcadUpZ/9nF8kh9JCEAcKxldQMHyn3OSSidFjcCj2tixUVFEc+/NoatvmS/QCW8puFH6XYzUZoL/TE40GMAnU5ZaK+DW0i8teogU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702220402; c=relaxed/simple; bh=3zk3Yy1z+3qDYT2I1eauN04hqHFBz5jyJazQ5L4eXfA=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=fTP7f2F9MpiNiyPAbUf+r8XdjIt6pz10GtvFjqn0PjxY/AL44TENem0cH7EQeH9iRj1F/FxrWZo/0mIrYQubeDCtrw81arm4npo3XnNYnCsmTH2Lcf9QUVdG3hz9z8Fgz3cyjeW6NTr7MmlAJVBnnYhdxVLDNplVxUBgzBtSORw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a1d2f89ddabso444909166b.1 for ; Sun, 10 Dec 2023 07:00:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702220399; x=1702825199; darn=gcc.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=1AxVG1dVCuCOVhF9fa/voP6865i4hbolmlQRrgJ2CAY=; b=iO6B9jn+TwX+Ua0aAf0XfuxP2tHYiJ233KB5B4ipHP2jufNGBPkA6a1V1QBO/de+hn VDQSfjxQy6MlRVOE8zGTHNuK17zkTDNT0fA8rOmKiEXI74g6HsowtO3whB5/vz/L+Q26 yXhI/zy751Tr3kHnrGCWADDthTUDnfI4ycRNYAcYf/kH2EY75lM+wq6rjbz0j0t288HJ BqS/03fbvdfbiGTVsypjagK95m/ZpjcI2EwBGfM1bzuJhLLEEL1DWuqaynqsrCKWgMCf FIURsN6M4Zq51T9BiqqpUHo63/E3caimw50PNJRSornVsdyIG5Gmyh0wz9Bf6ttXiIqP KlKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702220399; x=1702825199; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1AxVG1dVCuCOVhF9fa/voP6865i4hbolmlQRrgJ2CAY=; b=DMzGL/tAEMIGI1Lxp1DEwMMP8s5KmGe1VbfhkPi8R6lMXPDnoANpyktTPTD8NhACLt pwcWj6EbP6QIWE/JDkxeMPglNP5iX79aWPk4z1nTxWMoMgkUwEobxb29pFClolpWuXqk S3/6REvlUCXkbxpOySbkHBt0stOrA9c88129CpcFAsOIdMC5iJ0nRWXLaCEsbcAGZwMt 2eN0KKJp5zGDl93SnjLoxEEcJfeZl2/d3oKDFruD+/RfvepeHtVjXXvhHu8tJ1n9ilxd FJJhGadpxsuxWEXvNmHy0noN1qmG2yXS4f2PyoM1TCLKmPk7MXGitRwzTHxTaPIZEWt/ oIbw== X-Gm-Message-State: AOJu0YxnrfEvzDWnZGOiV9AKxGvL9j8cvW7FnhX6y7s32bTk3FWCAya6 jv0HqAhaPwYBTYSzLHEsCW/sVGx8ZgBtTqw6QY1RzNC6x6I= X-Received: by 2002:a17:907:1114:b0:a19:a19b:7891 with SMTP id qu20-20020a170907111400b00a19a19b7891mr1271119ejb.84.1702220399159; Sun, 10 Dec 2023 06:59:59 -0800 (PST) MIME-Version: 1.0 From: xndcn Date: Sun, 10 Dec 2023 22:59:47 +0800 Message-ID: Subject: [PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, 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: 1784907485560461459 X-GMAIL-MSGID: 1784907485560461459 Hi, I am a newbie in GCC, and I do not have access to git repo. I found some misleading error messages in verify_gimple_assign_single function of tree-cfg.cc. It prompt error "invalid RHS for gimple memory store: ", but it checks lhs in fact. From 72fc4abe635c3e35ac31457aeba92b528f0574fe Mon Sep 17 00:00:00 2001 From: xndcn Date: Sun, 10 Dec 2023 22:38:16 +0800 Subject: [PATCH] tree-cfg: Fix misleading error message in verify_gimple_assign_single. 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; -- 2.25.1