This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Enable pointer TBAA for LTO
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: Bernd Schmidt <bschmidt at redhat dot com>, Richard Biener <rguenther at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 11 Nov 2015 23:31:21 +0100
- Subject: Re: Enable pointer TBAA for LTO
- Authentication-results: sourceware.org; auth=none
- References: <20151108204618 dot GA68715 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1511101306050 dot 10078 at zhemvz dot fhfr dot qr> <20151110181515 dot GB78110 at kam dot mff dot cuni dot cz> <alpine dot LSU dot 2 dot 11 dot 1511111019350 dot 7543 at zhemvz dot fhfr dot qr> <564337E7 dot 2070802 at redhat dot com> <20151111221359 dot GA93507 at kam dot mff dot cuni dot cz>
> > On 11/11/2015 10:21 AM, Richard Biener wrote:
> > >On Tue, 10 Nov 2015, Jan Hubicka wrote:
> > >>The reason is that TYPE_CANONICAL is initialized in get_alias_set that may be
> > >>called before we finish all merging and then it is more fine grained than what
> > >>we need here (i.e. TYPE_CANONICAL of pointers to two differnt types will be
> > >>different, but here we want them to be equal so we can match:
> > >>
> > >>struct aa { void *ptr;};
> > >>struct bb { int * ptr;};
> > >>
> > >>Which is actually required for Fortran interoperability.
> >
> > Just curious, is this sort of thing documented anywhere?
>
> See http://www.j3-fortran.org/doc/year/10/10-007.pdf, section 15 (interoperability with C).
> It defines that C_PTR is compatible with any C non-function pointer.
.. and if you ask about GCC side documentation, I added testcases that should
trigger if the Fortran interoperability breaks. I do not think we want to
document the above compatibility explicitly, because in future we may want to
have more fine grained TBAA for types that are not shared across fortran and C
code (= most types in practice)
Honza
>
> Honza
> >
> >
> > Bernd