diff mbox

[gomp4] Disallow class iterators in omp simd and omp for simd loops

Message ID 20130405131003.GE20334@tucnak.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek April 5, 2013, 1:10 p.m. UTC
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  <jakub@redhat.com>

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



	Jakub
diff mbox

Patch

--- 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;