소스 검색

gcc: Add note about implicit integer type conversion in task submissions.

* gcc-plugin/src/starpu.c (build_task_submission): Add comment about
  things to fix.

* gcc-plugin/tests/base.c (main): Add test with `y_as_long_int', along
  with comment explaining what to fix.
Ludovic Courtès 14 년 전
부모
커밋
d209910ab3
2개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 0
      gcc-plugin/src/starpu.c
  2. 7 1
      gcc-plugin/tests/base.c

+ 3 - 0
gcc-plugin/src/starpu.c

@@ -944,6 +944,9 @@ build_task_submission (tree task_decl, gimple call)
      non-addressable variable---e.g., a `char' variable allocated in a
      register.  Populate BODY with the initial assignments to these
      variables.  */
+  /* FIXME: We should also introduce local variables to mimic implicit
+     integer type conversion---e.g., when the formal parameter type is `char'
+     and the function is called with a `long' variable.  */
 
   tree local_vars (gimple_seq *body)
   {

+ 7 - 1
gcc-plugin/tests/base.c

@@ -48,6 +48,7 @@ main (int argc, char *argv[])
 
   int x = 42, z = 99;
   char y = 77;
+  long y_as_long_int = 77;
 
   struct insert_task_argument expected[] =
     {
@@ -74,7 +75,12 @@ main (int argc, char *argv[])
 
   my_scalar_task (42, 77, 99);
 
-  assert (tasks_submitted == 8);
+  /* FIXME: Currently this one only works on little endian since we take the
+     address of `y_as_long_int' directly.  Instead a new `char' variable
+     should be introduced, and we should take its address.  */
+  my_scalar_task (42, y_as_long_int, 99);
+
+  assert (tasks_submitted == 9);
 
   return EXIT_SUCCESS;
 }