------- Comment #1 from spop at gcc dot gnu dot org 2009-10-23 18:16 ------- The bug disappears with disabling the loop interchange, but the code generated by CLooG still looks strange:
for (scat_1=0;scat_1<=2;scat_1++) { S3(scat_1) ; for (scat_3=0;scat_3<=1;scat_3++) { S4(scat_1,scat_3) ; for (scat_5=0;scat_5<=18;scat_5++) { S5(scat_1,scat_3,scat_5) ; S6(scat_1,scat_3,scat_5) ; } S5(scat_1,scat_3,19) ; S7(scat_1,scat_3) ; S26(scat_1,scat_3) ; S8(scat_1,scat_3) ; } S4(scat_1,2) ; for (scat_5=0;scat_5<=18;scat_5++) { S5(scat_1,2,scat_5) ; S6(scat_1,2,scat_5) ; } S5(scat_1,2,19) ; S7(scat_1,2) ; S26(scat_1,2) ; } given that the original and transformed Loop Statement Trees look like this: original_lst ( (root 0 (loop 0 stmt_3 1 (loop 0 stmt_4 1 (loop 0 stmt_5 1 stmt_6) 2 stmt_7 3 stmt_26 4 stmt_8)))) transformed_lst ( (root 0 (loop 0 stmt_3 1 (loop 0 stmt_4 1 (loop 0 stmt_5 1 stmt_6) 2 stmt_7 3 stmt_26 4 stmt_8)))) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41811