This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/27415] New: Iteration var in firstprivate or reduction clauses not reported


void
foo (void)
{
  int i = 0;
#pragma omp parallel
#pragma omp for firstprivate (i)        /* { dg-error "predetermined iteration
var i must not be firstprivate" } */
  for (i = 0; i < 10; i++)
    ;
}

void
bar (void)
{
  int i = 0;
#pragma omp parallel for firstprivate (i)       /* { dg-error "predetermined
iteration var i must not be firstprivate" } */
  for (i = 0; i < 10; i++)
    ;
}

or

void
foo (void)
{
  int i = 0;
#pragma omp parallel
#pragma omp for reduction (+:i) /* { dg-error "predetermined iteration var i
must not be reduction" } */
  for (i = 0; i < 10; i++)
    ;
}

void
bar (void)
{
  int i = 0;
#pragma omp parallel for reduction (*:i)        /* { dg-error "predetermined
iteration var i must not be reduction" } */
  for (i = 0; i < 10; i++)
    ;
}

are compiled without any errors, but 2.8.1.1 says that the omp for / omp
parallel for loop iteration variable may be only listed in private or
lastprivate clause.


-- 
           Summary: Iteration var in firstprivate or reduction clauses not
                    reported
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: openmp
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27415


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]