[PATCH 2/9] reorg simplify_and_or_mask()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No functional changes here. Just adding temporary vars
and switching the order of the last if in preparation
of some incoming changes in this function.
---
 simplify.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/simplify.c b/simplify.c
index 455b1a041..6b813d4f9 100644
--- a/simplify.c
+++ b/simplify.c
@@ -827,12 +827,15 @@ static int simplify_seteq_setne(struct instruction *insn, long long value)
 static int simplify_and_or_mask(struct instruction *insn, pseudo_t and, pseudo_t other, unsigned long long mask)
 {
 	struct instruction *def = and->def;
+	unsigned long long omask, nmask;
 
 	if (!constant(def->src2))
 		return 0;
-	if (def->src2->value & mask)
-		return 0;
-	return replace_pseudo(insn, &insn->src1, other);
+	omask = def->src2->value;
+	nmask = omask & mask;
+	if (nmask == 0)
+		return replace_pseudo(insn, &insn->src1, other);
+	return 0;
 }
 
 static int simplify_constant_mask(struct instruction *insn, unsigned long long mask)
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux