From patchwork Thu Jan 26 23:46:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Iyer, Balaji V" X-Patchwork-Id: 138084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 304A71007D3 for ; Fri, 27 Jan 2012 10:47:19 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1328226440; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:Content-Type: MIME-Version:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=NgAphG4 TxkjnwgfKNuCGzsM48+A=; b=UuFGS8SamMSldUz314xj1kIDUrxCgknaVSNkrOm WtK0zSth2cmhA3G2zTm9ctCs8FMzatYyzIe7z88J2i/WuzH+LepeOvPpgYhI/Q0x g6aRRuVOpYmg2U/jSV6Ed8bpK/cE/UUTOAsbkZwZCzqmlss+TB42HXhWdASRk3F4 nXyo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-ExtLoop1:Received:Received:Received:From:To:Subject:Date:Message-ID:Content-Type:MIME-Version:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=FUeQvWopuUPmWahdzzz4tfRQhgCHCmr5LboA1EigUZbNk99hrrnKw32XopLNqV ksHqHp4JrHHYQ/1UzmuWwMn4HnO2puErN4aW7BUgoEwSqpgou5PlfVtmZ2BKXvv1 uSXHbq7ebt0iSqM+fYzgGuoD4vf8EavKobzMZcKhO54qY=; Received: (qmail 19976 invoked by alias); 26 Jan 2012 23:47:15 -0000 Received: (qmail 19966 invoked by uid 22791); 26 Jan 2012 23:47:12 -0000 X-SWARE-Spam-Status: No, hits=-4.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga03.intel.com (HELO mga03.intel.com) (143.182.124.21) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Jan 2012 23:46:59 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 26 Jan 2012 15:46:57 -0800 X-ExtLoop1: 1 Received: from azsmsx601.amr.corp.intel.com ([10.2.121.193]) by azsmga001.ch.intel.com with ESMTP; 26 Jan 2012 15:46:57 -0800 Received: from fmsmsx102.amr.corp.intel.com (10.19.9.53) by azsmsx601.amr.corp.intel.com (10.2.121.193) with Microsoft SMTP Server (TLS) id 8.2.255.0; Thu, 26 Jan 2012 16:46:57 -0700 Received: from fmsmsx101.amr.corp.intel.com ([169.254.1.197]) by FMSMSX102.amr.corp.intel.com ([169.254.2.39]) with mapi id 14.01.0355.002; Thu, 26 Jan 2012 15:46:56 -0800 From: "Iyer, Balaji V" To: "gcc-patches@gcc.gnu.org" Subject: [PATCH][Cilkplus] Array Notation Max/Min Index fix Date: Thu, 26 Jan 2012 23:46:57 +0000 Message-ID: MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Hello Everyone, This patch is for the Cilkplus branch affecting both the C and C++ Compilers. This patch will fix a bug for max and min-index builtin function. The original implemention was comparing the max/min index with the value in the array. This patch will add a new variable and store the value in the array to this variable. Thanking You, Yours Sincerely, Balaji V. Iyer. diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk index 98e0528..4297c91 100644 --- a/gcc/ChangeLog.cilk +++ b/gcc/ChangeLog.cilk @@ -1,5 +1,10 @@ 2012-01-26 Balaji V. Iyer + * c-array-notation.c (fix_builtin_array_notation_fn): Initialized the + maximum/minimum value for max/min index builtin function. + +2012-01-26 Balaji V. Iyer + * array-notation-common.c (array_notation_init_builtins): Added the internal array notation function "__sec_reduce_implicit_index." (is_sec_implicit_index_fn): New function. diff --git a/gcc/c-array-notation.c b/gcc/c-array-notation.c index 3ff52dc..d4a94f2 100644 --- a/gcc/c-array-notation.c +++ b/gcc/c-array-notation.c @@ -1379,7 +1379,7 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) { tree new_var_type = NULL_TREE, func_parm, new_expr, new_yes_expr, new_no_expr; tree array_ind_value = NULL_TREE, new_no_ind, new_yes_ind, new_no_list; - tree new_yes_list, new_cond_expr, new_var_init; + tree new_yes_list, new_cond_expr, new_var_init, new_exp_init; an_reduce_type an_type = REDUCE_UNKNOWN; tree *array_list = NULL; int list_size = 0; @@ -1719,6 +1719,9 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) new_var_init = build_modify_expr (UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var), NOP_EXPR, UNKNOWN_LOCATION, build_zero_cst (new_var_type), new_var_type); + new_exp_init = build_modify_expr + (UNKNOWN_LOCATION, array_ind_value, TREE_TYPE (array_ind_value), + NOP_EXPR, UNKNOWN_LOCATION, func_parm, TREE_TYPE (func_parm)); new_no_ind = build_modify_expr (UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var), NOP_EXPR, UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var)); @@ -1766,6 +1769,9 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) new_var_init = build_modify_expr (UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var), NOP_EXPR, UNKNOWN_LOCATION, build_zero_cst (new_var_type), new_var_type); + new_exp_init = build_modify_expr + (UNKNOWN_LOCATION, array_ind_value, TREE_TYPE (array_ind_value), + NOP_EXPR, UNKNOWN_LOCATION, func_parm, TREE_TYPE (func_parm)); new_no_ind = build_modify_expr (UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var), NOP_EXPR, UNKNOWN_LOCATION, *new_var, TREE_TYPE (*new_var)); @@ -1817,12 +1823,12 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) for (ii = 0; ii < rank; ii++) append_to_statement_list (ind_init [ii], &loop); + if (an_type == REDUCE_MAX_INDEX || an_type == REDUCE_MIN_INDEX) + append_to_statement_list (new_exp_init, &loop); append_to_statement_list (new_var_init, &loop); for (ii = 0; ii < rank; ii++) { - /* append_to_statement_list (ind_init [ii], &loop); */ - append_to_statement_list (build1 (LABEL_EXPR, void_type_node, if_stmt_label[ii]), &loop); append_to_statement_list diff --git a/gcc/cp/ChangeLog.cilk b/gcc/cp/ChangeLog.cilk index cf9d993..dff1fb5 100644 --- a/gcc/cp/ChangeLog.cilk +++ b/gcc/cp/ChangeLog.cilk @@ -1,5 +1,18 @@ 2012-01-26 Balaji V. Iyer + * cp-array-notation.c (fix_builtin_array_notation_fn): Added new var + called "array_ind_value," that stores the max/min value and the *new_var + stores the index. Also, replaced all build_int_cst with build_one_cst + and build_zero_cst. Also, in REDUCE_ANY_ZEROS and REDUCE_ALL_ZEROS + cases, replaced comparing with func_parm with a new_cond_expr. Also + initialized the maximum/minimum value for the max/min index builtin + function. + (contains_array_notation_expr): Deferenced array_list in if statement. + * typeck.c (convert_for_assignment): Checked if the rhs contains array + notation expr, if so we don't do any conversion. + +2012-01-26 Balaji V. Iyer + * cp-array-notation.c (extract_array_notation_exprs): Added a check to see if the call expr is sec_implicit_index function. (replace_array_notations): Likewise. diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c index 2a27c62..11bc99a 100644 --- a/gcc/cp/cp-array-notation.c +++ b/gcc/cp/cp-array-notation.c @@ -1294,7 +1294,8 @@ static tree fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) { tree new_var_type = NULL_TREE, func_parm, new_expr, new_yes_expr, new_no_expr; - tree new_var_init; + tree array_ind_value = NULL_TREE, new_no_ind, new_yes_ind, new_no_list; + tree new_yes_list, new_cond_expr, new_var_init, new_exp_init; an_reduce_type an_type = REDUCE_UNKNOWN; tree *array_list = NULL; int list_size = 0; @@ -1538,55 +1539,55 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) *new_var = build_decl (UNKNOWN_LOCATION, VAR_DECL, NULL_TREE, new_var_type); gcc_assert (*new_var); + if (an_type == REDUCE_MAX_INDEX || an_type == REDUCE_MIN_INDEX) + array_ind_value = build_decl + (UNKNOWN_LOCATION, VAR_DECL, NULL_TREE, TREE_TYPE (func_parm)); switch (an_type) { case REDUCE_ADD: new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, build_int_cst (new_var_type, 0), 1); + (*new_var, NOP_EXPR, build_zero_cst (new_var_type), 1); new_expr = build_x_modify_expr (*new_var, PLUS_EXPR, func_parm, 1); break; case REDUCE_MUL: new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, build_int_cst (new_var_type, 1), 1); + (*new_var, NOP_EXPR, build_one_cst (new_var_type), 1); new_expr = build_x_modify_expr (*new_var, MULT_EXPR, func_parm, 1); break; case REDUCE_ALL_ZEROS: new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, build_int_cst (new_var_type, 1), 1); + (*new_var, NOP_EXPR, build_one_cst (new_var_type), 1); /* Initially you assume everything is zero, now if we find a case where * it is NOT true, then we set the result to false. Otherwise * we just keep the previous value */ new_yes_expr = build_x_modify_expr - (*new_var, NOP_EXPR, build_int_cst (TREE_TYPE (*new_var), 0), 1); + (*new_var, NOP_EXPR, build_zero_cst (TREE_TYPE (*new_var)), 1); new_no_expr = build_x_modify_expr (*new_var, NOP_EXPR, *new_var, 1); - new_expr = build_x_conditional_expr (func_parm, new_yes_expr, + new_cond_expr = build2 (NE_EXPR, TREE_TYPE (func_parm), func_parm, + build_zero_cst (TREE_TYPE (func_parm))); + new_expr = build_x_conditional_expr (new_cond_expr, new_yes_expr, new_no_expr, 1); break; case REDUCE_ANY_ZEROS: new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, build_int_cst (new_var_type, 0), 1); + (*new_var, NOP_EXPR, build_zero_cst (new_var_type), 1); /* Initially we assume there are NO zeros in the list. When we find * a non-zero, we keep the previous value. If we find a zero, we * set the value to true */ new_no_expr = build_x_modify_expr - (*new_var, NOP_EXPR, build_int_cst (TREE_TYPE (*new_var), 1), 1); + (*new_var, NOP_EXPR, build_one_cst (TREE_TYPE (*new_var)), 1); new_yes_expr = build_x_modify_expr (*new_var, NOP_EXPR, *new_var, 1); - new_expr = build_x_conditional_expr (func_parm, new_yes_expr, + new_cond_expr = build2 (NE_EXPR, TREE_TYPE (func_parm), func_parm, + build_zero_cst (TREE_TYPE (func_parm))); + new_expr = build_x_conditional_expr (new_cond_expr, new_yes_expr, new_no_expr, 1); break; case REDUCE_MAX: - if (INTEGRAL_TYPE_P (new_var_type)) - new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, TYPE_MIN_VALUE (new_var_type), 1); - else /* Otherwise, we pick the first item in the array */ - new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, - build_array_ref (UNKNOWN_LOCATION, - TREE_OPERAND (array_operand[0], 0), - build_int_cst (integer_type_node, 0)), 1); + /* set initial value as the first element in the list */ + new_var_init = build_x_modify_expr (*new_var, NOP_EXPR, func_parm, 1); new_no_expr = build_x_modify_expr (*new_var, NOP_EXPR, *new_var, 1); new_yes_expr = build_x_modify_expr (*new_var, NOP_EXPR, func_parm, 1); new_expr = build_x_conditional_expr @@ -1594,15 +1595,7 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) new_yes_expr, new_no_expr, 1); break; case REDUCE_MIN: - if (INTEGRAL_TYPE_P (new_var_type)) - new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, TYPE_MAX_VALUE (new_var_type), 1); - else /* Otherwise, we the first item in the array */ - new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, - build_array_ref (UNKNOWN_LOCATION, - TREE_OPERAND (array_operand[0], 0), - build_int_cst (integer_type_node, 0)), 1); + new_var_init = build_x_modify_expr (*new_var, NOP_EXPR, func_parm, 1); new_no_expr = build_x_modify_expr (*new_var, NOP_EXPR, *new_var, 1); new_yes_expr = build_x_modify_expr (*new_var, NOP_EXPR, func_parm, 1); new_expr = build_x_conditional_expr @@ -1610,46 +1603,87 @@ fix_builtin_array_notation_fn (tree an_builtin_fn, tree *new_var) new_yes_expr, new_no_expr, 1); break; case REDUCE_MAX_INDEX: - new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, build_int_cst (new_var_type, 0), 1); - new_no_expr = build_x_modify_expr (*new_var, NOP_EXPR, *new_var, 1); + new_var_init = build_x_modify_expr (*new_var, NOP_EXPR, array_var[0], 1); + new_exp_init = build_x_modify_expr (array_ind_value, NOP_EXPR, func_parm, + 1); + new_no_ind = build_x_modify_expr (*new_var, NOP_EXPR, *new_var, 1); + new_no_expr = build_x_modify_expr (array_ind_value, NOP_EXPR, + array_ind_value, 1); if (list_size > 1) /* this means there is more than 1 */ - new_yes_expr = build_x_modify_expr (*new_var, NOP_EXPR, array_var[0], - 1); - else - new_yes_expr = build_x_modify_expr - (*new_var, NOP_EXPR, TREE_OPERAND (array_operand[0], 1), 1); + { + new_yes_ind = build_x_modify_expr (*new_var, NOP_EXPR, array_var[0], + 1); + new_yes_expr = build_x_modify_expr (array_ind_value, NOP_EXPR, + func_parm, 1); + } + else + { + new_yes_ind = build_x_modify_expr + (*new_var, NOP_EXPR, TREE_OPERAND (array_operand[0], 1), 1); + new_yes_expr = build_x_modify_expr (array_ind_value, NOP_EXPR, + func_parm, 1); + } + new_yes_list = alloc_stmt_list (); + append_to_statement_list (new_yes_ind, &new_yes_list); + append_to_statement_list (new_yes_expr, &new_yes_list); + + new_no_list = alloc_stmt_list (); + append_to_statement_list (new_no_ind, &new_no_list); + append_to_statement_list (new_no_expr, &new_no_list); new_expr = build_x_conditional_expr - (build2 (LT_EXPR, TREE_TYPE (*new_var), *new_var, func_parm), - new_yes_expr, new_no_expr, 1); + (build2 (LT_EXPR, TREE_TYPE (array_ind_value), array_ind_value, + func_parm), + new_yes_list, new_no_list, 1); break; case REDUCE_MIN_INDEX: - new_var_init = build_x_modify_expr - (*new_var, NOP_EXPR, build_int_cst (new_var_type, 0), 1); - new_no_expr = build_x_modify_expr (*new_var, NOP_EXPR, *new_var, 1); - if (list_size > 1) - new_yes_expr = build_x_modify_expr (*new_var, NOP_EXPR, array_var[0], - 1); + new_var_init = build_x_modify_expr (*new_var, NOP_EXPR, array_var[0], 1); + new_exp_init = build_x_modify_expr (array_ind_value, NOP_EXPR, func_parm, + 1); + new_no_ind = build_x_modify_expr (*new_var, NOP_EXPR, *new_var, 1); + new_no_expr = build_x_modify_expr (array_ind_value, NOP_EXPR, + array_ind_value, 1); + if (list_size > 1) /* this means there is more than 1 */ + { + new_yes_ind = build_x_modify_expr (*new_var, NOP_EXPR, array_var[0], + 1); + new_yes_expr = build_x_modify_expr (array_ind_value, NOP_EXPR, + func_parm, 1); + } else - new_yes_expr = build_x_modify_expr - (*new_var, NOP_EXPR, TREE_OPERAND (array_operand[0], 1), 1); + { + new_yes_ind = build_x_modify_expr + (*new_var, NOP_EXPR, TREE_OPERAND (array_operand[0], 1), 1); + new_yes_expr = build_x_modify_expr (array_ind_value, NOP_EXPR, + func_parm, 1); + } + new_yes_list = alloc_stmt_list (); + append_to_statement_list (new_yes_ind, &new_yes_list); + append_to_statement_list (new_yes_expr, &new_yes_list); + + new_no_list = alloc_stmt_list (); + append_to_statement_list (new_no_ind, &new_no_list); + append_to_statement_list (new_no_expr, &new_no_list); new_expr = build_x_conditional_expr - (build2 (GT_EXPR, TREE_TYPE (*new_var), *new_var, func_parm), - new_yes_expr, new_no_expr, 1); + (build2 (GT_EXPR, TREE_TYPE (array_ind_value), array_ind_value, + func_parm), + new_yes_list, new_no_list, 1); break; default: gcc_unreachable (); break; } + for (ii = 0; ii < rank; ii++) + append_to_statement_list (ind_init[ii], &loop); + append_to_statement_list (new_var_init, &loop); + if (an_type == REDUCE_MAX_INDEX || an_type == REDUCE_MIN_INDEX) + append_to_statement_list (new_exp_init, &loop); for (ii = 0; ii < rank; ii++) { - append_to_statement_list (ind_init [ii], &loop); - append_to_statement_list (build1 (LABEL_EXPR, void_type_node, if_stmt_label[ii]), &loop); append_to_statement_list @@ -2078,7 +2112,7 @@ contains_array_notation_expr (tree expr) int list_size = 0; extract_array_notation_exprs (expr, false, &array_list, &list_size); - if (*array_list == NULL || list_size == 0) + if (array_list == NULL || list_size == 0) return false; else return true; diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 741d5b4..a161742 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -62,6 +62,7 @@ static tree lookup_destructor (tree, tree, tree); static void warn_args_num (location_t, tree, bool); static int convert_arguments (tree, VEC(tree,gc) **, tree, int, tsubst_flags_t); +extern bool contains_array_notation_expr (tree); /* Do `exp = require_complete_type (exp);' to make sure exp does not have an incomplete type. (That includes void types.) @@ -7393,6 +7394,9 @@ convert_for_assignment (tree type, tree rhs, { tree rhstype; enum tree_code coder; + + if (flag_enable_cilk && contains_array_notation_expr (rhs)) + return rhs; /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */ if (TREE_CODE (rhs) == NON_LVALUE_EXPR) diff --git a/gcc/testsuite/ChangeLog.cilk b/gcc/testsuite/ChangeLog.cilk index 7f67680..7753823 100644 --- a/gcc/testsuite/ChangeLog.cilk +++ b/gcc/testsuite/ChangeLog.cilk @@ -1,3 +1,9 @@ +2012-01-26 Balaji V. Iyer + + * gcc.dg/cilk-plus/array_notation_tests/builtin_func_double.c(main): + Fixed a variable mistake. + * g++.dg/cilk-plus/array_notation_tests/builtin_func_double.cc: New. + 2012-01-25 Balaji V. Iyer * gcc.dg/cilk-plus/array_notation_tests/sec_implicit_ex.c: New. diff --git a/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/builtin_func_double.cc b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/builtin_func_double.cc new file mode 100644 index 0000000..682c008 --- /dev/null +++ b/gcc/testsuite/g++.dg/cilk-plus/array_notation_tests/builtin_func_double.cc @@ -0,0 +1,72 @@ +#if HAVE_IO +#include +using namespace std; +#endif +#include + +/* char __sec_reduce_add (int *); */ +int main(int argc, char **argv) +{ + int ii,array[10], y = 0, y_int = 0, array2[10]; + double x, yy, array3[10], array4[10]; + for (ii = 0; ii < 10; ii++) + { + array[ii] = 1+ii; + array2[ii]= 2; + } + + for (ii = 0; ii < 10; ii++) + { + if (ii%2 && ii) + array3[ii] = (double)(1.0000/(double)ii); + else + array3[ii] = (double) ii + 0.10; + array4[ii] = (double) (1.00000/ (double)(ii+1)); + } + + /* array[:] = 5; */ + x = __sec_reduce_max (array3[:] * array4[:]); + y = __sec_reduce_max_ind ( array3[:] * array4[:]); +#if HAVE_IO + for (ii = 0; ii < 10; ii++) + cout << array3[ii] * array4[ii] << " "; + cout << endl; + cout << "Max = " << x << " Max Index = " << y << endl; +#endif + + x = __sec_reduce_min (array3[:] * array4[:]); + y = __sec_reduce_min_ind ( array3[:] * array4[:]); +#if HAVE_IO + for (ii = 0; ii < 10; ii++) + cout << array3[ii] * array4[ii] << " "; + cout << endl; + cout << "Min = " << x << " Min Index = " << y << endl; +#endif + + x = __sec_reduce_add (array3[:] * array4[:]); + yy = __sec_reduce_mul ( array3[:] * array4[:]); +#if HAVE_IO + for (ii = 0; ii < 10; ii++) + cout << array3[ii] * array4[ii] << " "; + cout << endl; + cout << "Add = " << x << " Mul = " << yy << endl; +#endif + + for (ii = 0; ii < 10; ii++) + { + if (ii%2 && ii) + array3[ii] = (double)(1.0000/(double)ii); + else + array3[ii] = (double) ii + 0.00; + array4[ii] = (double) (1.00000/ (double)(ii+1)); + } + y_int = __sec_reduce_any_zeros (array3[:] * array4[:]); + y = __sec_reduce_all_zeros ( array3[:] * array4[:]); +#if HAVE_IO + for (ii = 0; ii < 10; ii++) + cout << array3[ii] * array4[ii] << " "; + cout << endl; + cout << "Any Zeros = " << y_int << " All Zeros = " << y << endl; +#endif + return 0; +} diff --git a/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/builtin_func_double.c b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/builtin_func_double.c index e52bbcc..ff38a71 100644 --- a/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/builtin_func_double.c +++ b/gcc/testsuite/gcc.dg/cilk-plus/array_notation_tests/builtin_func_double.c @@ -50,7 +50,7 @@ int main(int argc, char **argv) for (ii = 0; ii < 10; ii++) printf("%5.3f ", array3[ii] * array4[ii]); printf("\n"); - printf("Add = %5.3f\t Mul = %f\n", x, y); + printf("Add = %5.3f\t Mul = %f\n", x, yy); #endif for (ii = 0; ii < 10; ii++)