This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PRs 33816, 32921 (again, different)


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]