https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121527
--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm not able to capture the gist of the Ada code and the peculiarities of the
V_C_Es (or whether they are required). But you can do sth like the following
with a GIMPLE testcase (otherwise V_C_Es are impossible to create in C).
I only have a theory as to SRA and the rest of the middle-end interpreting
aggregate copies differently; SRA does so field-wise, (sometimes?) ignoring
padding, while the rest treats it as a byte-wise copy. But as said, I
don't know whether the Ada testcases V_C_E involve turning padding into
real fields or vice-versa.
struct S { int i; int j; };
struct R { struct S s; int k; };
struct R r1, r2;
void bar(struct R *);
void __GIMPLE foo ()
{
int tem;
struct R r2;
struct R r3;
r1.k = 5;
__VIEW_CONVERT <struct S> (r2) = __VIEW_CONVERT <struct S> (r1);
tem = r1.k;
r2.k = tem;
r3 = r2;
bar (&r3);
}