This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Alias sets for VLAs and strict aliasing warnings (PR 41673)
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.
Thanks,
Richard.
> --
> Joseph S. Myers
> joseph@codesourcery.com
>