https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116847
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Feels like what I was seeing on i686-linux but not on x86_64-linux. Under valgrind I saw errors like: ==4027220== Source and destination overlap in memcpy(0x4627154, 0x4627154, 12) ==4027220== at 0x404B93E: memcpy (vg_replace_strmem.c:1123) ==4027220== by 0xAAD5618: allocate_object(unsigned int, obstack&) (pretty-print.cc:1183) ==4027220== by 0xAAD8C0E: operator new (pretty-print.cc:1210) ==4027220== by 0xAAD8C0E: make (pretty-print-format-impl.h:305) ==4027220== by 0xAAD8C0E: format_phase_1 (pretty-print.cc:1659) ==4027220== by 0xAAD8C0E: pretty_printer::format(text_info&) (pretty-print.cc:1618) ==4027220== by 0xAAA840E: pp_format (pretty-print.h:583) ==4027220== by 0xAAA840E: diagnostic_context::report_diagnostic(diagnostic_info*) (diagnostic.cc:1260) ==4027220== by 0xAAA8703: diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, char**, diagnostic_t) (diagnostic.cc:1404) ==4027220== by 0xAAB8682: warning(diagnostic_option_id, char const*, ...) (diagnostic-global-context.cc:166) ==4027220== by 0x97725F5: warn_deprecated_use(tree_node*, tree_node*) (tree.cc:12485) ==4027220== by 0x8B6694B: mark_used(tree_node*, int) (decl2.cc:6121) ==4027220== by 0x8C9E25E: tsubst_expr(tree_node*, tree_node*, int, tree_node*) [clone .part.0] (pt.cc:21626) ==4027220== by 0x8C9E5E6: tsubst_expr(tree_node*, tree_node*, int, tree_node*) [clone .part.0] (pt.cc:20935) ==4027220== by 0x8C9E1D7: tsubst_expr(tree_node*, tree_node*, int, tree_node*) [clone .part.0] (pt.cc:20424) ==4027220== by 0x8C9DF2E: tsubst_expr(tree_node*, tree_node*, int, tree_node*) [clone .part.0] (pt.cc:20496) so I'm not trying: --- gcc/pretty-print.cc.jj +++ gcc/pretty-print.cc @@ -1180,7 +1180,7 @@ allocate_object (size_t sz, obstack &s) /* We must not be half-way through an object. */ gcc_assert (obstack_base (&s) == obstack_next_free (&s)); - obstack_grow (&s, obstack_base (&s), sz); + obstack_blank (&s, sz); void *buf = obstack_finish (&s); return buf; } fix for that and with that I can't reproduce the warnings any more on the single test, full regtest now running.