> We have a good place in the middle-end to apply such rules which > is component_uses_parent_alias_set_from - this is where I move > the logic that is duplicated in various frontends. > > The Java and Ada frontends do not allow union type punning (LTO does), > so this patch may eventually pessimize them. I don't care anything > about Java but Ada folks might want to chime in.
The role of UNION_TYPE is negligible in Ada, it's only used for unchecked unions, which are quite rare. Moreover, they are explicitly designed to be compatible with C unions so behaving like them kind of makes sense I think. -- Eric Botcazou