diff mbox

Fix for PR c++/60198

Message ID BF230D13CA30DD48930C31D4099330003B02540D@fmsmsx101.amr.corp.intel.com
State New
Headers show

Commit Message

Iyer, Balaji V Feb. 20, 2015, 6:43 a.m. UTC
Hello Everyone,	
	Attached, please find a patch that is a fix for PR c++/60198. Is this OK for trunk?

Here are the changelog entries:

Cp/ChangeLog
+2015-02-19  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       PR c++/60198
+       * pt.c (tsubst_copy_and_build): Added CILK_SPAWN_STMT case.
+

Testsuite/ChangeLog
+2015-02-20  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+       PR c++/60198
+       * g++.dg/cilk-plus/pr60198.C: New test
+

Thanks,

Balaji V. Iyer.

Comments

Iyer, Balaji V Feb. 23, 2015, 9:36 p.m. UTC | #1
PING!

> -----Original Message-----
> From: Iyer, Balaji V
> Sent: Thursday, February 19, 2015 10:43 PM
> To: gcc-patches@gcc.gnu.org
> Subject: [PATCH] Fix for PR c++/60198
> 
> Hello Everyone,
> 	Attached, please find a patch that is a fix for PR c++/60198. Is this OK
> for trunk?
> 
> Here are the changelog entries:
> 
> Cp/ChangeLog
> +2015-02-19  Balaji V. Iyer  <balaji.v.iyer@intel.com>
> +
> +       PR c++/60198
> +       * pt.c (tsubst_copy_and_build): Added CILK_SPAWN_STMT case.
> +
> 
> Testsuite/ChangeLog
> +2015-02-20  Balaji V. Iyer  <balaji.v.iyer@intel.com>
> +
> +       PR c++/60198
> +       * g++.dg/cilk-plus/pr60198.C: New test
> +
> 
> Thanks,
> 
> Balaji V. Iyer.
>
diff mbox

Patch

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 9a00d0d..8a95d1e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15708,6 +15708,10 @@  tsubst_copy_and_build (tree t,
 
     case PAREN_EXPR:
       RETURN (finish_parenthesized_expr (RECUR (TREE_OPERAND (t, 0))));
+      
+    case CILK_SPAWN_STMT:
+      cfun->calls_cilk_spawn = 1;
+      RETURN (build_cilk_spawn (EXPR_LOCATION (t), RECUR (CILK_SPAWN_FN (t))));
 
     case VEC_PERM_EXPR:
       {
diff --git a/gcc/testsuite/g++.dg/cilk-plus/pr60198.C b/gcc/testsuite/g++.dg/cilk-plus/pr60198.C
new file mode 100644
index 0000000..b8cf067
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cilk-plus/pr60198.C
@@ -0,0 +1,10 @@ 
+// { dg-do compile }
+// { dg-options "-fcilkplus -O3" } 
+
+template<typename T> int foo()
+{
+    int i = (_Cilk_spawn foo<T>()) + 0;
+      return i;
+}
+
+template int foo<int>();