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

--- Comment #2 from keinfluegeltier at posteo dot de ---
The aliasing rule in §6.5.1 does not forbid the access if the lvalue used has
"_a type compatible with the effective type of the object_".

The effective type of `x` is the declared one, which is the type `s3` in the
second translation unit and is specified to be compatible with both `s1` and
`s2_alt` that are used to access `x`. So the call can't have undefined behavior
by §6.5.1.

I do not see anything else that could cause the call to have undefined
behavior.

(But I agree that it seems weird that compatibility doesn't form an equivalence
relation among structures.)

Reply via email to