https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127273
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tobias Burnus <[email protected]>: https://gcc.gnu.org/g:89b2fa7a74ef1f7b8f0f8f1abc3bbc412d59302a commit r17-4363-g89b2fa7a74ef1f7b8f0f8f1abc3bbc412d59302a Author: Tobias Burnus <[email protected]> Date: Wed Sep 16 15:34:34 2026 +0200 lto.cc: OpenMP's offload_handle_link_vars - fix for global variables (2/2) [PR127273] Commit r12-7776-g1002a7ace111d7 LTO: Fixes for renaming issues with offload/OpenMP [PR104285] moved the call to offload_handle_link_vars after the renaming of same-named static variables happened. However, it missed to remove the original call - such that the function is always called twice, walking the same node twice. In offload_handle_link_vars, the call to varpool_node::finalize_decl should be be after FOR_EACH_VARIABLE avoid modifying the varpool while walking it. (Albeit new items get appended to the front such that '->next' walks are not affected by added items in the current implementation.) [See r17-4073-ga6310d58aac505 for (1/2).] gcc/lto/ChangeLog: PR middle-end/127273 * lto.cc (offload_handle_link_vars): Remove has-value-expr check; store link vars and processing them after walking the varpool. (lto_main): Remove duplicated offload_handle_link_vars call.
