diff -ru trunk-orig/libgomp/oacc-async.c trunk-work/libgomp/oacc-async.c --- trunk-orig/libgomp/oacc-async.c 2018-12-14 22:11:29.252251925 +0800 +++ trunk-work/libgomp/oacc-async.c 2018-12-18 22:19:51.923102938 +0800 @@ -70,12 +70,16 @@ struct gomp_device_descr *dev = thr->dev; + gomp_mutex_lock (&dev->openacc.async.lock); + if (!create && (async >= dev->openacc.async.nasyncqueue || !dev->openacc.async.asyncqueue[async])) - return NULL; + { + gomp_mutex_unlock (&dev->openacc.async.lock); + return NULL; + } - gomp_mutex_lock (&dev->openacc.async.lock); if (async >= dev->openacc.async.nasyncqueue) { int diff = async + 1 - dev->openacc.async.nasyncqueue; @@ -91,6 +95,12 @@ { dev->openacc.async.asyncqueue[async] = dev->openacc.async.construct_func (); + if (!dev->openacc.async.asyncqueue[async]) + { + gomp_mutex_unlock (&dev->openacc.async.lock); + gomp_fatal ("async %d creation failed", async); + } + /* Link new async queue into active list. */ goacc_aq_list n = gomp_malloc (sizeof (struct goacc_asyncqueue_list)); n->aq = dev->openacc.async.asyncqueue[async]; diff -ru trunk-orig/libgomp/oacc-host.c trunk-work/libgomp/oacc-host.c --- trunk-orig/libgomp/oacc-host.c 2018-12-14 18:31:07.487203770 +0800 +++ trunk-work/libgomp/oacc-host.c 2018-12-18 22:23:26.771807667 +0800 @@ -266,6 +266,9 @@ .exec_func = host_openacc_exec, + .create_thread_data_func = host_openacc_create_thread_data, + .destroy_thread_data_func = host_openacc_destroy_thread_data, + .async = { .construct_func = host_openacc_async_construct, .destruct_func = host_openacc_async_destruct, @@ -278,9 +281,6 @@ .host2dev_func = host_openacc_async_host2dev, }, - .create_thread_data_func = host_openacc_create_thread_data, - .destroy_thread_data_func = host_openacc_destroy_thread_data, - .cuda = { .get_current_device_func = NULL, .get_current_context_func = NULL, diff -ru trunk-orig/libgomp/oacc-plugin.c trunk-work/libgomp/oacc-plugin.c --- trunk-orig/libgomp/oacc-plugin.c 2018-12-14 18:31:07.491203745 +0800 +++ trunk-work/libgomp/oacc-plugin.c 2018-12-18 22:27:46.047722004 +0800 @@ -30,6 +30,13 @@ #include "oacc-plugin.h" #include "oacc-int.h" +void +GOMP_PLUGIN_async_unmap_vars (void *ptr __attribute__((unused)), + int async __attribute__((unused))) +{ + gomp_fatal ("invalid plugin function"); +} + /* Return the target-specific part of the TLS data for the current thread. */ void * diff -ru trunk-orig/libgomp/plugin/plugin-nvptx.c trunk-work/libgomp/plugin/plugin-nvptx.c