aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2016-01-26 22:11:51 +0000
committerTom de Vries <vries@gcc.gnu.org>2016-01-26 22:11:51 +0000
commit8dfdb4191221f83f15fa9c1ec8b55182d56b8d4c (patch)
tree01016121051cdf5eed6022d3e5383732ab09ec22 /gcc/tree-data-ref.c
parent56f80f54fea87fd139fc3e8637eb86fd1f886380 (diff)
downloadgcc-8dfdb4191221f83f15fa9c1ec8b55182d56b8d4c.zip
gcc-8dfdb4191221f83f15fa9c1ec8b55182d56b8d4c.tar.gz
gcc-8dfdb4191221f83f15fa9c1ec8b55182d56b8d4c.tar.bz2
Handle DR_NUM_DIMENSIONS == 0 in initialize_data_dependence_relation
2016-01-26 Tom de Vries <tom@codesourcery.com> PR tree-optimization/69110 * tree-data-ref.c (initialize_data_dependence_relation): Handle DR_NUM_DIMENSIONS == 0. * gcc.dg/autopar/pr69110.c: New test. * testsuite/libgomp.c/pr69110.c: New test. From-SVN: r232852
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index a40f40d..d6d9ffc 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -1509,13 +1509,14 @@ initialize_data_dependence_relation (struct data_reference *a,
/* The case where the references are exactly the same. */
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)))
- {
- DDR_ARE_DEPENDENT (res) = chrec_dont_know;
- return res;
- }
+ if ((loop_nest.exists ()
+ && !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;
+ }
DDR_AFFINE_P (res) = true;
DDR_ARE_DEPENDENT (res) = NULL_TREE;
DDR_SUBSCRIPTS (res).create (DR_NUM_DIMENSIONS (a));
@@ -1547,9 +1548,9 @@ initialize_data_dependence_relation (struct data_reference *a,
/* If the base of the object is not invariant in the loop nest, we cannot
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)))
+ if ((loop_nest.exists ()
+ && !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;