]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/101280 - re-revise interchange fix for PR101173
authorRichard Biener <rguenther@suse.de>
Fri, 2 Jul 2021 06:51:43 +0000 (08:51 +0200)
committerRichard Biener <rguenther@suse.de>
Fri, 2 Jul 2021 06:54:32 +0000 (08:54 +0200)
The following fixes up the revision of the original fix for PR101173
to properly guard all dependence checks with DDR_REVERSED_P or its
inverse.

2021-07-01  Richard Biener  <rguenther@suse.de>

PR tree-optimization/101280
PR tree-optimization/101173
* gimple-loop-interchange.cc
(tree_loop_interchange::valid_data_dependences): Properly
guard all dependence checks with DDR_REVERSED_P or its
inverse.

gcc/gimple-loop-interchange.cc

index 43ef112a2d0dd7566b9b0e59c9fb5485516dbaf1..7a88faa2c073eab77abca0ed73bc3b0a884b20f4 100644 (file)
@@ -1044,9 +1044,9 @@ tree_loop_interchange::valid_data_dependences (unsigned i_idx, unsigned o_idx,
 
          /* Be conservative, skip case if either direction at i_idx/o_idx
             levels is not '=' or '<'.  */
-         if (dist_vect[i_idx] < 0
+         if ((!DDR_REVERSED_P (ddr) && dist_vect[i_idx] < 0)
              || (DDR_REVERSED_P (ddr) && dist_vect[i_idx] > 0)
-             || dist_vect[o_idx] < 0
+             || (!DDR_REVERSED_P (ddr) && dist_vect[o_idx] < 0)
              || (DDR_REVERSED_P (ddr) && dist_vect[o_idx] > 0))
            return false;
        }