@@ -210,6 +210,9 @@ void kill_instruction(struct instruction *insn)
case OP_PHI:
clear_phi(insn);
break;
+ case OP_PHISOURCE:
+ kill_use(&insn->phi_src);
+ break;
case OP_SYMADDR:
repeat_phase |= REPEAT_SYMBOL_CLEANUP;
new file mode 100644
@@ -0,0 +1,21 @@
+int foo(int a, int b)
+{
+ int r = a + b;
+
+ if (a && 0) {
+ int s = r;
+ if (b)
+ s = 0;
+ (void) s;
+ }
+
+ return 0;
+}
+
+/*
+ * check-name: kill-phisrc
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ * check-output-excludes: add\\.
+ */
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- simplify.c | 3 +++ validation/kill-phisrc.c | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 validation/kill-phisrc.c