From 622f6b642a6c90720becec67d63a7b2f9e40a675 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 14 Feb 2017 20:40:27 +0100 Subject: [PATCH] re PR middle-end/79505 (Memory leaks in oacc_loop_discover_walk) PR middle-end/79505 * omp-offload.c (free_oacc_loop): Release loop->ifns vector. (new_oacc_loop_raw): Don't clear already cleared fields. From-SVN: r245445 --- gcc/ChangeLog | 4 ++++ gcc/omp-offload.c | 11 +---------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ed8713210b..83d4e8f7883 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2017-02-14 Jakub Jelinek + PR middle-end/79505 + * omp-offload.c (free_oacc_loop): Release loop->ifns vector. + (new_oacc_loop_raw): Don't clear already cleared fields. + PR target/79481 * config/i386/avx512pfintrin.h (_mm512_prefetch_i32gather_pd, _mm512_prefetch_i32gather_ps, _mm512_prefetch_i64gather_pd, diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c index 11696b86c72..aed9e140a72 100644 --- a/gcc/omp-offload.c +++ b/gcc/omp-offload.c @@ -681,7 +681,6 @@ new_oacc_loop_raw (oacc_loop *parent, location_t loc) oacc_loop *loop = XCNEW (oacc_loop); loop->parent = parent; - loop->child = loop->sibling = NULL; if (parent) { @@ -690,15 +689,6 @@ new_oacc_loop_raw (oacc_loop *parent, location_t loc) } loop->loc = loc; - loop->marker = NULL; - memset (loop->heads, 0, sizeof (loop->heads)); - memset (loop->tails, 0, sizeof (loop->tails)); - loop->routine = NULL_TREE; - - loop->mask = loop->e_mask = loop->flags = loop->inner = 0; - loop->chunk_size = 0; - loop->head_end = NULL; - return loop; } @@ -773,6 +763,7 @@ free_oacc_loop (oacc_loop *loop) if (loop->child) free_oacc_loop (loop->child); + loop->ifns.release (); free (loop); } -- 2.30.2