public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch
@ 2021-02-08 13:09 rguenth at gcc dot gnu.org
  2021-02-08 13:09 ` [Bug tree-optimization/99002] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-08 13:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99002
           Summary: [11 Regression] memory leak in if-to-switch
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

==1542== Memcheck, a memory error detector
==1542== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1542== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==1542== Command: ./cc1 -quiet -fdiagnostics-plain-output -O2 -fno-tree-vrp
-fdump-tree-dom2-details -o ssa-dom-thread-1.s
/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-11.c
==1542==
==1542==
==1542== HEAP SUMMARY:
==1542==     in use at exit: 1,875,265 bytes in 2,696 blocks
==1542==   total heap usage: 16,329 allocs, 13,633 frees, 6,189,742 bytes
allocated
==1542==
==1542== 64 bytes in 1 blocks are definitely lost in loss record 151 of 682
==1542==    at 0x4C2E94F: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==1542==    by 0x24FFE0F: find_conditions(basic_block_def*,
hash_map<basic_block_def*, condition_info*,
simple_hashmap_traits<default_hash_traits<basic_block_def*>, condition_info*>
>*) (gimple-if-to-switch.cc:398)
==1542==    by 0x250044B: (anonymous
namespace)::pass_if_to_switch::execute(function*) (gimple-if-to-switch.cc:499)
==1542==    by 0x12E8130: execute_one_pass(opt_pass*) (passes.c:2572)
==1542==    by 0x12E8467: execute_pass_list_1(opt_pass*) (passes.c:2661)
==1542==    by 0x12E8498: execute_pass_list_1(opt_pass*) (passes.c:2662)
==1542==    by 0x12E84F0: execute_pass_list(function*, opt_pass*)
(passes.c:2672)
==1542==    by 0x12E6425: do_per_function_toporder(void (*)(function*, void*),
void*) (passes.c:1774)
==1542==    by 0x12E9120: execute_ipa_pass_list(opt_pass*) (passes.c:3006)
==1542==    by 0xCFC9D6: ipa_passes() (cgraphunit.c:2157)
==1542==    by 0xCFCE0C: symbol_table::compile() (cgraphunit.c:2292)
==1542==    by 0xCFD379: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2540)
==1542==

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/99002] [11 Regression] memory leak in if-to-switch
  2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
@ 2021-02-08 13:09 ` rguenth at gcc dot gnu.org
  2021-02-08 16:25 ` marxin at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-08 13:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marxin at gcc dot gnu.org
   Target Milestone|---                         |11.0

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/99002] [11 Regression] memory leak in if-to-switch
  2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
  2021-02-08 13:09 ` [Bug tree-optimization/99002] " rguenth at gcc dot gnu.org
@ 2021-02-08 16:25 ` marxin at gcc dot gnu.org
  2021-02-09 19:14 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-08 16:25 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-02-08
           Assignee|unassigned at gcc dot gnu.org      |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Mine.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/99002] [11 Regression] memory leak in if-to-switch
  2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
  2021-02-08 13:09 ` [Bug tree-optimization/99002] " rguenth at gcc dot gnu.org
  2021-02-08 16:25 ` marxin at gcc dot gnu.org
@ 2021-02-09 19:14 ` rguenth at gcc dot gnu.org
  2021-02-10  8:26 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-02-09 19:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Another one:

==17557== Memcheck, a memory error detector
==17557== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==17557== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==17557== Command: ./cc1 -quiet -fdiagnostics-plain-output -O3 -o
ssa-dom-thread-1.s
/home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/torture/pr63464.c
==17557== 
==17557== 
==17557== HEAP SUMMARY:
==17557==     in use at exit: 1,890,206 bytes in 2,855 blocks
==17557==   total heap usage: 86,712 allocs, 83,857 frees, 16,547,876 bytes
allocated
==17557== 
==17557== 448 bytes in 8 blocks are definitely lost in loss record 674 of 760
==17557==    at 0x4C2E94F: operator new(unsigned long) (in
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==17557==    by 0x24FF041: if_chain::is_beneficial()
(gimple-if-to-switch.cc:207)
==17557==    by 0x250052F: (anonymous
namespace)::pass_if_to_switch::execute(function*) (gimple-if-to-switch.cc:545)
==17557==    by 0x12E7FEA: execute_one_pass(opt_pass*) (passes.c:2572)
==17557==    by 0x12E8321: execute_pass_list_1(opt_pass*) (passes.c:2661)
==17557==    by 0x12E8352: execute_pass_list_1(opt_pass*) (passes.c:2662)
==17557==    by 0x12E83AA: execute_pass_list(function*, opt_pass*)
(passes.c:2672)
==17557==    by 0x12E62DF: do_per_function_toporder(void (*)(function*, void*),
void*) (passes.c:1774)
==17557==    by 0x12E8FDA: execute_ipa_pass_list(opt_pass*) (passes.c:3006)
==17557==    by 0xCFC9EE: ipa_passes() (cgraphunit.c:2157)
==17557==    by 0xCFCE24: symbol_table::compile() (cgraphunit.c:2292)
==17557==    by 0xCFD391: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2540)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/99002] [11 Regression] memory leak in if-to-switch
  2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-02-09 19:14 ` rguenth at gcc dot gnu.org
@ 2021-02-10  8:26 ` cvs-commit at gcc dot gnu.org
  2021-02-10  8:26 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-10  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:5da5d8a02c6799e60970fef72ee8c1c3d033a5e5

