> On Tue, 11 Jun 2019, Jan Hubicka wrote: > > > > So the important thing is that during matching the paths > > > aptr->a and *bptr we return false for > > > same_type_for_tbaa (int *, struct a *), correct? But if > > > we can do that then the alias sets should not conflict in > > > the first place and we shouldn't need any path-based disambiguation > > > here. > > > > > > So to me this is the wrong place to fix. > > > > The alias sets of int * conflict with alias set of struct a * > > since that one is same as void * and we make void * to conflict > > with all pointers. > > > > However we also do not want to return -1 for things like > > same_type_for_tbaa (int *, struct a) > > which we do currently, since int * is TYPE_STRUCTURAL_EQUALITY > > and struct a is not. > > Yes, but that basically boils down to handling !AGGREGATE_TYPE_P > vs AGGREGATE_TYPE_P in a better way, not looking into pointed-to > types.
OK, so your preferred vairant would be to make same_type_for_tbaa to return 0 instead of -1 if one type is AGGREGATE_TYPE_P and other !AGGREGATE_TYPE_P and extend alias set calculation to somewhat account for the non-transitive rules for pointers TBAA? What about arrays? Honza > > > Here you may declare struct a as > > struct a {int *a;}; > > and alias sets will be in conflict even w/o void * globing. > > > > Honza > > > > -- > Richard Biener <rguent...@suse.de> > SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany; > GF: Felix Imendörffer, Mary Higgins, Sri Rasiah; HRB 21284 (AG Nürnberg)