On Wed, Jul 06, 2022 at 03:59:59PM +0200, Tobias Burnus wrote: > > @@ -2436,12 +2452,15 @@ GOMP_offload_unregister_ver (unsigned version, > > const void *host_table, > > } > > > > /* Remove image from array of pending images. */ > > + bool found = false; > > for (i = 0; i < num_offload_images; i++) > > if (offload_images[i].target_data == target_data) > > { > > offload_images[i] = offload_images[--num_offload_images]; > > + found = true; > > break; > > } > > + assert (found); > > > > gomp_mutex_unlock (®ister_lock); > > } > > ... I don't like that libgomp crashes without any helpful message in that > case. > > In my opinion: > * Either we assume that it is unlikely to occur - ignore it. > (Matches the current implementation: do nothing.)
I think we don't need any asserts here, nor gomp_error/gomp_fatal. The GOMP_* APIs aren't meant for direct user uses, they are to be only called by compiler generated code or support object files, and in the case of GOMP_offload_{,un}register_ver the crt file makes sure it will be registered and unregistered in pairs. Jakub