This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/13146] inheritance for nonoverlapping_component_refs_p
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2009 12:58:51 -0000
- Subject: [Bug middle-end/13146] inheritance for nonoverlapping_component_refs_p
- References: <bug-13146-1008@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #12 from rguenth at gcc dot gnu dot org 2009-01-17 12:58 -------
Note that we have to be very careful here because
struct X {
int i;
};
struct A {
int i;
};
struct B {
struct A a;
int j;
};
int foo (struct X *p, struct B *q)
{
p->i = 0;
q->a.i = 1;
return p->i;
}
may be aliasing. One need to consult the C standard and defect reports again
for the "common initial sequence" in structs stuff.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13146