diff mbox

[Cilkplus] Fix a bug in array notations

Message ID BF230D13CA30DD48930C31D40993300005A007@FMSMSX102.amr.corp.intel.com
State New
Headers show

Commit Message

Iyer, Balaji V March 13, 2012, 4:06 p.m. UTC
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.
diff mbox

Patch

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.iyer@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.iyer@intel.com>
 
 	* attribs.c (decl_attributes): Concatinated existing attributes with