* tree-ssa/alias-access-spath-1.c: new testcase.
authorJan Hubicka <hubicka@ucw.cz>
Wed, 29 May 2019 19:51:24 +0000 (21:51 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Wed, 29 May 2019 19:51:24 +0000 (19:51 +0000)
From-SVN: r271750

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-1.c [new file with mode: 0644]

index 19971c9..bb500f0 100644 (file)
@@ -1,3 +1,7 @@
+2019-05-29  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree-ssa/alias-access-spath-1.c: new testcase.
+
 2019-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/89875
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-1.c b/gcc/testsuite/gcc.dg/tree-ssa/alias-access-path-1.c
new file mode 100644 (file)
index 0000000..264f72a
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-fre3 -fno-tree-sra" } */
+struct foo
+{
+  int val;
+} *fooptr;
+struct bar
+{
+  struct foo foo;
+  int val2;
+} *barptr;
+int
+test ()
+{
+  struct foo foo = { 0 };
+  barptr->val2 = 123;
+  *fooptr = foo;
+  return barptr->val2;
+}
+
+/* { dg-final { scan-tree-dump-times "return 123" 1 "fre3"} } */