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

            Bug ID: 90456
           Summary: OpenMP rejection: ‘ind1’ not specified in enclosing
                    ‘parallel’ since r265930
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
  Target Milestone: ---

Following has been reduced from libimagequant package:

$ cat mediancut.i
typedef struct {
  struct {
    int sort_value;
  } tmp;
} hist_item;
typedef struct {
  int chan;
} channelvariance;
int prepare_sort_b_0;
double fn1() {
  hist_item *achv;
  channelvariance channels;
  const int ind1 = prepare_sort_b_0;
#pragma omp parallel default(none) shared(achv, channels)
  {
    float *chans = (float *)&achv;
    achv[ind1].tmp.sort_value = chans[channels.chan];
  }
  return 2;
}

$ gcc mediancut.i -fopenmp -c
mediancut.i: In function ‘fn1’:
mediancut.i:17:9: error: ‘ind1’ not specified in enclosing ‘parallel’
   17 |     achv[ind1].tmp.sort_value = chans[channels.chan];
      |         ^
mediancut.i:14:9: error: enclosing ‘parallel’
   14 | #pragma omp parallel default(none) shared(achv, channels)
      |         ^~~

While GCC 8 accepts that:

$ gcc-8 --version
gcc-8 (SUSE Linux) 8.3.1 20190226 [gcc-8-branch revision 269204]

Reply via email to