diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-01-21 18:18:52 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-01-21 18:18:52 +0000 |
commit | fb01523df3d05efe45df14bbc79881baf0d041d2 (patch) | |
tree | a4b8449e349cfd55686663c34eb51b747cc1a22b /gcc/testsuite/gcc.dg/tree-ssa/struct-aliasing-2.c | |
parent | 1d2c8bb01eea3eaba001f9a8942576cc8431c1da (diff) | |
download | gcc-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.c | 18 |
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" } } */ + |