summaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-12 22:03:20 +0000
committerbviyer <bviyer@138bc75d-0d04-0410-961f-82ee72b054a4>2013-06-12 22:03:20 +0000
commit6a3adac6a744883d9164deda318492121e6048ef (patch)
tree8687d4442d46f2ae893bd8d95b104c6f7d5bfea0 /gcc/c
parenta8b52ce38f3056e464457ba1e95efa25a8f08d07 (diff)
downloadgcc-6a3adac6a744883d9164deda318492121e6048ef.tar.gz
fix pr c/57577
gcc/c/ChangeLog +2013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com> + + * c-array-notation.c (build_array_notation_expr): Reject array notation + mismatch between LHS and RHS even inside a call_expr. Also, removed + a couple while statements that were dead code. + gcc/testsuite/ChangeLog +2013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com> + + PR c/57577 + * c-c++-common/cilk-plus/AN/pr57577.c: New testcase. + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@200043 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-array-notation.c13
2 files changed, 7 insertions, 12 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 72d182bbae3..6179c3bb546 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2013-06-12 Balaji V. Iyer <balaji.v.iyer@intel.com>
+
+ * c-array-notation.c (build_array_notation_expr): Reject array notation
+ mismatch between LHS and RHS even inside a call_expr. Also, removed
+ a couple while statements that were dead code.
+
2013-06-10 Balaji V. Iyer <balaji.v.iyer@intel.com>
* c-array-notation.c (fix_builtin_array_notation_fn): Fully folded
diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c
index 32859691cc3..03b66b9cf79 100644
--- a/gcc/c/c-array-notation.c
+++ b/gcc/c/c-array-notation.c
@@ -781,7 +781,7 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
rhs_list_size = vec_safe_length (rhs_list);
lhs_list_size = vec_safe_length (lhs_list);
- if (lhs_rank == 0 && rhs_rank != 0 && TREE_CODE (rhs) != CALL_EXPR)
+ if (lhs_rank == 0 && rhs_rank != 0)
{
tree rhs_base = rhs;
if (TREE_CODE (rhs_base) == ARRAY_NOTATION_REF)
@@ -802,17 +802,6 @@ build_array_notation_expr (location_t location, tree lhs, tree lhs_origtype,
}
if (lhs_rank != 0 && rhs_rank != 0 && lhs_rank != rhs_rank)
{
- tree lhs_base = lhs;
- tree rhs_base = rhs;
-
- for (ii = 0; ii < lhs_rank; ii++)
- lhs_base = ARRAY_NOTATION_ARRAY (lhs_base);
-
- while (rhs_base && TREE_CODE (rhs_base) != ARRAY_NOTATION_REF)
- rhs_base = TREE_OPERAND (rhs_base, 0);
- for (ii = 0; ii < rhs_rank; ii++)
- rhs_base = ARRAY_NOTATION_ARRAY (rhs_base);
-
error_at (location, "rank mismatch between %qE and %qE", lhs, rhs);
pop_stmt_list (an_init);
return error_mark_node;