From 701ce0cadbd5eb0655ab0c33de5c8a337a498a34 Mon Sep 17 00:00:00 2001
From: Luc Van Oostenryck
Date: Mon, 6 Jan 2020 01:01:18 +0100
Subject: memops: kill dead loads before phi-node conversion
During load simplification it may happen that a load is unused
but if this fact is ignored and the usual conversion to a phi-node
is made, then this value may seem to be needed and can't anymore
be simplified away.
Fix this by removing dead loads during load simplification.
Signed-off-by: Luc Van Oostenryck
---
validation/memops/kill-dead-loads00.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 validation/memops/kill-dead-loads00.c
(limited to 'validation')
diff --git a/validation/memops/kill-dead-loads00.c b/validation/memops/kill-dead-loads00.c
new file mode 100644
index 00000000..df7ec037
--- /dev/null
+++ b/validation/memops/kill-dead-loads00.c
@@ -0,0 +1,22 @@
+void fun(void);
+
+void foo(int *p)
+{
+ for (*p; *p; *p) {
+l:
+ fun();
+ }
+
+ if (0)
+ goto l;
+}
+
+/*
+ * check-name: kill-dead-loads00
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ * check-output-excludes: phi\\.
+ * check-output-pattern(1): load\\.
+ * check-output-end
+ */
--
cgit 1.2.3-korg