[PATCH] openmp: Implement support for OMP_TARGET_OFFLOAD

Tobias Burnus tobias@codesourcery.com
Tue Oct 20 12:17:26 GMT 2020


On 10/20/20 2:11 PM, Tobias Burnus wrote:

> Unfortunately, the committed patch
> (r11-4121-g1bfc07d150790fae93184a79a7cce897655cb37b)
> causes build errors.
>
> The error seems to be provoked by function cloning – as the code
> itself looks fine:
> ...
>  struct gomp_device_descr *devices_s
>     = malloc (num_devices * sizeof (struct gomp_device_descr));
> ...
>   for (i = 0; i < num_devices; i++)
>     if (!(devices[i].capabilities & GOMP_OFFLOAD_CAP_OPENMP_400))
>       devices_s[num_devices_after_openmp++] = devices[i];

gomp_target_init.part.0 ()
{
...
<bb 2>
   devices_s_1 = malloc (0);
...
   num_devices.16_67 = num_devices;
...
   if (num_devices.16_67 > 0)
     goto <bb 3>; [89.00%]
   else
     goto <bb 18>; [11.00%]

Which seems to have an ordering problem.

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter


More information about the Gcc-patches mailing list