http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51737
--- Comment #16 from Jan Hubicka <hubicka at ucw dot cz> 2012-02-29 15:24:18 UTC --- > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51737 > > --- Comment #15 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-02-29 > 15:17:33 UTC --- > (In reply to comment #13) > > > The question is why we call delete_unreachable_blocks from > > > tree_function_versioning at all. We do not bother updating the > > > callgraph anywhere else. > > > > > > Honza, you added that beast? > > > > Well, after clonning we alter CFG and we need to update SSA for which we > > need > > to update dominators and those needs unreachable blocks gone. I will look > > into > > this. > > Ok - but why bother updating the callgraph? Because the edges still hold important information about inlining and redirecting, so we can not rebuild callgraph because the info would be lost. Ignoring the update would result in ill formed callgraph with missing/stale edges that is probably way to hell, too. So I opted to write code to keep it up to date. This is all part of the materialization clones: we do have virtual clones of single function, each with different parameters and different redirection of it. With materialization we need to build the bodies in one step, update the call according to edge redirection in following step and finally inline before doing the local optimization. Callgrpah needs to stay intact over the whole process. (and as we discussed, we may want to make it intact even longer ;) Honza