This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/61762] failure to optimize memcpy from constant string
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 01 Aug 2014 12:26:08 +0000
- Subject: [Bug middle-end/61762] failure to optimize memcpy from constant string
- Auto-submitted: auto-generated
- References: <bug-61762-4 at http dot gcc dot gnu dot org/bugzilla/>
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;