The nvptx reverse-offload code mishandled the case that there was a reverse offload function that isn't called inside a target region. In that case, the linker did not include GOMP_target_ext and the global variable it uses. But the plugin-nvptx.c code expected that the latter is present. Found via sollve_vv's tests/5.0/requires/test_requires_reverse_offload.c which is similar to the new testcase. (Albeit the 'if' and comments imply that the sollve_vv author did not intend this.) Solution: Handle it gracefully that the global variable does not exist - and do this check first - and only when successful allocate dev->rev_data. If not, deallocate rev_fn_table to disable reverse offload handling. OK for mainline? Tobias PS: Admittedly, the nvptx code is not yet exercised as I still have to submit the libgomp/target.c code handling the reverse offload (+ enabling requires reverse_offload in plugin-nvptx.c). As it is obvious from this patch, the target.c patch is nearly but not yet completely ready. - That patch passes the three sollve_vv testcases and also the existing libgomp testcases, but some corner cases and more testcases are missing. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955