https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109956
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amonakov at gcc dot gnu.org
--- Comment #8 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
(In reply to [email protected] from comment #6)
> For the standard, dynamically allocated case, you should only need to
> allocate enough memory to contain the initial part of the struct and the
> array members being accessed - not any padding after that array. (There
> were wording problems before C99 TC2; see DR#282.)
I think the following testcase indicates that GCC assumes that tail padding is
accessible:
struct S {
int i;
char c;
char fam[];
};
void f(struct S *p, struct S *q)
{
*p = *q;
}
f:
movq (%rsi), %rax
movq %rax, (%rdi)
ret
Sorry for the tangential remark, but there seems to be a contradiction.