[PATCH 2/2] better dealing with OP_PHISOURCE insn

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

 



Remove checking for a case that (most probably) never happens as the
only expected instruction is OP_PHISOURCE.

For the sake of assurance, assert added with a comment easing the fix if
the assumption of OP_PHISOURCE is wrong (better then masking a problem).

Also, use `def' as existing shortcut for `phi->def'.

Tested the same way as the previous patch (together).

Signed-off-by: Jan Pokorny <pokorny_jan@xxxxxxxxx>
---
 liveness.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/liveness.c b/liveness.c
index eeff0f7..02ceed9 100644
--- a/liveness.c
+++ b/liveness.c
@@ -23,11 +23,9 @@ static void phi_defines(struct instruction * phi_node, pseudo_t target,
 		def = phi->def;
 		if (!def || !def->bb)
 			continue;
-		if (def->opcode == OP_PHI) {
-			phi_defines(def, target, defines);
-			continue;
-		}
-		defines(def->bb, phi->def, target);
+		/* if this ever fails (very unlikely), it's a sign of a regression */
+		assert(def->opcode == OP_PHISOURCE);
+		defines(def->bb, def, target);
 	} END_FOR_EACH_PTR(phi);
 }
 
-- 
1.7.1
--
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