This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RFC] Fix alias-set generation for array types
> No, I mean a pointer to an array of int, with unspecified (or variable)
> length with non-aliased component int. At least the variable length
> one, at least if the length is 10 at runtime, should conflict with
> A, the array.
Only if they have the same alias sets.
In Ada, if you have
type X is array (1..10) of Integer;
type Y is array (1..10) of Integer;
X and Y have different alias sets (and have TYPE_NONALIASED_COMPONENT).
There is no way to construct a pointer that can point to either of
them. This fundamental to the Ada type system. So your example can't
occur in Ada.
It really can't occur AT ALL unless you have two array types with the same
alias set, one of which has TYPE_NON_ALIASED_COMPONENT and one of which
doesn't. But if they differ on that flag, they aren't the same types
and shouldn't have the same alias set.