Hello Everyone,
        This patch is for the Cilk Plus branch mainly affecting template code 
in C++. This patch will pass the spawn information for the expanded template 
functions. This information was not propagated correctly in the existing 
implementation.

Thanks,

Balaji V. Iyer.
Index: gcc/cp/semantics.c
===================================================================
--- gcc/cp/semantics.c  (revision 188025)
+++ gcc/cp/semantics.c  (working copy)
@@ -2110,7 +2110,7 @@
                                          ? LOOKUP_NORMAL | LOOKUP_NONVIRTUAL
                                         : LOOKUP_NORMAL),
                                        /*fn_p=*/NULL,
-                                       CALL_NORMAL,
+                                       spawning,
                                        complain);
        }
     }
@@ -2161,7 +2161,7 @@
                                       ? LOOKUP_NORMAL|LOOKUP_NONVIRTUAL
                                       : LOOKUP_NORMAL),
                                      /*fn_p=*/NULL,
-                                     CALL_NORMAL,
+                                     spawning,
                                      complain);
     }
   else if (is_overloaded_fn (fn))
@@ -2174,7 +2174,7 @@
 
       if (!result)
        /* A call to a namespace-scope function.  */
-       result = build_new_function_call (fn, args, koenig_p, CALL_NORMAL,
+       result = build_new_function_call (fn, args, koenig_p, spawning,
                                          complain);
     }
   else if (TREE_CODE (fn) == PSEUDO_DTOR_EXPR)
@@ -2191,11 +2191,11 @@
   else if (CLASS_TYPE_P (TREE_TYPE (fn)))
     /* If the "function" is really an object of class type, it might
        have an overloaded `operator ()'.  */
-    result = build_op_call (fn, args, CALL_NORMAL, complain);
+    result = build_op_call (fn, args, spawning, complain);
 
   if (!result)
     /* A call where the function is unknown.  */
-    result = cp_build_function_call_vec (fn, args, CALL_NORMAL, complain);
+    result = cp_build_function_call_vec (fn, args, spawning, complain);
 
   if (processing_template_decl && result != error_mark_node)
     {
Index: gcc/cp/ChangeLog.cilk
===================================================================
--- gcc/cp/ChangeLog.cilk       (revision 188025)
+++ gcc/cp/ChangeLog.cilk       (working copy)
@@ -1,3 +1,8 @@
+2012-05-30  Balaji V. Iyer  <balaji.v.i...@intel.com>
+
+       * semantics.c (finish_call_expr): Used spawning for call_type instead of
+       default CALL_NORMAL to support spawned call.
+
 2012-05-29  Balaji V. Iyer  <balaji.v.i...@intel.com>
 
        * pt.c (apply_late_template_attributes): Added a check for "vector"

Reply via email to