https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87597
Tobias Burnus <burnus at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |burnus at gcc dot gnu.org --- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> --- If I look at the dump, i.e. -fdump-tree-original for -O0 -ffrontend-optimize I get the following for B = matmul(A,gamma5) Re-written in Fortran: do var1 = 0, 3 do var2 = 0, 3 do var3 = 0, 3 b(var1,var3) = b(var1,var3) + a(var2,var3) * gamma5(var1+1,var2+1) end do end do end do The "+1" for gamma5 looks wrong! From the original dump: b[NON_LVALUE_EXPR <__var_1_do> * 4 + NON_LVALUE_EXPR <__var_3_do>] = b[NON_LVALUE_EXPR <__var_1_do> * 4 + NON_LVALUE_EXPR <__var_3_do>] + a[NON_LVALUE_EXPR <__var_2_do> * 4 + NON_LVALUE_EXPR <__var_3_do>] * gamma5[(__var_1_do + 1) * 4 + (__var_2_do + 1)];