diff options
Diffstat (limited to 'gcc/cp/cp-cilk.c')
-rw-r--r-- | gcc/cp/cp-cilk.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/gcc/cp/cp-cilk.c b/gcc/cp/cp-cilk.c index be97519ef27..b544d851100 100644 --- a/gcc/cp/cp-cilk.c +++ b/gcc/cp/cp-cilk.c @@ -1314,7 +1314,8 @@ validate_for_scalar (tree c_for_stmt, tree var) return true; } -/* This function will check if _Cilk_for loop is valid. */ +/* Returns true if C_FOR_STMT, a CILK_FOR_STMT tree with the induction + variable VAR, a VAR_DECL, is valid. */ static bool validate_for_record (tree c_for_stmt, tree var) @@ -1323,7 +1324,7 @@ validate_for_record (tree c_for_stmt, tree var) tree exp_cond = NULL_TREE; tree l_type = NULL_TREE, d_type = NULL_TREE, d_type_up = NULL_TREE; tree d_type_down = NULL_TREE; - tree var_type = NULL_TREE, cond = NULL_TREE, limit = NULL_TREE; + tree cond = NULL_TREE, limit = NULL_TREE; tree hack = NULL_TREE; int direction = 0; @@ -1333,8 +1334,6 @@ validate_for_record (tree c_for_stmt, tree var) if (!limit) return false; - var_type = TREE_TYPE (var); - l_type = TREE_TYPE (limit); hack = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier ("loop_bound"), @@ -1372,12 +1371,6 @@ validate_for_record (tree c_for_stmt, tree var) if (!exp_plus) return false; - if (TYPE_MAIN_VARIANT (TREE_TYPE (exp_plus)) != var_type - && !can_convert_arg (var_type, TREE_TYPE (exp_plus), exp_plus, 0, - tf_warning_or_error)) - error ("result of operation%c(%T,%T) not convertable to type of loop var.", - (direction >= 0) ? '+' : '-', var_type, d_type); - if (cp_tree_uses_cilk (exp_plus) || cp_tree_uses_cilk (callable (INIT_EXPR, NULL_TREE, var, 0, false)) || cp_tree_uses_cilk (callable (PSEUDO_DTOR_EXPR, NULL_TREE, var, 0, |