From a85d87b20c607cdcb878901cee8535bdd35489d4 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 20 Dec 2017 12:56:12 +0000 Subject: [PATCH] poly_int: get_inner_reference_aff This patch makes get_inner_reference_aff return the size as a poly_widest_int rather than a widest_int. 2017-12-20 Richard Sandiford Alan Hayward David Sherwood gcc/ * tree-affine.h (get_inner_reference_aff): Return the size as a poly_widest_int. * tree-affine.c (get_inner_reference_aff): Likewise. * tree-data-ref.c (dr_may_alias_p): Update accordingly. * tree-ssa-loop-im.c (mem_refs_may_alias_p): Likewise. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r255891 --- gcc/ChangeLog | 10 ++++++++++ gcc/tree-affine.c | 2 +- gcc/tree-affine.h | 2 +- gcc/tree-data-ref.c | 2 +- gcc/tree-ssa-loop-im.c | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9a60b00e19b..70e8c1a5e46 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2017-12-20 Richard Sandiford + Alan Hayward + David Sherwood + + * tree-affine.h (get_inner_reference_aff): Return the size as a + poly_widest_int. + * tree-affine.c (get_inner_reference_aff): Likewise. + * tree-data-ref.c (dr_may_alias_p): Update accordingly. + * tree-ssa-loop-im.c (mem_refs_may_alias_p): Likewise. + 2017-12-20 Richard Sandiford Alan Hayward David Sherwood diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c index 3869b0be036..5c6bb7d0906 100644 --- a/gcc/tree-affine.c +++ b/gcc/tree-affine.c @@ -927,7 +927,7 @@ debug_aff (aff_tree *val) which REF refers. */ tree -get_inner_reference_aff (tree ref, aff_tree *addr, widest_int *size) +get_inner_reference_aff (tree ref, aff_tree *addr, poly_widest_int *size) { HOST_WIDE_INT bitsize, bitpos; tree toff; diff --git a/gcc/tree-affine.h b/gcc/tree-affine.h index d6802ebd093..d2140b7262d 100644 --- a/gcc/tree-affine.h +++ b/gcc/tree-affine.h @@ -80,7 +80,7 @@ bool aff_combination_constant_multiple_p (aff_tree *, aff_tree *, void aff_combination_expand (aff_tree *, hash_map **); void tree_to_aff_combination_expand (tree, tree, aff_tree *, hash_map **); -tree get_inner_reference_aff (tree, aff_tree *, widest_int *); +tree get_inner_reference_aff (tree, aff_tree *, poly_widest_int *); void free_affine_expand_cache (hash_map **); bool aff_comb_cannot_overlap_p (aff_tree *, const poly_widest_int &, const poly_widest_int &); diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 50e11f5765a..4b805aaa612 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -2134,7 +2134,7 @@ dr_may_alias_p (const struct data_reference *a, const struct data_reference *b, if (!loop_nest) { aff_tree off1, off2; - widest_int size1, size2; + poly_widest_int size1, size2; get_inner_reference_aff (DR_REF (a), &off1, &size1); get_inner_reference_aff (DR_REF (b), &off2, &size2); aff_combination_scale (&off1, -1); diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index e0e1556516d..e62759b4bd4 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -1581,7 +1581,7 @@ mem_refs_may_alias_p (im_mem_ref *mem1, im_mem_ref *mem2, /* Perform BASE + OFFSET analysis -- if MEM1 and MEM2 are based on the same object and their offset differ in such a way that the locations cannot overlap, then they cannot alias. */ - widest_int size1, size2; + poly_widest_int size1, size2; aff_tree off1, off2; /* Perform basic offset and type-based disambiguation. */ -- 2.30.2