https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118513
--- Comment #6 from Nathaniel Shead <nshead at gcc dot gnu.org> --- (In reply to Jason Merrill from comment #5) > (In reply to Nathaniel Shead from comment #4) > > Confirmed. Without having looked into it too much I think maybe doing > > `varpool_node::finalize_decl` might be the way to go to cover this and any > > other related issues that may be cropping up by not having done so? > > Why aren't we calling make_rtl_for_nonlocal_decl for imported decls, anyway? I'm not 100% sure why it wasn't done initially, but I think we probably should; at the very least, split out a version of it that is appropriate for modules without doubling up work that isn't necessary. I've had some quick attempts at this in the past but I've never sat down and properly worked out exactly when it needs to be called for what decls and how etc.