commit r11-7164-g5da5d8a02c6799e60970fef72ee8c1c3d033a5e5
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Feb 9 09:50:04 2021 +0100

    if-to-switch: fix a memory leak

    gcc/ChangeLog:

            PR tree-optimization/99002
            * gimple-if-to-switch.cc (find_conditions): Fix memory leak
            in the function.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/99002] [11 Regression] memory leak in if-to-switch
  2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-02-10  8:26 ` cvs-commit at gcc dot gnu.org
@ 2021-02-10  8:26 ` marxin at gcc dot gnu.org
  2021-02-10  8:41 ` marxin at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-10  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed on master.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/99002] [11 Regression] memory leak in if-to-switch
  2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-02-10  8:26 ` marxin at gcc dot gnu.org
@ 2021-02-10  8:41 ` marxin at gcc dot gnu.org
  2021-02-10 12:21 ` cvs-commit at gcc dot gnu.org
  2021-02-10 12:28 ` marxin at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-10  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|FIXED                       |---
             Status|RESOLVED                    |REOPENED

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> Another one:
> 
> ==17557== Memcheck, a memory error detector
> ==17557== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
> ==17557== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
> ==17557== Command: ./cc1 -quiet -fdiagnostics-plain-output -O3 -o
> ssa-dom-thread-1.s
> /home/rguenther/src/gcc3/gcc/testsuite/gcc.dg/torture/pr63464.c
> ==17557== 
> ==17557== 
> ==17557== HEAP SUMMARY:
> ==17557==     in use at exit: 1,890,206 bytes in 2,855 blocks
> ==17557==   total heap usage: 86,712 allocs, 83,857 frees, 16,547,876 bytes
> allocated
> ==17557== 
> ==17557== 448 bytes in 8 blocks are definitely lost in loss record 674 of 760
> ==17557==    at 0x4C2E94F: operator new(unsigned long) (in
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==17557==    by 0x24FF041: if_chain::is_beneficial()
> (gimple-if-to-switch.cc:207)
> ==17557==    by 0x250052F: (anonymous
> namespace)::pass_if_to_switch::execute(function*)
> (gimple-if-to-switch.cc:545)
> ==17557==    by 0x12E7FEA: execute_one_pass(opt_pass*) (passes.c:2572)
> ==17557==    by 0x12E8321: execute_pass_list_1(opt_pass*) (passes.c:2661)
> ==17557==    by 0x12E8352: execute_pass_list_1(opt_pass*) (passes.c:2662)
> ==17557==    by 0x12E83AA: execute_pass_list(function*, opt_pass*)
> (passes.c:2672)
> ==17557==    by 0x12E62DF: do_per_function_toporder(void (*)(function*,
> void*), void*) (passes.c:1774)
> ==17557==    by 0x12E8FDA: execute_ipa_pass_list(opt_pass*) (passes.c:3006)
> ==17557==    by 0xCFC9EE: ipa_passes() (cgraphunit.c:2157)
> ==17557==    by 0xCFCE24: symbol_table::compile() (cgraphunit.c:2292)
> ==17557==    by 0xCFD391: symbol_table::finalize_compilation_unit()
> (cgraphunit.c:2540)

I've got a patch for this on.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/99002] [11 Regression] memory leak in if-to-switch
  2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-02-10  8:41 ` marxin at gcc dot gnu.org
@ 2021-02-10 12:21 ` cvs-commit at gcc dot gnu.org
  2021-02-10 12:28 ` marxin at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-10 12:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Liska <marxin@gcc.gnu.org>:

https://gcc.gnu.org/g:57d1b68d6582efec5a7ca63ea56a1cedbfe6e874

commit r11-7169-g57d1b68d6582efec5a7ca63ea56a1cedbfe6e874
Author: Martin Liska <mliska@suse.cz>
Date:   Wed Feb 10 09:39:54 2021 +0100

    if-to-switch: fix memory leak in case merging

    gcc/ChangeLog:

            PR tree-optimization/99002
            PR tree-optimization/99026
            * gimple-if-to-switch.cc (if_chain::is_beneficial): Fix memory
            leak when adjacent cases are merged.
            * tree-switch-conversion.c
(switch_decision_tree::analyze_switch_statement): Use
            release_clusters.
            (make_pass_lower_switch): Remove trailing whitespace.
            * tree-switch-conversion.h (release_clusters): New.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug tree-optimization/99002] [11 Regression] memory leak in if-to-switch
  2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-02-10 12:21 ` cvs-commit at gcc dot gnu.org
@ 2021-02-10 12:28 ` marxin at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-02-10 12:28 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|REOPENED                    |RESOLVED

--- Comment #7 from Martin Liška <marxin at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-10 12:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-08 13:09 [Bug tree-optimization/99002] New: [11 Regression] memory leak in if-to-switch rguenth at gcc dot gnu.org
2021-02-08 13:09 ` [Bug tree-optimization/99002] " rguenth at gcc dot gnu.org
2021-02-08 16:25 ` marxin at gcc dot gnu.org
2021-02-09 19:14 ` rguenth at gcc dot gnu.org
2021-02-10  8:26 ` cvs-commit at gcc dot gnu.org
2021-02-10  8:26 ` marxin at gcc dot gnu.org
2021-02-10  8:41 ` marxin at gcc dot gnu.org
2021-02-10 12:21 ` cvs-commit at gcc dot gnu.org
2021-02-10 12:28 ` marxin at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).