periscop / cloog

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

Variable names may be changed accidentally #24

Closed ftynse closed 5 years ago

ftynse commented 9 years ago

Source code

#pragma scop
for (int i = 0; i < N; i++)
  a_i_k[i] = 0;
#pragma endscop

raised to the model by Clan and regenerated by CLooG is transformed to

#pragma scop
  /* Scattering iterators. */
  int i;
if (N >= 1) {
  for (i=0;i<=N-1;i++) {
    a_(i)_k[i] = 0;
  }
}
#pragma endscop

The i symbol in the variable name is being processed as if it were iterator.

periscop commented 9 years ago

Funny :-) ! This is a problem in OpenScop's osl_util_identifier_is_here function. I (shamefully) forgot the underscore case...

On Tue, Oct 14, 2014 at 5:18 PM, Alexander Zinenko <notifications@github.com

wrote:

Source code

pragma scopfor (int i = 0; i < N; i++)

a_i_k[i] = 0;#pragma endscop

raised to the model by Clan and regenerated by CLooG is transformed to

pragma scop

/* Scattering iterators. */ int i;if (N >= 1) { for (i=0;i<=N-1;i++) { a_(i)_k[i] = 0; }}#pragma endscop

The i symbol in the variable name is being processed as if it were iterator.

Reply to this email directly or view it on GitHub https://github.com/periscop/cloog/issues/24.

ftynse commented 9 years ago

I fixed it in https://github.com/periscop/openscop/commit/3f557dc265ee6f2545c92f11091e2bfbd1656dfb.

Do not forget to update osl submodule version for the next ClooG release.