summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-21 18:18:52 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-21 18:18:52 +0000
commitfb01523df3d05efe45df14bbc79881baf0d041d2 (patch)
treea4b8449e349cfd55686663c34eb51b747cc1a22b /gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
parent1d2c8bb01eea3eaba001f9a8942576cc8431c1da (diff)
downloadgcc-fb01523df3d05efe45df14bbc79881baf0d041d2.tar.gz
2009-01-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r143546 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@143548 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c')
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
new file mode 100644
index 00000000000..aa9e142bba0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c
@@ -0,0 +1,18 @@
+/* { dg-do "compile" } */
+/* { dg-options "-O2 -fdump-tree-fre" } */
+
+struct S { unsigned f; };
+
+int
+foo ( struct S *p)
+{
+ int *q = (int *)&p->f;
+ int i = *q;
+ return i + p->f;
+}
+
+
+/* There should only be one load of p->f because fwprop can change *(int *)&p->f into just (int)p->f. */
+/* { dg-final { scan-tree-dump-times "p_.\\\(D\\\)->f" 1 "fre" } } */
+/* { dg-final { cleanup-tree-dump "fre" } } */
+