https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117912
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> --- >From what I can see, this VN is purely from vn_reference_eq and it just skips over the COMPONENT_REFs after taking into account their vro?->off (but I do not yet understand why the similar case with unions isn't handled the same). So if we want to disallow value numbering them the same before PROP_objsz in problematic cases which lead to same offset through different access path, we'd need to do it somewhere before for (; vr1->operands.iterate (i, &vro1); i++). And the problematic cases for objsz are either zero sized FIELD_DECLs (one of them but not both), or I guess as well starting offset of one field vs. ending offset of another field, say if we have struct S { char a[24]; char b[24]; char c; }; and struct S *p, then &p->a[24] might value number the same as &p->b[0] or vice versa, but __builtin_object_size (, 1) in one case should be 0 and in the other case should be 24 (minimum with actual object size).