linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix missing itype in SEL(x, 0/1, 1/0) --> (x ==/!= 0)
@ 2021-07-29 21:14 Luc Van Oostenryck
  0 siblings, 0 replies; only message in thread
From: Luc Van Oostenryck @ 2021-07-29 21:14 UTC (permalink / raw)
  To: linux-sparse; +Cc: Luc Van Oostenryck

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-29 21:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-29 21:14 [PATCH] fix missing itype in SEL(x, 0/1, 1/0) --> (x ==/!= 0) Luc Van Oostenryck

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 NNTP newsgroup(s).