diff options
Diffstat (limited to 'gcc/cp/decl2.cc')
-rw-r--r-- | gcc/cp/decl2.cc | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/gcc/cp/decl2.cc b/gcc/cp/decl2.cc index bceaf78..4195c08 100644 --- a/gcc/cp/decl2.cc +++ b/gcc/cp/decl2.cc @@ -622,35 +622,39 @@ grok_array_decl (location_t loc, tree array_expr, tree index_exp, tree grok_omp_array_section (location_t loc, tree array_expr, tree index, - tree length) + tree length, tree stride) { tree orig_array_expr = array_expr; tree orig_index = index; tree orig_length = length; + tree orig_stride = stride; if (error_operand_p (array_expr) || error_operand_p (index) - || error_operand_p (length)) + || error_operand_p (length) + || error_operand_p (stride)) return error_mark_node; if (processing_template_decl && (type_dependent_expression_p (array_expr) || type_dependent_expression_p (index) - || type_dependent_expression_p (length))) - return build_min_nt_loc (loc, OMP_ARRAY_SECTION, array_expr, index, length); + || type_dependent_expression_p (length) + || type_dependent_expression_p (stride))) + return build_min_nt_loc (loc, OMP_ARRAY_SECTION, array_expr, index, length, stride); index = fold_non_dependent_expr (index); length = fold_non_dependent_expr (length); + stride = fold_non_dependent_expr (stride); /* NOTE: We can pass through invalidly-typed index/length fields here (e.g. if the user tries to use a floating-point index/length). This is diagnosed later in semantics.cc:handle_omp_array_sections_1. */ - tree expr = build_omp_array_section (loc, array_expr, index, length); + tree expr = build_omp_array_section (loc, array_expr, index, length, stride); if (processing_template_decl) expr = build_min_non_dep (OMP_ARRAY_SECTION, expr, orig_array_expr, - orig_index, orig_length); + orig_index, orig_length, orig_stride); return expr; } @@ -2834,6 +2838,7 @@ min_vis_expr_r (tree *tp, int */*walk_subtrees*/, void *data) case REINTERPRET_CAST_EXPR: case CONST_CAST_EXPR: case DYNAMIC_CAST_EXPR: + case OMP_ARRAYSHAPE_CAST_EXPR: case NEW_EXPR: case CONSTRUCTOR: case LAMBDA_EXPR: @@ -6406,12 +6411,17 @@ mark_used (tree decl, tsubst_flags_t complain /* = tf_warning_or_error */) /* If DECL has a deduced return type, we need to instantiate it now to find out its type. For OpenMP user defined reductions, we need them - instantiated for reduction clauses which inline them by hand directly. */ + instantiated for reduction clauses which inline them by hand directly. + OpenMP declared mappers are used implicitly so must be instantiated + before they can be detected. */ if (undeduced_auto_decl (decl) || (VAR_P (decl) && VAR_HAD_UNKNOWN_BOUND (decl)) || (TREE_CODE (decl) == FUNCTION_DECL - && DECL_OMP_DECLARE_REDUCTION_P (decl))) + && DECL_OMP_DECLARE_REDUCTION_P (decl)) + || (TREE_CODE (decl) == VAR_DECL + && DECL_LANG_SPECIFIC (decl) + && DECL_OMP_DECLARE_MAPPER_P (decl))) maybe_instantiate_decl (decl); if (!decl_dependent_p (decl) |