The problem here was that with -fcompare-debug, execute_cleanup_cfg_post_optimizing wants to print out all the decls used in a function, which involves printing the DECL_INITIAL, and the instantiation of a FIELD_DECL with an NSDMI had an uninstantiated DECL_INITIAL, so the dumper got confused by the C++ tree codes. Fixed by setting DECL_INITIAL of instantiated FIELD_DECLs to error_mark_node and using DECL_TEMPLATE_INFO to look up the original NSDMI instead. Tested x86_64-pc-linux-gnu, applying to trunk.