> 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

Thanks, updated in my copy.
> > 
> > > +      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.

Yep, I think in this specific case a magic constant is resonable - it makes the
code a lot easier and I simply can't think of sane use for more than 8
pointers.  Of course it is not particularly time sensitive thing, so I can make
a version with pointer map.

I do not think I can safely use TREE_VISITED here since get_alias_set is
called from random parts of the compiler.

Honza
> 
> > > +     {
> > > +       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 <rguent...@suse.de>
> SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 
> 21284 (AG Nuernberg)

Reply via email to