Hello Everyone,
   This patch is for the Cilkplus branch mainly affecting the C compiler. It 
fixes a bug in function calls that take in array notations.

Thanks,

Balaji V. Iyer.
Index: gcc/c-typeck.c
===================================================================
--- gcc/c-typeck.c      (revision 185342)
+++ gcc/c-typeck.c      (working copy)
@@ -3274,7 +3274,10 @@
 
   if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
     {
-      if (flag_enable_cilk && contains_array_notation_expr (function))
+      if (flag_enable_cilk
+         && (contains_array_notation_expr (function)
+             || contains_array_notation_expr
+             (build_tree_list_vec (values))))
        ;
       else
        {
Index: gcc/c-array-notation.c
===================================================================
--- gcc/c-array-notation.c      (revision 185342)
+++ gcc/c-array-notation.c      (working copy)
@@ -134,6 +134,15 @@
       *array_list = new_array_list;
       return;
     }
+  else if (TREE_CODE (node) == TREE_LIST)
+    {
+      extract_array_notation_exprs (TREE_PURPOSE (node), ignore_builtin_fn,
+                                   array_list, list_size);
+      extract_array_notation_exprs (TREE_VALUE (node), ignore_builtin_fn,
+                                   array_list, list_size);
+      extract_array_notation_exprs (TREE_CHAIN (node), ignore_builtin_fn,
+                                   array_list, list_size);
+    }
   else if (TREE_CODE (node) == STATEMENT_LIST)
     {
       tree_stmt_iterator ii_tsi;
Index: gcc/ChangeLog.cilk
===================================================================
--- gcc/ChangeLog.cilk  (revision 185342)
+++ gcc/ChangeLog.cilk  (working copy)
@@ -1,3 +1,9 @@
+2012-03-12  Balaji V. Iyer  <balaji.v.i...@intel.com>
+
+       * c-typeck.c (convert_arguments): Added array notation check for
+       funtion values.
+       * c-array-notation.c (extract_array_notation_exprs): Handled TREE_LIST.
+
 2012-03-11  Balaji V. Iyer  <balaji.v.i...@intel.com>
 
        * attribs.c (decl_attributes): Concatinated existing attributes with

Reply via email to