On Wed, 9 Dec 2015, Arnaud Charlet wrote:
> > Hi
> > this patch implements the trik for punting if we get too many nested
> > pointers.
> > This fixes the ada tstcases. Curiously enough I would like to replace
> > safe_push
> > by quick_push but doing so I get weird error about freeing non-heap object
> > in the auto_vec desructor...
> >
> > Bootstraping/regtesting x86_64-linux. Ok if it passes?
> >
> > Honza
> >
> > * alias.c (get_alias_set): Punt after getting 8 nested pointers.
> >
> > Index: alias.c
> > ===================================================================
> >
> > --- alias.c (revision 231439)
> > +++ alias.c (working copy)
> > @@ -990,6 +990,14 @@ get_alias_set (tree t)
> > || TREE_CODE (p) == VECTOR_TYPE;
> > p = TREE_TYPE (p))
> > {
> > + /* Ada supports recusive pointers. Instead of doing recrusion check
>
> typo above: recrusion -> recursion
>
> > + just give up once the preallocated space of 8 elements is up.
> > + In this case just punt to void * alias set. */
> > + if (reference.length () == 8)
>
> We don't use magic numbers in general, can you please replace by a named
> constant instead?
Instead of a magic constant you could also use sth like TREE_VISITED
(or a pointer-map). Of course that's a lot more expensive.
> > + {
> > + p = ptr_type_node;
> > + break;
> > + }
> > if (TREE_CODE (p) == REFERENCE_TYPE)
> > /* In LTO we want languages that use references to be compatible
> > with languages that use pointers. */
>
> I'll let others comment on the general idea.
>
>
--
Richard Biener <[email protected]>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB
21284 (AG Nuernberg)