public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Richard Biener <rguenth@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-6189] middle-end/103851 - ensure SSA names are released during OMP lowering
Date: Mon,  3 Jan 2022 12:51:33 +0000 (GMT)	[thread overview]
Message-ID: <20220103125133.F34BF3858C2C@sourceware.org> (raw)

https://gcc.gnu.org/g:4911609fbe47d3e4d2765cd67031a7e0ee9f5af0

commit r12-6189-g4911609fbe47d3e4d2765cd67031a7e0ee9f5af0
Author: Richard Biener <rguenther@suse.de>
Date:   Mon Jan 3 12:55:45 2022 +0100

    middle-end/103851 - ensure SSA names are released during OMP lowering
    
    This makes sure to release moved & remapped SSA names during OMP
    outlining which happens before going into SSA but with SSA names
    created by gimplification around.
    
    2022-01-03  Richard Biener  <rguenther@suse.de>
    
            PR middle-end/103851
            * tree-cfg.c (move_sese_region_to_fn): Always release SSA names.
    
            * g++.dg/gomp/pr103851.C: New testcase.

Diff:
---
 gcc/testsuite/g++.dg/gomp/pr103851.C | 15 +++++++++++++++
 gcc/tree-cfg.c                       | 20 ++++++++------------
 2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/gcc/testsuite/g++.dg/gomp/pr103851.C b/gcc/testsuite/g++.dg/gomp/pr103851.C
new file mode 100644
index 00000000000..257e4059d59
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr103851.C
@@ -0,0 +1,15 @@
+// { dg-do compile }
+// { dg-options "-fopenmp -ftrivial-auto-var-init=pattern" }
+
+struct _Deque_base {
+    long _M_map_size;
+    int *_M_start;
+    int *_M_finish;
+};
+void morphologicalFilter1D()
+{
+#pragma omp parallel
+  {
+    struct _Deque_base vals[4];
+  }
+}
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index c436e590025..bb3779367fe 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -7947,18 +7947,14 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
   if (eh_map)
     delete eh_map;
 
-  if (gimple_in_ssa_p (cfun))
-    {
-      /* We need to release ssa-names in a defined order, so first find them,
-	 and then iterate in ascending version order.  */
-      bitmap release_names = BITMAP_ALLOC (NULL);
-      vars_map.traverse<void *, gather_ssa_name_hash_map_from> (release_names);
-      bitmap_iterator bi;
-      unsigned i;
-      EXECUTE_IF_SET_IN_BITMAP (release_names, 0, i, bi)
-	release_ssa_name (ssa_name (i));
-      BITMAP_FREE (release_names);
-    }
+  /* We need to release ssa-names in a defined order, so first find them,
+     and then iterate in ascending version order.  */
+  bitmap release_names = BITMAP_ALLOC (NULL);
+  vars_map.traverse<void *, gather_ssa_name_hash_map_from> (release_names);
+  bitmap_iterator bi;
+  EXECUTE_IF_SET_IN_BITMAP (release_names, 0, i, bi)
+    release_ssa_name (ssa_name (i));
+  BITMAP_FREE (release_names);
 
   /* Rewire the entry and exit blocks.  The successor to the entry
      block turns into the successor of DEST_FN's ENTRY_BLOCK_PTR in


                 reply	other threads:[~2022-01-03 12:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220103125133.F34BF3858C2C@sourceware.org \
    --to=rguenth@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).