On Thu, Nov 27, 2014 at 3:36 PM, Martin Liška <mli...@suse.cz> wrote:
> On 11/23/2014 10:01 AM, Markus Trippelsdorf wrote:
>>
>> On 2014.11.22 at 17:46 +0100, Markus Trippelsdorf wrote:
>>>
>>> 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.
>>
>>
>> But Firefox doesn't build:
>>
>> /home/trippels/gcc_test/usr/local/bin/c++ -fPIC -Wall -Wempty-body
>> -Woverloaded-virtual -Wsign-compare -Wwrite-strings -Werror=endif-labels
>> -Werror=int-to-pointer-cast -Werror=missing-braces -Werror=pointer-arith
>> -Werror=return-type -Werror=sequence-point -Werror=unused-label
>> -Werror=trigraphs -Werror=type-limits -Wno-invalid-offsetof -Wcast-align
>> -flto=160 --param lto-partitions=160 -mcpu=power8 -ffunction-sections
>> -fdata-sections -fno-exceptions -fno-strict-aliasing -frtti -fno-exceptions
>> -fno-math-errno -std=gnu++0x -pthread -pipe -UDEBUG -DNDEBUG -O3
>> -DU_STATIC_IMPLEMENTATION -fvisibility=hidden -W -Wall -pedantic
>> -Wpointer-arith -Wwrite-strings -Wno-long-long -Wno-unused
>> -Wno-unused-parameter   -lpthread
>> -Wl,--hash-style=gnu,--as-needed,--gc-sections,--icf=all -Wl,-z,noexecstack
>> -Wl,-z,text -Wl,--build-id -Wl,--gc-sections  -o ../../bin/makeconv
>> makeconv.o ucnvstat.o genmbcs.o gencnvex.o -L../../lib -licutu -L../../lib
>> -licui18n -L../../lib -licuuc -L../../stubdata -licudata -
>
> l
> pthread -ldl -lm
>>
>> lto1: internal compiler error: in operator[], at vec.h:736
>> 0x10122377 vec<int, va_heap, vl_embed>::operator[](unsigned int)
>>          ../../gcc/gcc/vec.h:736
>> 0x10d1a0f3 vec<int, va_heap, vl_embed>::operator[](unsigned int)
>>          ../../gcc/gcc/ipa-icf.c:963
>> 0x10d1a0f3 vec<int, va_heap, vl_ptr>::operator[](unsigned int)
>>          ../../gcc/gcc/vec.h:1202
>> 0x10d1a0f3 ipa_icf::sem_function::bb_dict_test(auto_vec<int, 0ul>&, int,
>> int)
>>          ../../gcc/gcc/ipa-icf.c:970
>> 0x10d1aa73 ipa_icf::sem_function::equals_private(ipa_icf::sem_item*,
>> hash_map<symtab_node*, ipa_icf::sem_item*, default_hashmap_traits>&)
>>          ../../gcc/gcc/ipa-icf.c:512
>> 0x10d1afb3 ipa_icf::sem_function::equals(ipa_icf::sem_item*,
>> hash_map<symtab_node*, ipa_icf::sem_item*, default_hashmap_traits>&)
>>          ../../gcc/gcc/ipa-icf.c:384
>> 0x10d1dba3
>> ipa_icf::sem_item_optimizer::subdivide_classes_by_equality(bool)
>>          ../../gcc/gcc/ipa-icf.c:1833
>> 0x10d2397f ipa_icf::sem_item_optimizer::execute()
>>          ../../gcc/gcc/ipa-icf.c:1652
>> 0x10d24a93 ipa_icf_driver
>>          ../../gcc/gcc/ipa-icf.c:2382
>> 0x10d24a93 ipa_icf::pass_ipa_icf::execute(function*)
>>          ../../gcc/gcc/ipa-icf.c:2430
>> Please submit a full bug report,
>> with preprocessed source if appropriate.
>> Please include the complete backtrace with any bug report.
>> See <http://gcc.gnu.org/bugs.html> for instructions.
>> lto-wrapper: fatal error: /home/trippels/gcc_test/usr/local/bin/c++
>> returned 1 exit status
>> compilation terminated.
>> /home/trippels/bin/ld: fatal error: lto-wrapper failed
>> collect2: error: ld returned 1 exit status
>> make[8]: *** [../../bin/makeconv] Error 1
>>
>
> Hi.
>
> Well, this final version can run profiled-bootstrap and I capable of
> building FF with LTO.

I think that auto_vec<> passes just fine as vec<> thus no need for
the reference passing.

Ok with that change.

Thanks,
Richard.

> Ready for trunk?
> Thanks,
> Martin

Reply via email to