This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/61762] failure to optimize memcpy from constant string


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]