aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--flow.c2
-rw-r--r--validation/memops/partial-load00.c29
2 files changed, 29 insertions, 2 deletions
diff --git a/flow.c b/flow.c
index 1a871df1..9b43e01a 100644
--- a/flow.c
+++ b/flow.c
@@ -511,8 +511,6 @@ int dominates(pseudo_t pseudo, struct instruction *insn, struct instruction *dom
return -1;
}
if (!same_memop(insn, dom)) {
- if (dom->opcode == OP_LOAD)
- return 0;
if (!overlapping_memop(insn, dom))
return 0;
return -1;
diff --git a/validation/memops/partial-load00.c b/validation/memops/partial-load00.c
new file mode 100644
index 00000000..cc6c3130
--- /dev/null
+++ b/validation/memops/partial-load00.c
@@ -0,0 +1,29 @@
+union u {
+ double d;
+ int i[2];
+};
+
+void use(union u);
+
+int foo(double x, double y)
+{
+ union u u;
+ int r;
+
+ u.d = x;
+ r = u.i[0];
+ u.d = y;
+
+ use(u);
+ return r;
+}
+
+/*
+ * check-name: partial-load00
+ * check-command: test-linearize -Wno-decl $file
+ *
+ * check-output-ignore
+ * check-output-contains: store\\.
+ * check-output-contains: load\\.
+ * check-output-returns: %r2
+ */