gnu/gcc/89b2fa7a74ef1f7b8f0f8f1abc3bbc412d59302a 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.
1 file changed