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: [PATCH] Fix PR62031


Richard Biener wrote:
> 
> This fixes wrong answer from data-dependence analysis by realizing
> that _all_ (even non-evolving) indirect accesses cannot be constrained
> to a full object size.  This also gets rid of that ugly
> DR_UNCONSTRAINED_BASE hack (but effectively make it always active).
> 

Looks good to me.

> @@ -1404,9 +1409,21 @@ dr_may_alias_p (const struct data_refere
>  				       build_fold_addr_expr (addr_b));
>      }
>    else if (TREE_CODE (addr_b) == MEM_REF
> -	   && DR_UNCONSTRAINED_BASE (b))
> -    return ptr_derefs_may_alias_p (build_fold_addr_expr (addr_a),
> -				   TREE_OPERAND (addr_b, 0));
> +	   && TREE_CODE (TREE_OPERAND (addr_b, 0)) == SSA_NAME)
> +    {
> +      /* For true dependences we can apply TBAA.  */
> +      if (flag_strict_aliasing
> +	  && DR_IS_WRITE (a) && DR_IS_READ (b)
> +	  && !alias_sets_conflict_p (get_alias_set (DR_REF (a)),
> +				     get_alias_set (DR_REF (b))))
> +	return false;
> +      if (TREE_CODE (addr_a) == MEM_REF)
> +	return ptr_derefs_may_alias_p (TREE_OPERAND (addr_a, 0),
> +				       TREE_OPERAND (addr_b, 0));
> +      else

Remove the else here.

> +	return ptr_derefs_may_alias_p (build_fold_addr_expr (addr_a),
> +				       TREE_OPERAND (addr_b, 0));
> +    }
>  
>    /* Otherwise DR_BASE_OBJECT is an access that covers the whole object
>       that is being subsetted in the loop nest.  */
> 


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