1 Feb 2009 01:33
[lto] Remove alias pairs for removed cgraph nodes
Diego Novillo <dnovillo <at> google.com>
2009-02-01 00:33:59 GMT
2009-02-01 00:33:59 GMT
This patch fixes the problem we have with early generation of thunks. I am not completely thrilled with it, but I have not been able to found a simpler way of fixing it. The problem is the following. Since we are now emitting thunks before functions are expanded, it may happen that a thunk is emitted for a function that later disappears and never gets emitted. This causes confusion in finish_aliases_1 when it tries to match the thunk to its alias target. The basic problem is that there is a circular dependency between what we need to know if a function will be expanded and the stage of compilation where we finally know. Essentially we can't know whether a cgraph node will be expanded until all the IPA transformations have been applied (particularly inlining). At that point, it is too late to expand a thunk because we have already written the IL to disk so we miss the chance to emit the thunk in the IL file. So, we emit thunks early, before the IPA passes. This may generate unneeded thunks, which was causing failures in the two test cases in the patch. The simplest solution is to remove unreachable alias pairs every time we remove unreachable nodes in the call graph. Jan, if you can suggest a better alternative to this, I'd gladly implement it.(Continue reading)
RSS Feed