aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--flow.c2
-rw-r--r--validation/kill-rewritten-load.c16
2 files changed, 17 insertions, 1 deletions
diff --git a/flow.c b/flow.c
index 8409fac6..fbac9336 100644
--- a/flow.c
+++ b/flow.c
@@ -401,7 +401,7 @@ void rewrite_load_instruction(struct instruction *insn, struct pseudo_list *domi
* pseudo.
*/
FOR_EACH_PTR(dominators, phi) {
- phi->def->bb = NULL;
+ kill_instruction(phi->def);
} END_FOR_EACH_PTR(phi);
convert_load_instruction(insn, new);
return;
diff --git a/validation/kill-rewritten-load.c b/validation/kill-rewritten-load.c
new file mode 100644
index 00000000..31b895e5
--- /dev/null
+++ b/validation/kill-rewritten-load.c
@@ -0,0 +1,16 @@
+int foo(int i)
+{
+ i++;
+ if (i && 0)
+ i;
+ return 0;
+}
+
+
+/*
+ * check-name: kill-rewritten-load
+ * check-command: test-linearize -Wno-decl $file
+ * check-output-ignore
+ *
+ * check-output-excludes: add\\.
+ */