Not all types of the IL and its trees are fixed up by lto_fixup_decls as can be seen by attached patch.
Created attachment 18726 [details] patch for debugging
I am looking into this.
It's mostly a) target specific builtin types and decls that do not get fixed up b) LTO (or rather generic) builtin functions and types not get fixed up c) the tree.c local canonical type machinery that isn't giving the same answer as gimple_register_type () does. with that "fixed" the sanity-checking patch works fine. For a more proper patch I have to think about the tree.c type hashing and unification some more.
Fixed in 4.9 with SCC merging.