https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67955
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |alias, missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2015-10-14 Ever confirmed|0 |1 --- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to vries from comment #2) > (In reply to Richard Biener from comment #1) > > The same points-to set results from > > > > int *p = (int *)((char *)&a + 2); > > > > or even > > > > int *p = &a + 1; > > > > I see, I didn't realize that. But AFAICT, in both these cases, storing to *p > is illegal (if 'a' is a scalar int). > > > so you can't use points-to info that way (to derive a must-alias). > > I see your point related to an array object, there pointers to different > array elements would have identical points-to sets. > > I wonder though: if we have a store '*p = 0', and the size of the store is > the same as the size of the pointed-to object of pointer p, can't we > conclude that pointer p points to the start of the object? Yes, for that special case we indeed can do that. I wonder if it's worth doing though ;) Care to adjust stmt_kills_ref_p accordingly and instrument it to see how many times during bootstrap this triggers?