This is the mail archive of the gcc-patches@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]

Re: Fix profile updating after outer loop unswitching


On Tue, Feb 14, 2017 at 12:22 PM, Martin Liška <mliska@suse.cz> wrote:
> On 02/05/2017 06:28 PM, Jan Hubicka wrote:
>> +  /* ... finally scale everything in the loop except for guarded basic blocks
>> +     where profile does not change.  */
>> +  basic_block *body = get_loop_body (loop);
>
> Hello.
>
> This hunk causes a new memory leak:
>
> ==24882== 64 bytes in 1 blocks are definitely lost in loss record 328 of 892
>
> ==24882==    at 0x4C29110: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
>
> ==24882==    by 0x115DFF7: xmalloc (xmalloc.c:147)
>
> ==24882==    by 0x6FADCC: get_loop_body(loop const*) (cfgloop.c:834)
>
> ==24882==    by 0xB77520: hoist_guard (tree-ssa-loop-unswitch.c:881)
>
> ==24882==    by 0xB77520: tree_unswitch_outer_loop (tree-ssa-loop-unswitch.c:536)
>
> ==24882==    by 0xB77520: tree_ssa_unswitch_loops() (tree-ssa-loop-unswitch.c:104)
>
> ==24882==    by 0x99C65E: execute_one_pass(opt_pass*) (passes.c:2465)
>
> ==24882==    by 0x99CE17: execute_pass_list_1(opt_pass*) (passes.c:2554)
>
> ==24882==    by 0x99CE29: execute_pass_list_1(opt_pass*) (passes.c:2555)
>
> ==24882==    by 0x99CE29: execute_pass_list_1(opt_pass*) (passes.c:2555)
>
> ==24882==    by 0x99CE74: execute_pass_list(function*, opt_pass*) (passes.c:2565)
>
> ==24882==    by 0x71E745: cgraph_node::expand() (cgraphunit.c:2038)
>
> ==24882==    by 0x71FCC3: expand_all_functions (cgraphunit.c:2174)
>
> ==24882==    by 0x71FCC3: symbol_table::compile() (cgraphunit.c:2531)
>
> ==24882==    by 0x7214DB: symbol_table::finalize_compilation_unit() (cgraphunit.c:2621)
>
> ==24882==    by 0xA5B3AB: compile_file() (toplev.c:492)
>
> ==24882==    by 0x5F3A78: do_compile (toplev.c:1984)
>
> ==24882==    by 0x5F3A78: toplev::main(int, char**) (toplev.c:2118)
>
> ==24882==    by 0x5F5826: main (main.c:39)
>
>
> Fixed in attached patch that can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?

Ok.

Thanks,
Richard.

> Martin
>


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