summaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-26 22:18:28 +0000
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>2016-01-26 22:18:28 +0000
commitccd0385f28ddcb11db26d08c6ab726f9eeb45032 (patch)
treebc4c0671ca70385feac3a9140b9140e311fea5c5 /gcc/tree-data-ref.c
parentdb999c1862e9a3061cd69921881a8ebb0c07fc01 (diff)
downloadgcc-ccd0385f28ddcb11db26d08c6ab726f9eeb45032.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_9-branch@232854 138bc75d-0d04-0410-961f-82ee72b054a4
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 7def7f0cb3b..4a517d75dd9 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -1495,13 +1495,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));
@@ -1533,9 +1534,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;