Explorar o código

gcc: Pass the cl_arg size in bytes, not bits.

* gcc-plugin/src/starpu.c (sizeof_type): New function.
  (build_task_submission): Use it.
Ludovic Courtès %!s(int64=14) %!d(string=hai) anos
pai
achega
c2a9726f65
Modificáronse 1 ficheiros con 12 adicións e 1 borrados
  1. 12 1
      gcc-plugin/src/starpu.c

+ 12 - 1
gcc-plugin/src/starpu.c

@@ -422,6 +422,17 @@ register_task_attributes (void *gcc_data, void *user_data)
 
 
 
 
 
 
+/* Return the size in bytes of TYPE.  */
+
+static tree
+sizeof_type (const_tree type)
+{
+  size_t bits;
+
+  bits = TREE_INT_CST_LOW (TYPE_SIZE (type));
+  return build_int_cstu (size_type_node, bits / 8);
+}
+
 /* Return a NODE_IDENTIFIER for the variable holding the `starpu_codelet'
 /* Return a NODE_IDENTIFIER for the variable holding the `starpu_codelet'
    structure associated with TASK_DECL.  */
    structure associated with TASK_DECL.  */
 
 
@@ -685,7 +696,7 @@ build_task_submission (tree task_decl, gimple call)
 	  VEC_safe_push (tree, heap, args,
 	  VEC_safe_push (tree, heap, args,
 			 build_addr (arg, current_function_decl));
 			 build_addr (arg, current_function_decl));
 	  VEC_safe_push (tree, heap, args,
 	  VEC_safe_push (tree, heap, args,
-			 TYPE_SIZE (TREE_TYPE (arg)));
+			 sizeof_type (TREE_TYPE (arg)));
 	}
 	}
     }
     }