RFC: variant and ODR based type merging during LTO streaming
Richard Biener
rguenther@suse.de
Mon Oct 1 13:39:00 GMT 2018
On Mon, 1 Oct 2018, Jan Hubicka wrote:
> > > I see. So one possible canonicalization is to make _all_
> > > pointer-typed FIELD_DECLs point to incomplete variants since the memory
> > > accesses should already have the "proper" access types. Can you
> > > get statistics on that? Not sure how to get an "incomplete" type
> > > though (iff we can simply copy the type and NULL TYPE_FIELDs and
> > > TYPE_SIZE and friends) - again I'd do that at FLD time.
> >
> > So sth like
> >
> > tp = build_distinct_type_copy (t);
> > TYPE_FIELDS (tp) = NULL_TREE;
> > TYPE_SIZE (tp) = NULL_TREE;
> > TYPE_SIZE_UNIT (tp) = NULL_TREE;
> > tp = type_hash_canon (tp);
> >
> > of course we "leak" the original type in used COMPONENT_REFs
> > (may also cause some verifier ICEs here if the types mismatch that
> > of the FIELD_DECLs) and in aggregate copies, etc. But I wonder
> > how much "unused" unnecessary types we have. That is, I'd paper
> > over the ICEs this causes and not fixup the IL stream at first for
> > example.
>
> I had patch to play with this as well, let me see if I can revive it.
> One problem here is that we will lose info about ODR violations that happens
> through pointers.
How so, if we keep the mangled name of the pointed-to types?
Richard.
> Honza
>
>
--
Richard Biener <rguenther@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)
More information about the Gcc-patches
mailing list