This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PRs 33816, 32921 (again, different)
- From: "Diego Novillo" <dnovillo at google dot com>
- To: "Richard Guenther" <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 19 Oct 2007 10:38:57 -0400
- Subject: Re: [PATCH] Fix PRs 33816, 32921 (again, different)
- References: <Pine.LNX.4.64.0710191628280.4086@zhemvz.fhfr.qr>
On 10/19/07, Richard Guenther <rguenther@suse.de> wrote:
> This is too conservative, but we cannot call record_component_aliases
> here because some frontends still change the aggregates after
> layout_type. */
> ! if (AGGREGATE_TYPE_P (type))
> ! gcc_assert (!TYPE_ALIAS_SET_KNOWN_P (type));
You'll need to change the comment here. Something like "Incomplete
types should not have a known alias set.".
> + /* We don't want to set TYPE_ALIAS_SET for incomplete types. */
> + if (!COMPLETE_TYPE_P (t))
> + {
> + /* For arrays with unknown size the conservative answer is the
> + alias set of the element type. */
> + if (TREE_CODE (t) == ARRAY_TYPE)
> + return get_alias_set (TREE_TYPE (t));
> +
> + /* But return zero as a conservative answer for incomplete types. */
> + return 0;
> + }
This makes sense to me. If the type is still incomplete we don't want
to commit to consider its alias set as known and fixed.