https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106686
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tobias Burnus <bur...@gcc.gnu.org>: https://gcc.gnu.org/g:e228683b244c6afbe3bdfef7ba607fbda813bd0f commit r13-2135-ge228683b244c6afbe3bdfef7ba607fbda813bd0f Author: Tobias Burnus <tob...@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.