aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-dfa.c
diff options
context:
space:
mode:
authorGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-22 17:43:43 -0300
commita926878ddbd5a98b272c22171ce58663fc04c3e0 (patch)
tree86af256e5d9a9c06263c00adc90e5fe348008c43 /gcc/tree-dfa.c
parent542730f087133690b47e036dfd43eb0db8a650ce (diff)
parent07cbaed8ba7d1b6e4ab3a9f44175502a4e1ecdb1 (diff)
downloadgcc-devel/autopar_devel.zip
gcc-devel/autopar_devel.tar.gz
gcc-devel/autopar_devel.tar.bz2
Merge branch 'autopar_rebase2' into autopar_develdevel/autopar_devel
Quickly commit changes in the rebase branch.
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r--gcc/tree-dfa.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index b6edc5c..3283d11 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -806,23 +806,25 @@ get_addr_base_and_unit_offset_1 (tree exp, poly_int64_pod *poffset,
if (valueize
&& TREE_CODE (index) == SSA_NAME)
index = (*valueize) (index);
+ if (!poly_int_tree_p (index))
+ return NULL_TREE;
+ low_bound = array_ref_low_bound (exp);
+ if (valueize
+ && TREE_CODE (low_bound) == SSA_NAME)
+ low_bound = (*valueize) (low_bound);
+ if (!poly_int_tree_p (low_bound))
+ return NULL_TREE;
+ unit_size = array_ref_element_size (exp);
+ if (TREE_CODE (unit_size) != INTEGER_CST)
+ return NULL_TREE;
/* If the resulting bit-offset is constant, track it. */
- if (poly_int_tree_p (index)
- && (low_bound = array_ref_low_bound (exp),
- poly_int_tree_p (low_bound))
- && (unit_size = array_ref_element_size (exp),
- TREE_CODE (unit_size) == INTEGER_CST))
- {
- poly_offset_int woffset
- = wi::sext (wi::to_poly_offset (index)
- - wi::to_poly_offset (low_bound),
- TYPE_PRECISION (TREE_TYPE (index)));
- woffset *= wi::to_offset (unit_size);
- byte_offset += woffset.force_shwi ();
- }
- else
- return NULL_TREE;
+ poly_offset_int woffset
+ = wi::sext (wi::to_poly_offset (index)
+ - wi::to_poly_offset (low_bound),
+ TYPE_PRECISION (TREE_TYPE (index)));
+ woffset *= wi::to_offset (unit_size);
+ byte_offset += woffset.force_shwi ();
}
break;