https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98599
--- Comment #15 from Jan Hubicka <hubicka at ucw dot cz> --- > Should be fixed by the above patch, though it's more of a workaround for now; > am still not sure about what's going on with clones. I undestand it now. The problem is that fixup is missed for one gimple body after statements was renumbered by analyzer. The reason is confused check for has_gimple_body_p. We do not really get out of sync between uids of functions and its clone, since we stream only clone, but with the fact that stream in code expects uids to be continuously increasing. So apparenlty analyzer is first pass that does use UIDs of statements at WPA time. Sorry for taking so long time to understand this. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index ceb61bb300b..5903f75ac23 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -306,7 +306,7 @@ lto_wpa_write_files (void) cgraph_node *node; /* Do body modifications needed for streaming before we fork out worker processes. */ - FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node) + FOR_EACH_FUNCTION (node) if (!node->clone_of && gimple_has_body_p (node->decl)) lto_prepare_function_for_streaming (node);