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: [autovect] [patch] Dependence tests and dimensions


On Sun, 2005-06-19 at 12:21 +0300, Ira Rosen wrote:
> 
> 
> 
> This patch removes a dependence test based on DRs dimensions: while being
> correct for ARRAY_REFs, it is incorrect to decide that two data-refs are
> independent if their dimensions numbers differ for the case when both
> ARRAY_REFs and INDIRECT_REFs are tested.
> E.g.,
>       for i
>          for j
>           *((int *)p + i + j) = a[i][j];
> 
> The access function of the pointer access is {j_init, + 4B}_2 relative to
> 'p + i', and the access functions of the array are '{i_init, + i_step}_1
> and {j_init, +, j_step}_2'. Therefore, 'a[i][j] is two-dimensional and 'p'
> is one-dimensional. But, of course, 'p' can point to 'a', and we need to
> apply alias analysis to check this.


Here, p can't point to a, unless you've written the example wrong.

a is the equivalent of int **
p is the equivalent of int *

For p to have taken the address of a and be properly dereferenced, it
would have to be int ***.



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