[PATCH 7/7] big-shift: do not optimize over-sized ASRs

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

 



Like GCC, we don't want to touch ASRs with an over-sized shift count.

Return as soon as such shifts are detected.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 simplify.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/simplify.c b/simplify.c
index 5afa0c9ca..80c3cebca 100644
--- a/simplify.c
+++ b/simplify.c
@@ -581,6 +581,8 @@ static int simplify_shift(struct instruction *insn, pseudo_t pseudo, long long v
 	size = insn->size;
 	switch (insn->opcode) {
 	case OP_ASR:
+		if (value >= size)
+			return 0;
 		break;
 	case OP_LSR:
 		size = operand_size(insn, pseudo);
-- 
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