This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA (tree.c): PATCH for may_alias vs. TYPE_CANONICAL, related to c++/50800
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 24 Apr 2015 10:13:38 +0200
- Subject: Re: RFA (tree.c): PATCH for may_alias vs. TYPE_CANONICAL, related to c++/50800
- Authentication-results: sourceware.org; auth=none
- References: <55391495 dot 8040103 at redhat dot com>
On Thu, Apr 23, 2015 at 5:49 PM, Jason Merrill <jason@redhat.com> wrote:
> In general, TYPE_CANONICAL of a type strips all attributes. An exception to
> this seems to be that TYPE_REF_CAN_ALIAS_ALL remains set on the
> TYPE_CANONICAL of a pointer/reference type even though its TREE_TYPE no
> longer has the may_alias attribute, and is inconsistent with
> "affects_type_identity" being false for may_alias. This seems to have been
> a mistake in the patch that first introduced TYPE_CANONICAL, rather than a
> deliberate choice.
>
> I'm also planning to fix 50800 in the front end, but this patch still seems
> like an improvement.
>
> Tested x86-64-pc-linux-gnu, OK for trunk?
Looks good to me. We eventually were confused by alias.c get_alias_set
dropping to TYPE_CANONICAL (TYPE_MAIN_VARIANT (T)) before determining
the alias set of a type T. But of course ref-all is only relevant for
the alias-set
of type *T.
Richard.