aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--simplify.c3
-rw-r--r--validation/kill-phisrc.c21
2 files changed, 24 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index 90e45bf1..ced63bfa 100644
--- a/simplify.c
+++ b/simplify.c
@@ -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;
diff --git a/validation/kill-phisrc.c b/validation/kill-phisrc.c
new file mode 100644
index 00000000..f00dbed2
--- /dev/null
+++ b/validation/kill-phisrc.c
@@ -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\\.
+ */