------- Comment #11 from rguenth at gcc dot gnu dot org  2008-05-16 11:12 
-------
C testcase:

struct A {
  int i;
};
struct B {
  struct A a;
  int j;
};

int foo (struct A *p, struct B *q)
{
  p->i = 0;
  q->j = 1;
  return p->i;
}

we should optimize this to return zero.

The reasoning is that while p may access a part of *q we still can tell
that q->j is not in that part.  Thus for offset based disambiguation with
two pointers we can in some cases find a common base.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c++                         |middle-end


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13146

Reply via email to