diff options
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/c-family/c-omp.c | 13 |
2 files changed, 21 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 622a288daac..9dc1fdb5544 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,4 +1,10 @@ -2016-09-01 Martin Sebor <msebor@redhat.com> +2016-09-02 Jakub Jelinek <jakub@redhat.com> + + PR c/65467 + * c-omp.c (c_finish_omp_atomic): Reject _Atomic qualified expressions. + (c_finish_omp_for): Reject _Atomic qualified iterators. + +2016-09-01 Martin Sebor <msebor@redhat.com> * c-ada-spec.c (dump_ada_function_declaration): Increase buffer size to guarantee it fits the output of the formatted function @@ -290,7 +296,7 @@ PR c++/65970 * c.opt (fconstexpr-loop-limit): New. -2016-07-22 Martin Sebor <msebor@redhat.com> +2016-07-22 Martin Sebor <msebor@redhat.com> PR c++/71675 * c-common.c (resolve_overloaded_builtin): Avoid converting diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c index 1691c40f11a..3b131ed1843 100644 --- a/gcc/c-family/c-omp.c +++ b/gcc/c-family/c-omp.c @@ -199,6 +199,11 @@ c_finish_omp_atomic (location_t loc, enum tree_code code, error_at (loc, "invalid expression type for %<#pragma omp atomic%>"); return error_mark_node; } + if (TYPE_ATOMIC (type)) + { + error_at (loc, "%<_Atomic%> expression in %<#pragma omp atomic%>"); + return error_mark_node; + } if (opcode == RDIV_EXPR) opcode = TRUNC_DIV_EXPR; @@ -480,6 +485,14 @@ c_finish_omp_for (location_t locus, enum tree_code code, tree declv, error_at (elocus, "invalid type for iteration variable %qE", decl); fail = true; } + else if (TYPE_ATOMIC (TREE_TYPE (decl))) + { + error_at (elocus, "%<_Atomic%> iteration variable %qE", decl); + fail = true; + /* _Atomic iterator confuses stuff too much, so we risk ICE + trying to diagnose it further. */ + continue; + } /* In the case of "for (int i = 0...)", init will be a decl. It should have a DECL_INITIAL that we can turn into an assignment. */ |