Hi!

I've missed that OpenMP 4.0 rc2 in 2.6's last restriction mentions:
"For C++, in the simd construct the only random access iterator type that are
for var are pointer types."

The following patch implements that restriction (no testcase yet until simd
is fully supported), committed to branch.

2013-04-05  Jakub Jelinek  <ja...@redhat.com>

        * semantics.c (finish_omp_for): Disallow class iterators for
        OMP_SIMD and OMP_FOR_SIMD loops.

--- gcc/cp/semantics.c.jj       2013-03-27 13:01:09.000000000 +0100
+++ gcc/cp/semantics.c  2013-04-05 14:35:07.967622671 +0200
@@ -5090,6 +5090,13 @@ finish_omp_for (location_t locus, enum t
 
       if (CLASS_TYPE_P (TREE_TYPE (decl)))
        {
+         if (code == OMP_SIMD || code == OMP_FOR_SIMD)
+           {
+             error_at (elocus, "%<#pragma omp%s simd%> used with class "
+                               "iteration variable %qE",
+                       code == OMP_FOR_SIMD ? " for" : "", decl);
+             return NULL;
+           }
          if (handle_omp_for_class_iterator (i, locus, declv, initv, condv,
                                             incrv, &body, &pre_body, clauses))
            return NULL;


        Jakub

Reply via email to