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.
/* 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;
}