This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR62031
- From: Sebastian Pop <sebpop at gmail dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 14 Aug 2014 17:48:07 +0000
- Subject: Re: [PATCH] Fix PR62031
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1408141634360 dot 20733 at zhemvz dot fhfr dot qr>
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. */
>