[PATCH, PR69110] Don't return NULL access_fns in dr_analyze_indices

Sebastian Pop sebpop@gmail.com
Tue Jan 26 16:59:00 GMT 2016


Tom de Vries wrote:
> diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
> index a40f40d..4c29fc2 100644
> --- a/gcc/tree-data-ref.c
> +++ b/gcc/tree-data-ref.c
> @@ -1510,8 +1510,9 @@ initialize_data_dependence_relation (struct data_reference *a,
>    if (operand_equal_p (DR_REF (a), DR_REF (b), 0))
>      {
>       if (loop_nest.exists ()
> -        && !object_address_invariant_in_loop_p (loop_nest[0],
> -       					        DR_BASE_OBJECT (a)))
> +	 && (!object_address_invariant_in_loop_p (loop_nest[0],
> +						  DR_BASE_OBJECT (a))
> +	     || DR_NUM_DIMENSIONS (a) == 0))

Also please fix the indentation of all this if stmt.

>        {
>          DDR_ARE_DEPENDENT (res) = chrec_dont_know;
>          return res;
> @@ -1548,8 +1549,9 @@ initialize_data_dependence_relation (struct data_reference *a,
>       analyze it.  TODO -- in fact, it would suffice to record that there may
>       be arbitrary dependences in the loops where the base object varies.  */
>    if (loop_nest.exists ()
> -      && !object_address_invariant_in_loop_p (loop_nest[0],
> -     					      DR_BASE_OBJECT (a)))
> +      && (!object_address_invariant_in_loop_p (loop_nest[0],
> +					       DR_BASE_OBJECT (a))
> +	  || DR_NUM_DIMENSIONS (a) == 0))
>      {
>        DDR_ARE_DEPENDENT (res) = chrec_dont_know;
>        return res;

Let's check for DR_NUM_DIMENSIONS (a) == 0 independently of loop_nest.exists ().
We check for the loop_nest because we need to access the outer loop loop_nest[0]
to analyze the base object of a.

Otherwise the change looks good to me.

Thanks,
Sebastian



More information about the Gcc-patches mailing list