On Sat, Jan 23, 2016 at 12:28 PM, Tom de Vries <tom_devr...@mentor.com> wrote: > That was my original patch, and Richard commented: 'I think avoiding a NULL > access_fns is ok but it should be done unconditionally, not only for the > DECL_P case'. In order words, he asked me to do the exact opposite of the > change you now propose. >
In the case of a DECL_P it is correct to say that it has an access function of 0. In the graphite testcase it is not correct to say that the access function for a given data reference is zero: we only initialize access_fns in the case of a polynomial chrec: if (TREE_CODE (ref) == MEM_REF) { op = TREE_OPERAND (ref, 0); access_fn = analyze_scalar_evolution (loop, op); access_fn = instantiate_scev (before_loop, loop, access_fn); if (TREE_CODE (access_fn) == POLYNOMIAL_CHREC) { [...] access_fns.safe_push (access_fn); } } In all other cases we may not have a representation of the access functions. It is incorrect to initialize to "A[0]" all those data references that cannot be analyzed. If needed, instead of returning vNULL, one could initialize the vector to empty: if (access_fns == vNULL) access_fns.create (0); and that would be correct, though it would not teach the dependence analysis how to deal with the global variable access function in pr69110. I think the fix is to add the zero subscript only for DECL_P (ref). Sebastian