Alias sets for VLAs and strict aliasing warnings (PR 41673)

Joseph S. Myers joseph@codesourcery.com
Fri Oct 23 12:41:00 GMT 2009


On Fri, 23 Oct 2009, Richard Guenther wrote:

> On Fri, Oct 23, 2009 at 2:21 PM, Joseph S. Myers
> <joseph@codesourcery.com> wrote:
> > On Fri, 23 Oct 2009, Richard Guenther wrote:
> >
> >> The change is ok, but I wonder why the C FE sets
> >> TYPE_STRUCTURAL_EQUALITY_P on VLAs.  As you can see
> >
> > It's not the front end setting it - tree.c:build_index_type sets it for
> > the index type with nonconstant bounds, while tree.c:build_array_type sets
> > it for arrays if it is set for either the element type or the index type.
> 
> Ah, ok.  I wonder if it is better to handle the trivial cases like this
> in alias.c and fall back to the structurally canonical type for
> getting the alias set in case of TYPE_STRUCTURAL_EQUALITY_P
> then.  Which would be for example type_for_mode () for all
> integral types, the element type for array types and void *
> for pointer types.
> 
> That might be a better approach anyway.

I don't know why alias.c stops where it does for 
TYPE_STRUCTURAL_EQUALITY_P, but reverting the c-common.c change as part of 
changes to make this work in alias.c (that keep the testcase working) is 
preapproved.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Gcc-patches mailing list