diff options
author | Jakub Jelinek <jakub@redhat.com> | 2013-10-31 20:06:08 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-10-31 20:06:08 +0100 |
commit | 5a9785fb4c3ceb3b338634f2ea17474eaebb4955 (patch) | |
tree | b855c0f5f2b49779d10067e2ee590fb7d92a9ef8 /gcc/c | |
parent | e5ccdfcd51ccbd0c9353f94f73bce18d42adbaac (diff) | |
download | gcc-5a9785fb4c3ceb3b338634f2ea17474eaebb4955.zip gcc-5a9785fb4c3ceb3b338634f2ea17474eaebb4955.tar.gz gcc-5a9785fb4c3ceb3b338634f2ea17474eaebb4955.tar.bz2 |
c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause with decl that is not pointer nor array.
* c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause
with decl that is not pointer nor array.
* semantics.c (finish_omp_clauses): Diagnose aligned clause
with decl that is not pointer nor array nor reference to those.
* g++.dg/gomp/simd-1.C: New test.
* g++.dg/gomp/declare-simd-1.C (f32): Fix up aligned clause argument.
* g++.dg/gomp/declare-simd-2.C (fn13, fn14): Add new tests.
* gcc.dg/gomp/declare-simd-2.c (fn7, fn8, fn9, fn10, fn11): Likewise.
* c-c++-common/gomp/simd6.c: New test.
From-SVN: r204273
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index ed60988..8f8a245 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,8 @@ +2013-10-31 Jakub Jelinek <jakub@redhat.com> + + * c-typeck.c (c_finish_omp_clauses): Diagnose aligned clause + with decl that is not pointer nor array. + 2013-10-29 Balaji V. Iyer <balaji.v.iyer@intel.com> * c-decl.c (finish_function): Added a call for insert_cilk_frame when diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 1034cee..5a23c84 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -11504,6 +11504,14 @@ c_finish_omp_clauses (tree clauses) "%qE is not a variable in %<aligned%> clause", t); remove = true; } + else if (!POINTER_TYPE_P (TREE_TYPE (t)) + && TREE_CODE (TREE_TYPE (t)) != ARRAY_TYPE) + { + error_at (OMP_CLAUSE_LOCATION (c), + "%qE in %<aligned%> clause is neither a pointer nor " + "an array", t); + remove = true; + } else if (bitmap_bit_p (&aligned_head, DECL_UID (t))) { error_at (OMP_CLAUSE_LOCATION (c), |