A C testcase would look like
union A {
int alignme;
char a[4];
};
extern void abort (void);
int main()
{
union A a, b;
*(float *)&a.a[0] = 1.0;
b = a;
if (*(float *)&b.a[0] != 1.0)
abort ();
return 0;
}
it actually works, as I have added some code to the alias-oracle
to avoid "miscompiling" it (I simply avoid applying TBAA rules
here). Some obfuscating will cause it to "miscompile".
Earlier you were arguing that storing the float into the union
is ok because there's a character array member inside.