[Bug c/89453] New: Bug parsing "," operator with openmp

alejandro.martinezvicente at arm dot com gcc-bugzilla@gcc.gnu.org
Fri Feb 22 14:55:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89453

            Bug ID: 89453
           Summary: Bug parsing "," operator with openmp
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alejandro.martinezvicente at arm dot com
  Target Milestone: ---

Hi,

This code

void
f (float **a, float **b, int n)
{
  int i, j;

#pragma omp for simd
  for (i = 0, j = 0; i < n; i++, j++)
    {
      a[i][j] = b[j][i];
    }
}

fails to compile with -fopenmp-simd:

$ gcc -fopenmp-simd -std=c99 -O3 -c -o foo.o test.c
test.c: In function ‘f’:
test.c:7:13: error: expected ‘;’ before ‘,’ token
   for (i = 0, j = 0; i < n; i++, j++)
             ^
test.c:7:32: error: invalid increment expression
   for (i = 0, j = 0; i < n; i++, j++)
                                ^

It does compile correctly with "gcc -std=c99 -O3 -c -o foo.o test.c"


More information about the Gcc-bugs mailing list