tree-optimization/112495 - alias versioning and address spaces
Checks
Commit Message
We are not correctly handling differing address spaces in dependence
analysis runtime alias check generation so refuse to do that.
Bootstrapped and tested on x86_64-unknown-linux-gnu. I'm double-checking
hundreds of ACATS FAILs (segfaults), will push if those are latent.
Richard.
PR tree-optimization/112495
* tree-data-ref.cc (runtime_alias_check_p): Reject checks
between different address spaces.
* gcc.target/i386/pr112495.c: New testcase.
---
gcc/testsuite/gcc.target/i386/pr112495.c | 12 ++++++++++++
gcc/tree-data-ref.cc | 7 +++++++
2 files changed, 19 insertions(+)
create mode 100644 gcc/testsuite/gcc.target/i386/pr112495.c
new file mode 100644
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+typedef struct { int v; } T1;
+typedef struct { T1 v[32]; } T2;
+
+T1 s;
+T1 f1() { return s; }
+
+void f2(__seg_gs T2 *p, int n) {
+ for (int i = 0; i < n; ++i) p->v[i] = f1();
+}
@@ -1640,6 +1640,13 @@ runtime_alias_check_p (ddr_p ddr, class loop *loop, bool speed_p)
"runtime alias check not supported for"
" outer loop.\n");
+ /* FORNOW: We don't support handling different address spaces. */
+ if (TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (DR_BASE_ADDRESS (DDR_A (ddr)))))
+ != TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (DR_BASE_ADDRESS (DDR_B (ddr))))))
+ return opt_result::failure_at (DR_STMT (DDR_A (ddr)),
+ "runtime alias check between different "
+ "address spaces not supported.\n");
+
return opt_result::success ();
}