Hi, > 2) I was using a simple example: > > #pragma unroll 2 > for (i=0;i<6;i++) > { > printf ("Hello world\n"); > } > > If I do this, instead of transforming the code into : > for (i=0;i<3;i++) > { > printf ("Hello world\n"); > printf ("Hello world\n"); > } > > as we could expect, it is transformed into: > for (i=0;i<2;i++) > { > printf ("Hello world\n"); > printf ("Hello world\n"); > } > for (i=0;i<2;i++) > { > printf ("Hello world\n"); > } > > > (I am using 4.3.2 currently) > > I am using the tree_unroll_loop function to perform the unrolling and > it seems to always want to keep that epilogue. Is there a reason for > this? Or is this a bug of some sorts?
such an epilogue is needed when the # of iterations is not known in the compile time; it should be fairly easy to modify the unrolling not to emit it when it is not necessary, Zdenek