This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array should not alias
- From: "dann at godzilla dot ics dot uci dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jul 2004 21:40:48 -0000
- Subject: [Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array should not alias
- References: <20040120073544.13765.dann@godzilla.ics.uci.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dann at godzilla dot ics dot uci dot edu 2004-07-12 21:40 -------
Another testcase for whoever is going to fix this:
struct st
{
int *arr;
int c;
int d;
int fl;
};
void foo (struct st *s, int a, int b, int c, int d)
{
*(s->arr) = a; s->arr++;
*(s->arr) = b; s->arr++;
*(s->arr) = c; s->arr++;
}
void foo2 (struct st *s, int a, int b, int c, int d)
{
int *p = s->arr;
*(p) = a; p++;
*(p) = b; p++;
*(p) = c; p++;
s->arr = p;
}
The 2 functions above are compiled to the same assembly code by gcc-3.4 -O2,
the .vars dump for them should be very similar too. It is not so currently.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[tree-ssa] stores to |[tree-ssa] stores to
|different members of the |different members of the
|same pointer should not |same array should not alias
|alias |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13765