Hello Everyone,
        Attached, please find a patch that will fix PR 59825. The main issue 
was array notations occurring in COMPOUND_EXPR. This patch should fix that and 
fix the rank_mismatch2.c test-case ICE.
        
        Ok for trunk?

Thanks,

Balaji V. Iyer.
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 4754bdf..e081c19 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2014-01-15  Balaji V. Iyer  <balaji.v.i...@intel.com>
+
+       PR c/59825
+       * c-array-notation.c (expand_array_notation_exprs): Added COMPOUND_EXPR
+       case.
+
 2014-01-15  Jakub Jelinek  <ja...@redhat.com>
 
        PR c/58943
diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c
index 5526ee9..dee9fa9 100644
--- a/gcc/c/c-array-notation.c
+++ b/gcc/c/c-array-notation.c
@@ -1289,6 +1289,15 @@ expand_array_notation_exprs (tree t)
         A[x:y];
         Replace those with just void zero node.  */
       t = void_zero_node;
+      return t;
+    case COMPOUND_EXPR:
+      if (contains_array_notation_expr (t))
+       if (TREE_CODE (TREE_OPERAND (t, 0)) == SAVE_EXPR)
+         {
+           t = expand_array_notation_exprs (TREE_OPERAND (t, 1));
+           return t;
+         }
+         /* Else fall through.  */
     default:
       for (int ii = 0; ii < TREE_CODE_LENGTH (TREE_CODE (t)); ii++)
        if (contains_array_notation_expr (TREE_OPERAND (t, ii)))

Reply via email to