c-typeck.c (c_finish_omp_clauses): Go to check_dup_generic at the end, unless remove is true.

* c-typeck.c (c_finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
	check_dup_generic at the end, unless remove is true.
	(c_finish_omp_clauses) <case OMP_CLAUSE_REDUCTION>: Add break; after
	remove = true;.
	(c_finish_omp_clauses) <case OMP_CLAUSE_COPYIN>: Likewise.

	* semantics.c (finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
	check_dup_generic at the end, unless remove is true.
	(finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Add break; after
	remove = true;.

	* gcc.dg/gomp/declare-simd-2.c (f12, f13, f14, f15, f16, f17): New
	tests.
	* g++.dg/gomp/declare-simd-2.C (f15, f16, f17, f18, f19, f20): New
	tests.

From-SVN: r204294
This commit is contained in:
Jakub Jelinek 2013-11-01 13:25:16 +01:00 committed by Jakub Jelinek
parent bef49287da
commit ee1d5a0256
7 changed files with 64 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2013-11-01 Jakub Jelinek <jakub@redhat.com>
* c-typeck.c (c_finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
check_dup_generic at the end, unless remove is true.
(c_finish_omp_clauses) <case OMP_CLAUSE_REDUCTION>: Add break; after
remove = true;.
(c_finish_omp_clauses) <case OMP_CLAUSE_COPYIN>: Likewise.
2013-10-31 Jakub Jelinek <jakub@redhat.com>
* c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause

View File

@ -11316,6 +11316,7 @@ c_finish_omp_clauses (tree clauses)
"%qE has invalid type for %<reduction(%s)%>",
t, r_name);
remove = true;
break;
}
}
else if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) == error_mark_node)
@ -11323,6 +11324,7 @@ c_finish_omp_clauses (tree clauses)
error_at (OMP_CLAUSE_LOCATION (c),
"user defined reduction not found for %qD", t);
remove = true;
break;
}
else if (OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
{
@ -11406,6 +11408,7 @@ c_finish_omp_clauses (tree clauses)
error_at (OMP_CLAUSE_LOCATION (c),
"%qE must be %<threadprivate%> for %<copyin%>", t);
remove = true;
break;
}
goto check_dup_generic;
@ -11615,8 +11618,9 @@ c_finish_omp_clauses (tree clauses)
error_at (OMP_CLAUSE_LOCATION (c),
"%qE is not an argument in %<uniform%> clause", t);
remove = true;
break;
}
break;
goto check_dup_generic;
case OMP_CLAUSE_NOWAIT:
if (copyprivate_seen)

View File

@ -1,3 +1,10 @@
2013-11-01 Jakub Jelinek <jakub@redhat.com>
* semantics.c (finish_omp_clauses) <case OMP_CLAUSE_UNIFORM>: Go to
check_dup_generic at the end, unless remove is true.
(finish_omp_clauses) <case OMP_CLAUSE_LINEAR>: Add break; after
remove = true;.
2013-10-31 Jakub Jelinek <jakub@redhat.com>
* semantics.c (finish_omp_clauses): Diagnose aligned clause

View File

@ -5188,12 +5188,16 @@ finish_omp_clauses (tree clauses)
if (t == NULL_TREE)
t = integer_one_node;
if (t == error_mark_node)
remove = true;
{
remove = true;
break;
}
else if (!type_dependent_expression_p (t)
&& !INTEGRAL_TYPE_P (TREE_TYPE (t)))
{
error ("linear step expression must be integral");
remove = true;
break;
}
else
{
@ -5210,7 +5214,10 @@ finish_omp_clauses (tree clauses)
MINUS_EXPR, sizetype, t,
OMP_CLAUSE_DECL (c));
if (t == error_mark_node)
remove = true;
{
remove = true;
break;
}
}
}
OMP_CLAUSE_LINEAR_STEP (c) = t;
@ -5626,8 +5633,9 @@ finish_omp_clauses (tree clauses)
else
error ("%qE is not an argument in %<uniform%> clause", t);
remove = true;
break;
}
break;
goto check_dup_generic;
case OMP_CLAUSE_NOWAIT:
case OMP_CLAUSE_ORDERED:

View File

@ -1,3 +1,10 @@
2013-11-01 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/gomp/declare-simd-2.c (f12, f13, f14, f15, f16, f17): New
tests.
* g++.dg/gomp/declare-simd-2.C (f15, f16, f17, f18, f19, f20): New
tests.
2013-11-01 Paul Thomas <pault@gcc.gnu.org>
PR fortran/57893

View File

@ -82,4 +82,17 @@ int fn14 (double &d);
#pragma omp declare simd aligned (e) // { dg-error "neither a pointer nor an array" }
int fn14 (D e);
#pragma omp declare simd linear(a:7) uniform(a) // { dg-error "appears more than once" }
int f15 (int a);
#pragma omp declare simd linear(a) linear(a) // { dg-error "appears more than once" }
int f16 (int a);
#pragma omp declare simd linear(a) linear(a:7) // { dg-error "appears more than once" }
int f17 (int a);
#pragma omp declare simd linear(a:6) linear(a:6)// { dg-error "appears more than once" }
int f18 (int a);
#pragma omp declare simd uniform(a) uniform(a) // { dg-error "appears more than once" }
int f19 (int a);
#pragma omp declare simd uniform(a) aligned (a: 32)
int f20 (int *a);
// { dg-error "has no member" "" { target *-*-* } 61 }

View File

@ -39,3 +39,16 @@ struct D { int d; };
#pragma omp declare simd aligned (e) /* { dg-error "neither a pointer nor an array" } */
int fn11 (struct D e);
#pragma omp declare simd linear(a:7) uniform(a) /* { dg-error "appears more than once" } */
int f12 (int a);
#pragma omp declare simd linear(a) linear(a) /* { dg-error "appears more than once" } */
int f13 (int a);
#pragma omp declare simd linear(a) linear(a:7) /* { dg-error "appears more than once" } */
int f14 (int a);
#pragma omp declare simd linear(a:6) linear(a:6)/* { dg-error "appears more than once" } */
int f15 (int a);
#pragma omp declare simd uniform(a) uniform(a) /* { dg-error "appears more than once" } */
int f16 (int a);
#pragma omp declare simd uniform(a) aligned (a: 32)
int f17 (int *a);