https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88490
--- Comment #5 from joseph at codesourcery dot com <joseph at codesourcery dot com> --- On Fri, 14 Dec 2018, rguenther at suse dot de wrote: > Note I do not think the C standard is sufficiently clear with regarding > to restrict qualified pointers loaded from memory. I think this is where "Every access that modifies X shall be considered also to modify P, for the purposes of this subclause." comes in. (See what I said at <https://gcc.gnu.org/ml/gcc-bugs/2005-01/msg03394.html>.) Modifying s->d[n][0] is considered to modify s->d[n], and so considered to modify s->d, and so considered to modify s. (It's still perfectly valid to have n == k; what's not valid is aliasing between objects accessed via s->d[0] and s->d[1], for example.)