https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89392

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cmtice at google dot com

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
So some major memory corruption going on from VTV, valgrind errors start with

==13824== Invalid read of size 8
==13824==    at 0xCB9D8A: bitmap_alloc(bitmap_obstack*) (bitmap.c:763)
==13824==    by 0x16020A9: remove_unused_locals() (tree-ssa-live.c:743)
==13824==    by 0x12B1BA4: execute_function_todo(function*, void*)
(passes.c:1955)
==13824==    by 0x12B0CCF: do_per_function(void (*)(function*, void*), void*)
(passes.c:1638)
==13824==    by 0x12B1E81: execute_todo(unsigned int) (passes.c:2031)
==13824==    by 0x12B2D02: execute_one_pass(opt_pass*) (passes.c:2520)
==13824==    by 0x12B2EE3: execute_pass_list_1(opt_pass*) (passes.c:2569)
==13824==    by 0x12B2F6A: execute_pass_list(function*, opt_pass*)
(passes.c:2580)
==13824==    by 0x12A0F12: gcc::pass_manager::execute_early_local_passes()
(passes.c:119)
==13824==    by 0xD7D672: symbol_table::process_new_functions()
(cgraphunit.c:338)
==13824==    by 0xBD6FEC: vtv_generate_init_routine()
(vtable-class-hierarchy.c:1194)
==13824==    by 0x99FFB8: cxx_post_compilation_parsing_cleanups()
(decl2.c:5115)
==13824==  Address 0x6453598 is 120 bytes inside a block of size 65,536 alloc'd
==13824==    at 0x4C2A080: malloc (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13824==    by 0x23F5420: xmalloc (xmalloc.c:147)
==13824==    by 0xC41BB0: memory_block_pool::allocate() (memory-block.h:56)
==13824==    by 0x23844C6: mempool_obstack_chunk_alloc(unsigned long)
(memory-bl

it looks to me vtv_generate_init_routine() may not simply dispatch to
process_new_functions () being deeply inside FE context.  VTV is even worse
than TM though.

The following fixes the ICE:

Index: gcc/cp/vtable-class-hierarchy.c
===================================================================
--- gcc/cp/vtable-class-hierarchy.c     (revision 269009)
+++ gcc/cp/vtable-class-hierarchy.c     (working copy)
@@ -1191,8 +1191,6 @@ vtv_generate_init_routine (void)
       gimplify_function_tree (vtv_fndecl);
       cgraph_node::add_new_function (vtv_fndecl, false);

-      symtab->process_new_functions ();
-
       if (flag_vtable_verify == VTV_PREINIT_PRIORITY && !TARGET_PECOFF)
         assemble_vtv_preinit_initializer (vtv_fndecl);

there seems to be exactly _zero_ testsuite coverage for VTV...

Reply via email to