On 2014.11.22 at 16:04 +0100, Martin Liška wrote: > On 11/22/2014 10:09 AM, Markus Trippelsdorf wrote: > > On 2014.11.22 at 09:05 +0100, Martin Liška wrote: > >> > >> Following patch removes memory leak that was introduced by very first IPA > >> ICF patch. > >> I would like to thank David for hunting the leak. > >> > >> Patch an bootstrap on x86_86-linux-pc and no regression is introduced. > > > > I gave the patch a quick spin on gcc112: > > > > *** Error in `/home/trippels/gcc_build_dir/./prev-gcc/lto1': free(): > > invalid next size (fast): 0x000001000a5fc160 *** > > ======= Backtrace: ========= > > /lib64/libc.so.6(+0xa3d9c)[0x3fff7b6b3d9c] > > /lib64/libc.so.6(+0xaf0b4)[0x3fff7b6bf0b4] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_ZN3vecIi7va_heap6vl_ptrE7releaseEv-0x1d4bc00)[0x1025dd88] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_ZN7ipa_icf12sem_function14equals_privateEPNS_8sem_itemER8hash_mapIP11symtab_nodeS2_22default_hashmap_traitsE-0x9c083c)[0x116586bc] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_ZN7ipa_icf12sem_function6equalsEPNS_8sem_itemER8hash_mapIP11symtab_nodeS2_22default_hashmap_traitsE-0x9c0578)[0x11658998] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_ZN7ipa_icf18sem_item_optimizer7executeEv-0x9b8774)[0x11660a84] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_ZN7ipa_icf12pass_ipa_icf7executeEP8function-0x9b0314)[0x11668efc] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_Z16execute_one_passP8opt_pass-0x1647588)[0x1098a0a8] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_Z21execute_ipa_pass_listP8opt_pass-0x1644c2c)[0x1098ca7c] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_Z8lto_mainv-0x1df20e4)[0x101b494c] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1[0x10b599b8] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(_ZN6toplev4mainEiPPc-0x1e8be70)[0x101507b8] > > /home/trippels/gcc_build_dir/./prev-gcc/lto1(main-0x1ec8d8c)[0x1015493c] > > /lib64/libc.so.6(+0x447ac)[0x3fff7b6547ac] > > /lib64/libc.so.6(__libc_start_main-0x19cbf4)[0x3fff7b6549d4] > > ======= Memory map: ======== > > ... > > > > Thank you for testing, problem is that I should grow the vector by 1, because > '0' is used as NULL value. > > Please try my fixed patch.
This one survives bootstrap-lto. Thanks. -- Markus