diff options
author | bviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-15 22:00:19 +0000 |
---|---|---|
committer | bviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-08-15 22:00:19 +0000 |
commit | 90df13422c436b3fdc4f7f642f7a27b0f2505075 (patch) | |
tree | 33d9fd818691948608f552fd9a23f770f4420620 | |
parent | a3d3a66800a372ebf2d976169b23716a4883a370 (diff) |
2013-08-15 Balaji V. Iyer <balaji.v.iyer@intel.com>
* cp-array-notation.c (fix_conditional_array_notations_1): Do not
reject when rank of body of if-statment is zero.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/cilkplus@201774 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog.cilkplus | 2 | ||||
-rw-r--r-- | gcc/cp/cp-array-notation.c | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog.cilkplus b/gcc/cp/ChangeLog.cilkplus index 12de6bb6cde..5fc31585234 100644 --- a/gcc/cp/ChangeLog.cilkplus +++ b/gcc/cp/ChangeLog.cilkplus @@ -2,6 +2,8 @@ * cp-array-notation.c (find_inv_trees): Added a check for VAR_DECL or PARM_DECL. If so then don't save them to temporary variables. + (fix_conditional_array_notations_1): Do not reject when rank of body + of if-statment is zero. 2013-05-09 Balaji V. Iyer <balaji.v.iyer@intel.com> diff --git a/gcc/cp/cp-array-notation.c b/gcc/cp/cp-array-notation.c index 77c778a68d8..514c33779e1 100644 --- a/gcc/cp/cp-array-notation.c +++ b/gcc/cp/cp-array-notation.c @@ -1458,13 +1458,13 @@ fix_conditional_array_notations_1 (tree orig_stmt) find_rank (cond, true, &cond_rank); find_rank (yes_expr, true, &yes_rank); find_rank (no_expr, true, &no_rank); - if (cond_rank != 0 && cond_rank != yes_rank) + if (cond_rank != 0 && cond_rank != yes_rank && yes_rank > 0) { error_at (EXPR_LOCATION (yes_expr), "rank mismatch with controlling" " expression of parent if-statement"); return error_mark_node; } - else if (cond_rank != 0 && cond_rank != no_rank) + else if (cond_rank != 0 && cond_rank != no_rank && no_rank > 0) { error_at (EXPR_LOCATION (no_expr), "rank mismatch with controlling " "expression of parent if-statement"); @@ -1480,13 +1480,13 @@ fix_conditional_array_notations_1 (tree orig_stmt) find_rank (cond, true, &cond_rank); find_rank (yes_expr, true, &yes_rank); find_rank (no_expr, true, &no_rank); - if (cond_rank != 0 && cond_rank != yes_rank) + if (cond_rank != 0 && cond_rank != yes_rank && yes_rank > 0) { error_at (EXPR_LOCATION (yes_expr), "rank mismatch with controlling" " expression of parent if-statement"); return error_mark_node; } - else if (cond_rank != 0 && cond_rank != no_rank) + else if (cond_rank != 0 && cond_rank != no_rank && no_rank > 0) { error_at (EXPR_LOCATION (no_expr), "rank mismatch with controlling " "expression of parent if-statement"); |