This is the mail archive of the
mailing list for the GCC project.
Re: Aliasing of arrays
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Alexander Cherepanov <ch3root at openwall dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Wed, 30 Nov 2016 17:29:58 +0000
- Subject: Re: Aliasing of arrays
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org> <CAFiYyc0jzzc6uvD50mCJsFFPxt-VmXL_x1+815=pxB7ufK6Rgw@mail.gmail.com>
On Wed, 30 Nov 2016, Richard Biener wrote:
> but that probably shouldn't apply to array types. The idea is that
> objects of the same type cannot overlap. Maybe Joseph can clarify whether
> and array object of known size really constitutes an object in that sense.
This is one of the ambiguous cases about which objects are relevant for
type-based aliasing rules. I think it's best not to optimize this (that
is, to treat the objects as being the individual array elements, so the
arrays can overlap by an exact multiple of the element size - meaning the
ultimate element size in the case of multidimensional arrays, so e.g. two
int arrays could be offset by one int from each other).
Joseph S. Myers