[gcc r14-1786] Fix memory leak in loop header copying

Richard Biener rguenth@gcc.gnu.org
Tue Jun 13 12:22:11 GMT 2023


https://gcc.gnu.org/g:2270f4fdaa0331b5c7fa53baeb7fd0038639a73f

commit r14-1786-g2270f4fdaa0331b5c7fa53baeb7fd0038639a73f
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jun 13 12:39:46 2023 +0200

    Fix memory leak in loop header copying
    
            * tree-ssa-loop-ch.cc (ch_base::copy_headers): Free loop BBs.

Diff:
---
 gcc/tree-ssa-loop-ch.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/tree-ssa-loop-ch.cc b/gcc/tree-ssa-loop-ch.cc
index 7fdef3bb11a..22252bee135 100644
--- a/gcc/tree-ssa-loop-ch.cc
+++ b/gcc/tree-ssa-loop-ch.cc
@@ -642,6 +642,7 @@ ch_base::copy_headers (function *fun)
 	       if (stmt_can_terminate_bb_p (gsi_stmt (bsi)))
 		 precise = false;
 	   }
+	  free (bbs);
 	}
       if (precise
 	  && get_max_loop_iterations_int (loop) == 1)


More information about the Gcc-cvs mailing list