periscop / cloog

The CLooG Code Generator in the Polyhedral Model
GNU Lesser General Public License v2.1
40 stars 23 forks source link

Scattering iterators generation results in compilation failures #20

Closed ftynse closed 9 years ago

ftynse commented 10 years ago

If an iteration variable is declared before the loop (c89 requires this to compile), the CLooG-generated code with its declaration inserted into the original code results in compilation error of variable redefinition.

int main() {
  int i;
#pragma scop
  /* Scattering iterators. */
  int i;
  for (i=0;i<=41;i++) {
    S1(i);
  }
#pragma endscop
  return 0;
}