aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2012-06-12 11:52:41 +0000
committerMichael Matz <matz@gcc.gnu.org>2012-06-12 11:52:41 +0000
commit175a7536b131a2b90213a8ded70437339f4af1e4 (patch)
tree08829258d4fe6802e2f465d6ba336e5a409258ca /gcc/testsuite/gcc.dg
parentd3b00ce368f3d32a4db4dac4538a90920f6365ef (diff)
downloadgcc-175a7536b131a2b90213a8ded70437339f4af1e4.zip
gcc-175a7536b131a2b90213a8ded70437339f4af1e4.tar.gz
gcc-175a7536b131a2b90213a8ded70437339f4af1e4.tar.bz2
alias.c (nonoverlapping_component_refs_p): Take two rtx arguments.
* alias.c (nonoverlapping_component_refs_p): Take two rtx arguments. (nonoverlapping_memrefs_p): Don't call it here ... (true_dependence_1): ... but here. testsuite/ * gcc.dg/torture/alias-1.c: New test. From-SVN: r188448
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r--gcc/testsuite/gcc.dg/torture/alias-1.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/alias-1.c b/gcc/testsuite/gcc.dg/torture/alias-1.c
new file mode 100644
index 0000000..1e60341
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/alias-1.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+/* { dg-options "-fschedule-insns" } */
+
+extern void abort (void) __attribute__((noreturn));
+
+struct B { int a; int b;};
+struct wrapper {
+union setconflict
+{
+ struct S { char one1; struct B b1; } s;
+ struct T { struct B b2; char two2; } t;
+} a;
+};
+
+int
+main ()
+{
+ int sum = 0;
+ int i;
+ struct wrapper w;
+ struct B *p;
+
+ p = &w.a.s.b1;
+ asm ("": "=r" (p):"0" (p));
+ p->a = 0;
+ asm ("": "=r" (p):"0" (p));
+ sum += p->a;
+
+ p = &w.a.t.b2;
+ asm ("": "=r" (p):"0" (p));
+ p->b = 1;
+ asm ("": "=r" (p):"0" (p));
+ sum += p->b;
+
+ if (sum != 1)
+ abort();
+ return 0;
+}