From 203484bb27d092dde0f91bf50ce6bc541f1e5dfe Mon Sep 17 00:00:00 2001 From: Patrick Palka Date: Sat, 16 Jan 2016 02:30:14 +0000 Subject: Fix logic bug in Cilk Plus array expansion gcc/cp/ChangeLog: * cp-array-notation.c (cp_expand_cond_array_notations): Return error_mark_node only if find_rank failed, not if it was successful. gcc/testsuite/ChangeLog: * c-c++-common/cilk-plus/AN/an-if.c: Check that the original dump does not contain an error_mark_node. * c-c++-common/cilk-plus/CK/pr60469.c: Likewise. * c-c++-common/cilk-plus/AN/fn_ptr-2.c: New xfail'd test. From-SVN: r232462 --- gcc/cp/cp-array-notation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/cp/cp-array-notation.c') diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c index f7a4598..4687ced6 100644 --- a/gcc/cp/cp-array-notation.c +++ b/gcc/cp/cp-array-notation.c @@ -807,8 +807,8 @@ cp_expand_cond_array_notations (tree orig_stmt) if (!find_rank (EXPR_LOCATION (cond), cond, cond, true, &cond_rank) || !find_rank (EXPR_LOCATION (yes_expr), yes_expr, yes_expr, true, &yes_rank) - || find_rank (EXPR_LOCATION (no_expr), no_expr, no_expr, true, - &no_rank)) + || !find_rank (EXPR_LOCATION (no_expr), no_expr, no_expr, true, + &no_rank)) return error_mark_node; /* If the condition has a zero rank, then handle array notations in body separately. */ -- cgit v1.1