aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorIlya Verbin <ilya.verbin@intel.com>2016-04-20 15:48:53 +0000
committerIlya Verbin <iverbin@gcc.gnu.org>2016-04-20 15:48:53 +0000
commit477d4906b8bcb8f248de837f5ddf9e7013f5b01f (patch)
treed16ed1a8023ecf7c6217b7ae8112e22153ff60dd /gcc/cp/semantics.c
parentfad08d127f63c0deff683d38034863abf5201bb0 (diff)
downloadgcc-477d4906b8bcb8f248de837f5ddf9e7013f5b01f.zip
gcc-477d4906b8bcb8f248de837f5ddf9e7013f5b01f.tar.gz
gcc-477d4906b8bcb8f248de837f5ddf9e7013f5b01f.tar.bz2
re PR c++/69363 (ICE when doing a pragma simd reduction with max)
Fix PR c++/69363 gcc/c-family/ PR c++/69363 * c-cilkplus.c (c_finish_cilk_clauses): Remove function. * c-common.h (c_finish_cilk_clauses): Remove declaration. gcc/c/ PR c++/69363 * c-parser.c (c_parser_cilk_all_clauses): Use c_finish_omp_clauses instead of c_finish_cilk_clauses. * c-tree.h (c_finish_omp_clauses): Add new default argument. * c-typeck.c (c_finish_omp_clauses): Add new argument. Allow floating-point variables in the linear clause for Cilk Plus. gcc/cp/ PR c++/69363 * cp-tree.h (finish_omp_clauses): Add new default argument. * parser.c (cp_parser_cilk_simd_all_clauses): Use finish_omp_clauses instead of c_finish_cilk_clauses. * semantics.c (finish_omp_clauses): Add new argument. Allow floating-point variables in the linear clause for Cilk Plus. gcc/testsuite/ PR c++/69363 * c-c++-common/cilk-plus/PS/clauses3.c: Adjust dg-error string. * c-c++-common/cilk-plus/PS/clauses4.c: New test. * c-c++-common/cilk-plus/PS/pr69363.c: New test. From-SVN: r235290
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 1dff08e..93b39ac 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -5793,7 +5793,8 @@ cp_finish_omp_clause_depend_sink (tree sink_clause)
Remove any elements from the list that are invalid. */
tree
-finish_omp_clauses (tree clauses, bool allow_fields, bool declare_simd)
+finish_omp_clauses (tree clauses, bool allow_fields, bool declare_simd,
+ bool is_cilk)
{
bitmap_head generic_head, firstprivate_head, lastprivate_head;
bitmap_head aligned_head, map_head, map_field_head;
@@ -5889,13 +5890,29 @@ finish_omp_clauses (tree clauses, bool allow_fields, bool declare_simd)
}
if (TREE_CODE (type) == REFERENCE_TYPE)
type = TREE_TYPE (type);
- if (!INTEGRAL_TYPE_P (type)
- && TREE_CODE (type) != POINTER_TYPE)
+ if (is_cilk)
{
- error ("linear clause applied to non-integral non-pointer "
- "variable with %qT type", TREE_TYPE (t));
- remove = true;
- break;
+ if (!INTEGRAL_TYPE_P (type)
+ && !SCALAR_FLOAT_TYPE_P (type)
+ && TREE_CODE (type) != POINTER_TYPE)
+ {
+ error ("linear clause applied to non-integral, "
+ "non-floating, non-pointer variable with %qT type",
+ TREE_TYPE (t));
+ remove = true;
+ break;
+ }
+ }
+ else
+ {
+ if (!INTEGRAL_TYPE_P (type)
+ && TREE_CODE (type) != POINTER_TYPE)
+ {
+ error ("linear clause applied to non-integral non-pointer"
+ " variable with %qT type", TREE_TYPE (t));
+ remove = true;
+ break;
+ }
}
}
t = OMP_CLAUSE_LINEAR_STEP (c);