http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038
--- Comment #19 from Jan Hubicka <hubicka at gcc dot gnu.org> --- Ok, I got a self contained testcase for this and indeed, it is safe to remove that assert. In fact it is yet another problem with weakrefs: we have weakrefs that are referring locally defined studd and we have weakrefs that are just external references. At LTO merging time we should resolve the second to first when possible, but we don't. This is just missed optimization problem. Just comment out that assert for now. Honza