https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121238
--- Comment #9 from Nathaniel Shead <nshead at gcc dot gnu.org> --- Had a quick look tonight; the issue looks to be that TREE_ADDRESSABLE is not set on the PARM_DECL for first. Basically, we create the FUNCTION_DECL of the template instantiation for parse_integer<void> from the include (this includes any function parameters), but defer creating its body. When we then stream the module we see a definition for this instantiation and supply it, skipping the normal instantiation process: and so we never see that we take the address of the parameter, and it never gets marked ADDRESSABLE, as we kept the original PARM_DECL we created rather than using the one streamed from the module. This confuses gimplification that provides a new temporary instead, hence the error. So a fix would perhaps be to propagate TREE_ADDRESSABLE when deduping the PARM_DECLs within the body of the tree that we're loading; I'll try and whip up something that does this tomorrow if I get a chance.