https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105689
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- It is because of CSE. The warning sees this IL: _1 = &me_3(D)->sub.field1; access_1 (_1); access_2 (_1); and so it warns for the second call because the size of me->sub.field1 passed to it is smaller than struct subobject. The attribute access on access_2() is what tells it to use the size of struct subobject. The CSE substitution causes false positives in other contexts besides calls to functions with attribute access. IIRC, one of the ideas for dealing with this we discussed was to have CSE use the largest subobject instead whatever it comes across first.