Ping.

On 22/11/2019 11:06, Andrew Stubbs wrote:
This test case causes an ICE (reformatted for email):

   void test(int k)
   {
     unsigned int x = 1;
   #pragma acc parallel loop async(x)
     for (int i = 0; i < k; i++) { }
   }

   t.c: In function 'test':
   t.c:4:9: error: invalid argument to gimple call
       4 | #pragma acc parallel loop async(x)
         |         ^~~
   (int) x
   __builtin_GOACC_parallel_keyed (-1, test._omp_fn.0, 1,
                                   &.omp_data_arr.3, &.omp_data_sizes.4,
                                   &.omp_data_kinds.5, 536936447,
                                  (int) x, 0);
   during GIMPLE pass: ompexp
   dump file: t.c.013t.ompexp
   t.c:4:9: internal compiler error: verify_gimple failed

The problem is that "x" needs to be cast to "int" (from "unsigned int") before calling the function, and that's not valid in a gimple call.

The attached patch assigns the "(int) x" to a temporary and passes that to the function instead.

OK to commit?


Reply via email to