From 9dc7743c7864cbdc0f62a827c9af6a854ebfa98f Mon Sep 17 00:00:00 2001 From: Igor Zamyatin Date: Wed, 4 Jun 2014 10:07:21 +0000 Subject: re PR c/58942 (cilkplus internal compiler error: tree check __sec_reduce_max_ind) gcc/c/ PR c/58942 * c-array-notation.c (fix_builtin_array_notation_fn): Handle the case with a pointer. gcc/cp/ PR c/58942 * cp-array-notation.c (expand_sec_reduce_builtin): Handle the case with a pointer. gcc/testsuite/ PR c/58942 * c-c++-common/cilk-plus/AN/pr58942.c: Check for correct handling of the case with a pointer. From-SVN: r211220 --- gcc/c/c-array-notation.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/c/c-array-notation.c') diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c index a0fe2fb..b4015b8 100644 --- a/gcc/c/c-array-notation.c +++ b/gcc/c/c-array-notation.c @@ -310,7 +310,9 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) || an_type == BUILT_IN_CILKPLUS_SEC_REDUCE_MIN_IND) array_ind_value = build_decl (location, VAR_DECL, NULL_TREE, TREE_TYPE (func_parm)); - array_op0 = (*array_operand)[0]; + array_op0 = (*array_operand)[0]; + if (TREE_CODE (array_op0) == INDIRECT_REF) + array_op0 = TREE_OPERAND (array_op0, 0); switch (an_type) { case BUILT_IN_CILKPLUS_SEC_REDUCE_ADD: -- cgit v1.1