diff mbox

[Cilkplus] Patch to finish const tree

Message ID 2950715866004049A240A2F9BB410E7315FB28F60C@azsmsx502.amr.corp.intel.com
State New
Headers show

Commit Message

Iyer, Balaji V Nov. 11, 2011, 4:07 p.m. UTC
Hello Everyone,
    This patch is for the Cilkplus branch, affecting the C and C++ compilers. This patch will fix a warning about converting a const void * to tree.
   
     This patch is PATCH #2.

Thanks,

Balaji V. Iyer.
diff mbox

Patch

diff --git a/gcc/ChangeLog.cilk b/gcc/ChangeLog.cilk
index 285f059..511d8f7 100644
--- a/gcc/ChangeLog.cilk
+++ b/gcc/ChangeLog.cilk
@@ -1,3 +1,10 @@ 
+2011-11-11  Balaji V. Iyer  <balaji.v.iyer@intel.com>
+
+	* cilk-spawn.c (wrapper_parm_cb): Changed a const tree cast
+	to (tree *).
+	(for_local_cb): Likewise.
+	(wrapper_local_cb): Likewise.
+
 2011-10-22  Balaji V. Iyer  <balaji.v.iyer@intel.com>
 
 	* cilk.c (install_builtin): Changed implicit_built_in_decls[] to
diff --git a/gcc/cilk-spawn.c b/gcc/cilk-spawn.c
index b004b11..17b9c51 100644
--- a/gcc/cilk-spawn.c
+++ b/gcc/cilk-spawn.c
@@ -1290,7 +1290,7 @@  static bool
 wrapper_parm_cb (const void *key0, void **val0, void *data)
 {
   struct wrapper_data *wd = (struct wrapper_data *)data;
-  tree arg = (const tree)key0;
+  tree arg = * (tree *)&key0;
   tree val = (tree)*val0;
   tree parm;
 
@@ -1450,7 +1450,7 @@  build_cilk_wrapper_body (tree stmt,
 static bool
 for_local_cb (const void *k_v, void **vp, void *p)
 {
-  tree k = (const tree) k_v; /* const cast */
+  tree k = *(tree *) &k_v; /* const cast */
   tree v = (tree) *vp;
 
   if (v == error_mark_node)
@@ -1462,7 +1462,7 @@  static bool
 wrapper_local_cb (const void *k_v, void **vp, void *data)
 {
   copy_body_data *id = (copy_body_data *)data;
-  tree key = (const tree) k_v;
+  tree key = *(tree *) &k_v;
   tree val = (tree) *vp;
 
   if (val == error_mark_node)
diff --git a/gcc/cp/ChangeLog.cilk b/gcc/cp/ChangeLog.cilk
index fc498f1..ce83aa6 100644
--- a/gcc/cp/ChangeLog.cilk
+++ b/gcc/cp/ChangeLog.cilk
@@ -4,6 +4,8 @@ 
 	parameter to finish_call_expr function call.
 	(cp_parser_userdef_numeral_literal): Likewise.
 	(cp_parser_userdef_string_literal): Likewise.
+	* cilk.c (for_local_cb): Changed a const tree cast to (tree *).
+	(wrapper_local_cb): Likewise.
 
 2011-10-22  Balaji V. Iyer  <balaji.v.iyer@intel.com>
 
diff --git a/gcc/cp/cilk.c b/gcc/cp/cilk.c
index 08a196e..b5e58f6 100644
--- a/gcc/cp/cilk.c
+++ b/gcc/cp/cilk.c
@@ -289,7 +289,7 @@  copy_decl_for_cilk (tree decl, copy_body_data *id)
 static bool
 for_local_cb (const void *k_v, void **vp, void *p)
 {
-  tree k = (tree) k_v;
+  tree k = *(tree *) &k_v;
   tree v = (tree) *vp;
 
 
@@ -334,7 +334,7 @@  static bool
 wrapper_local_cb (const void *k_v, void **vp, void *data)
 {
   copy_body_data *id = (copy_body_data *)data;
-  tree key = (tree)k_v;
+  tree key = *(tree *) &k_v;
   tree val = (tree)*vp;
 
   if (val == error_mark_node)