From: Luc Van Oostenryck <lucvoo@kernel.org>
To: linux-sparse@vger.kernel.org
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: [PATCH] fix missing itype in SEL(x, 0/1, 1/0) --> (x ==/!= 0)
Date: Thu, 29 Jul 2021 23:14:48 +0200 [thread overview]
Message-ID: <20210729211448.34171-1-lucvoo@kernel.org> (raw)
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Since commit 226b62bc2ee4 ("eval_insn: give an explicit type to compare's operands")
it's needed to set the operands' type of every compare instructions but
it was missing in this case where a select is transformed into a compare.
So, add the missing type.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
simplify.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/simplify.c b/simplify.c
index 02709ce4853c..0353642ba188 100644
--- a/simplify.c
+++ b/simplify.c
@@ -2449,6 +2449,7 @@ static int simplify_select(struct instruction *insn)
opcode = OP_SET_NE;
}
insn->opcode = opcode;
+ insn->itype = insn->type;
/* insn->src1 is already cond */
insn->src2 = src1; /* Zero */
return REPEAT_CSE;
--
2.32.0
reply other threads:[~2021-07-29 21:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210729211448.34171-1-lucvoo@kernel.org \
--to=lucvoo@kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).