lto-wrapper.cc: Delete offload_names temp files in case of error [PR106686]
authorTobias Burnus <tobias@codesourcery.com>
Mon, 22 Aug 2022 07:49:52 +0000 (09:49 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 22 Aug 2022 07:49:52 +0000 (09:49 +0200)
commite228683b244c6afbe3bdfef7ba607fbda813bd0f
treee05ef5e10ea703a758b1ba6e4ad0f50c723d9124
parentc77fae1ca796d6ea06d5cd437909905c3d3d771c
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.
gcc/lto-wrapper.cc