On Thu, Apr 23, 2015 at 5:49 PM, Jason Merrill <ja...@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.