I found a couple of /tmp/ccGARvpn.target.o files - which are surely unintended leftovers. The filename is returned by lto-wrapper.cc's compile_offload_image and then collected in offload_names[next_name_entry] = compile_offload_image (...) and processed as if (offload_names) { find_crtoffloadtable (save_temps, dumppfx); for (i = 0; offload_names[i]; i++) printf ("%s\n", offload_names[i]); That seems to work well if not error occurred - but if there was an error, it seems to be the only file suffix which is not cleaned up. Reproducer: - You need a GCC configured for offload (nvptx, gcn or intelmic) - You need to get it to fail. On mainline, one way is to compile the following with offloading: 'gcc -fopenmp *.c' which outputs: lto1: error: OpenMP 'requires' directive with 'unified_shared_memory' specified only in some compilation units lto1: fatal error: errors during merging of translation units Input: ------- 1.c ---------- #pragma omp requires unified_shared_memory int i; void foo() { #pragma omp target enter data map(to:i) } ------- 2.c ---------- int j; void foo() { #pragma omp target enter data map(to:j) }
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-August/600033.html
The master branch has been updated by Tobias Burnus <burnus@gcc.gnu.org>: https://gcc.gnu.org/g:e228683b244c6afbe3bdfef7ba607fbda813bd0f commit r13-2135-ge228683b244c6afbe3bdfef7ba607fbda813bd0f Author: Tobias Burnus <tobias@codesourcery.com> Date: Mon Aug 22 09:49:52 2022 +0200 lto-wrapper.cc: Delete offload_names temp files in case of error [PR106686] Usually, the caller takes care of the .o files for the offload compilers (suffix: ".target.o"). However, if an error occurs during processing (e.g. fatal error by lto1), they were not deleted. gcc/ChangeLog: PR lto/106686 * lto-wrapper.cc (free_array_of_ptrs): Move before tool_cleanup. (tool_cleanup): Unlink offload_names. (compile_offload_image): Take filename argument to set it early. (compile_images_for_offload_targets): Update call; set offload_names to NULL after freeing the array.
FIXED on GCC 13 (mainline).