Hi,

On Fri, 15 Mar 2019, Richard Biener wrote:

> >But different enums aren't compatible with each other (or are they?), 
> >while your fix simply gives enums the aliasing set of the underlying 
> >type, i.e. makes all of them alias with each other.  That's quite 
> >conservative.
> 
> But that follows from the need to be able to access an enum as int and 
> the other way around. So both alias sets need to be subsets of each 
> other which means they need to be equal.

No.  Suppose you have enum E1, E2 and int, you have to arrange it such 
that aliasset(E1) \subset aliasset(int) && aliasset(E2) \subset aliasset(int).
That doesn't (and shouldn't) imply any relationship between aliassets of 
E1 and E2.  Of course you can only express something else than 
equality when you aren't making all three of them the same 
set-identifiers.

I.e. what you touched is the naming of sets (giving them identifiers), 
whereas you should have touched where the relations between the sets are 
established.  I _think_ instead of giving enum and basetypes the same 
alias set you should have rather called record_alias_subset(intset, 
enumset) (or the other way around, I'm always confused there :) ).


Ciao,
Michael.

Reply via email to