From: Richard Biener Date: Fri, 2 Jul 2021 06:51:43 +0000 (+0200) Subject: tree-optimization/101280 - re-revise interchange fix for PR101173 X-Git-Tag: basepoints/gcc-13~6340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c4804ff24401733e3b470a49b8a6c9306e6cfcfa;p=thirdparty%2Fgcc.git tree-optimization/101280 - re-revise interchange fix for PR101173 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 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. --- diff --git a/gcc/gimple-loop-interchange.cc b/gcc/gimple-loop-interchange.cc index 43ef112a2d0d..7a88faa2c073 100644 --- a/gcc/gimple-loop-interchange.cc +++ b/gcc/gimple-loop-interchange.cc @@ -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; }