------- Comment #2 from dominiq at lps dot ens dot fr 2010-07-01 20:23 ------- Lightly tested patch that does not create temporaries for the test in comment #1
--- ../_clean/gcc/fortran/dependency.c 2010-06-21 17:31:37.000000000 +0200 +++ gcc/fortran/dependency.c 2010-07-01 22:16:51.000000000 +0200 @@ -1037,8 +1037,9 @@ gfc_check_section_vs_section (gfc_ref *l /* Check for forward dependencies x:y vs. x+1:z. */ if (l_dir == 1 && r_dir == 1 - && l_start && r_start && gfc_dep_compare_expr (l_start, r_start) == -1 - && l_end && r_end && gfc_dep_compare_expr (l_end, r_end) == -1) + && l_start && r_start && (gfc_dep_compare_expr (l_start, r_start) == 0 + || gfc_dep_compare_expr (l_start, r_start) == -1) + /* && l_end && r_end && gfc_dep_compare_expr (l_end, r_end) == -1 */) { /* Check that the strides are the same. */ if (!l_stride && !r_stride) @@ -1050,8 +1051,9 @@ gfc_check_section_vs_section (gfc_ref *l /* Check for forward dependencies x:y:-1 vs. x-1:z:-1. */ if (l_dir == -1 && r_dir == -1 - && l_start && r_start && gfc_dep_compare_expr (l_start, r_start) == 1 - && l_end && r_end && gfc_dep_compare_expr (l_end, r_end) == 1) + && l_start && r_start && (gfc_dep_compare_expr (l_start, r_start) == 0 + || gfc_dep_compare_expr (l_start, r_start) == 1) + /* && l_end && r_end && gfc_dep_compare_expr (l_end, r_end) == 1 */) { /* Check that the strides are the same. */ if (!l_stride && !r_stride) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44235