On Thu, Jan 24, 2019 at 6:01 AM Richard Biener
<richard.guent...@gmail.com> wrote:
>
> On Thu, Jan 24, 2019 at 2:18 AM Nikhil Benesch <nikhil.bene...@gmail.com> 
> wrote:
> >
> > diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
> > index 7fbdd074119..4e9e0e3026a 100644
> > --- a/gcc/go/go-gcc.cc
> > +++ b/gcc/go/go-gcc.cc
> > @@ -1049,6 +1049,7 @@ Gcc_backend::set_placeholder_pointer_type(Btype* 
> > placeholder,
> >      }
> >    gcc_assert(TREE_CODE(tt) == POINTER_TYPE);
> >    TREE_TYPE(pt) = TREE_TYPE(tt);
> > +  TYPE_CANONICAL(pt) = TYPE_CANONICAL(tt);
>
> This doesn't make sense - it says to the middle-end that
> T* is equal to T?

Not quite. When this function is called, pt is a placeholder of type U*,
where U is some unknown type, and tt has type T*, where T is a complete
type. The goal is to make pt look exactly like tt, i.e., fill in the
placeholder.

I realize now that my changelog entry isn't quite precise about this.
Perhaps the second entry should instead read "Propagate the canonical
type from the desired pointer type to the placeholder pointer type".

Reply via email to