[PATCH 01/16] add killing of OP_SLICEs

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

 



Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 simplify.c              |  1 +
 validation/kill-slice.c | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 validation/kill-slice.c

diff --git a/simplify.c b/simplify.c
index 2a1f0b200..90e45bf1a 100644
--- a/simplify.c
+++ b/simplify.c
@@ -203,6 +203,7 @@ void kill_instruction(struct instruction *insn)
 	case OP_PTRCAST:
 	case OP_SETVAL:
 	case OP_NOT: case OP_NEG:
+	case OP_SLICE:
 		kill_use(&insn->src1);
 		break;
 
diff --git a/validation/kill-slice.c b/validation/kill-slice.c
new file mode 100644
index 000000000..00db0e0f7
--- /dev/null
+++ b/validation/kill-slice.c
@@ -0,0 +1,19 @@
+struct bar {
+	int x;
+	int y[2];
+};
+struct bar bar(void);
+
+int foo(void)
+{
+	int x = bar().x;
+	return x & 0;
+}
+
+/*
+ * check-name: kill-slice
+ * check-command: test-linearize -Wno-decl $file
+ * check-output-ignore
+ *
+ * check-output-excludes: slice\\.
+ */
-- 
2.11.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