https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92152

--- Comment #14 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Created attachment 47901
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47901&action=edit
another related testcase

> But that means we now miscompile the later two tests.

Good point, those are my testcases :) I have missed it is scan-not. I will make
updated patch.

I am attaching related testcase that reads same data using two different union
fields relying on C++ initial sequence rule (as Mark Williams explained me).

"In a standard-layout union with an active member of non-union class type T1,
it is permitted to read a non-static data member m of another union member of
non-union class type T2 provided m is part of the common initial sequence of T1
and T2 (except that reading a volatile member through non-volatile glvalue is
undefined)."

This seems to indicate that we really can not disambiguate after union
reference by access path unless we implement the "common initial sequence"
check

Reply via email to