* 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 19971c9a1ba308bd47d1e7557dd100f17be2f73a..bb500f07e8c7763d641872f7efa927aab91b3af8 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"} } */