https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61762
--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> --- Does the following additional patch fix the existing testcase? Index: varpool.c =================================================================== --- varpool.c (revision 213342) +++ varpool.c (working copy) @@ -413,8 +413,11 @@ ctor_for_folding (tree decl) } } - if ((!DECL_VIRTUAL_P (real_decl) - || DECL_INITIAL (real_decl) == error_mark_node + if (DECL_VIRTUAL_P (real_decl) + && DECL_INITIAL (real_decl) != error_mark_node) + return DECL_INITIAL (real_decl); + + if ((DECL_INITIAL (real_decl) == error_mark_node || !DECL_INITIAL (real_decl)) && (!node || !node->ctor_useable_for_folding_p ())) return error_mark_node;