re PR middle-end/79505 (Memory leaks in oacc_loop_discover_walk)
authorJakub Jelinek <jakub@redhat.com>
Tue, 14 Feb 2017 19:40:27 +0000 (20:40 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 14 Feb 2017 19:40:27 +0000 (20:40 +0100)
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
gcc/omp-offload.c

index 9ed8713210b0e6013fb17dda7935f11f7d0a1ece..83d4e8f788310e4e503c25b67c95d61c02bb3325 100644 (file)
@@ -1,5 +1,9 @@
 2017-02-14  Jakub Jelinek  <jakub@redhat.com>
 
+       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,
index 11696b86c7251592280e1b7b72ccad1f91165d70..aed9e140a72582178f15f362d52fb29e579c01a5 100644 (file)
@@ -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);
 }