https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114445

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
I actually wonder whether we couldn't fill it on the host.

It kind of assumes sizeof(void*) is the same on the host and
on the device, but then it should work, given that htab only
allocates memory in htab_create – assuming it is not resized.

But for 'indirect', I don't see why that should ever happen.

Thus, I think some helper function would be enough, shared by
both plugins - and then it can be copied to the device and
the pointer to it updated - or the latter set to NULL.

The current code assumes the variable is always != NULL even if
empty, but if there is no 'indirect', the lookup could be optimized.

htab_create (size_t size)
{
...
  result = (htab_t) htab_alloc (sizeof (struct htab)
                                + size * sizeof (hash_entry_type));

Reply via email to