This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/13765] [tree-ssa] stores to different members of the same array should not alias


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]