diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-23 08:24:20 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-08-23 08:24:20 +0000 |
commit | ffe944fa4d599f56a68cb542a0eb6184f0414c29 (patch) | |
tree | 519608c83e01fb34fcdea8849d3554eaca59bf38 /gcc/tree-data-ref.c | |
parent | 1d7c087e8b9c917fc33169a61d7a300432cdf784 (diff) | |
download | gcc-ffe944fa4d599f56a68cb542a0eb6184f0414c29.tar.gz |
* lambda-code.c (lambda_vector_lexico_pos): Moved...
* lambda.h (lambda_vector_lexico_pos): ... here.
* tree-data-ref.c (build_classic_dist_vector): Return false when
the distance vector is lexicographically negative.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103392 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r-- | gcc/tree-data-ref.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 54494c2e986..d7a4253320c 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -3030,8 +3030,8 @@ subscript_dependence_tester (struct data_dependence_relation *ddr) NB_LOOPS is the total number of loops we are considering. FIRST_LOOP_DEPTH is the loop->depth of the first loop in the analyzed loop nest. - Return FALSE if the dependence relation is outside of the loop nest - starting at FIRST_LOOP_DEPTH. + Return FALSE when fail to represent the data dependence as a distance + vector. Return TRUE otherwise. */ static bool @@ -3196,6 +3196,23 @@ build_classic_dist_vector (struct data_dependence_relation *ddr, DDR_DIST_VECT (ddr) = dist_v; DDR_SIZE_VECT (ddr) = nb_loops; + + /* Verify a basic constraint: classic distance vectors should always + be lexicographically positive. */ + if (!lambda_vector_lexico_pos (DDR_DIST_VECT (ddr), + DDR_SIZE_VECT (ddr))) + { + if (DDR_SIZE_VECT (ddr) == 1) + /* This one is simple to fix, and can be fixed. + Multidimensional arrays cannot be fixed that simply. */ + lambda_vector_negate (DDR_DIST_VECT (ddr), DDR_DIST_VECT (ddr), + DDR_SIZE_VECT (ddr)); + else + /* This is not valid: we need the delta test for properly + fixing all this. */ + return false; + } + return true; } |