re PR c++/25874 ([gomp] ICE in calc_dfs_tree())
authorJakub Jelinek <jakub@redhat.com>
Sat, 14 Apr 2007 18:52:45 +0000 (20:52 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 14 Apr 2007 18:52:45 +0000 (20:52 +0200)
PR c++/25874
* omp-low.c (expand_omp_parallel): If child_cfun->cfg, free dominators,
post dominators and cleanup cfg before returning.

* gcc.dg/gomp/pr25874.c: Add dg-options.
* g++.dg/gomp/pr25874.C: Add dg-options.

From-SVN: r123822

gcc/ChangeLog
gcc/omp-low.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/gomp/pr25874.C
gcc/testsuite/gcc.dg/gomp/pr25874.c

index 016c62ade409dd85a89632405d6fc234f00357df..c564780fe1f3ffacb2345fd03af7aa42c69ef607 100644 (file)
@@ -1,3 +1,9 @@
+2007-04-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/25874
+       * omp-low.c (expand_omp_parallel): If child_cfun->cfg, free dominators,
+       post dominators and cleanup cfg before returning.
+
 2007-04-14  Bernd Schmidt  <bernd.schmidt@analog.com>
 
        * config/bfin/bfin.h (MODES_TIEABLE_P): Allow more modes to be tied.
index f176f9e410215b60942770b52892b4f591ea7efa..5715812c2dc99eabaa225f3417073c847cc25807 100644 (file)
@@ -2409,6 +2409,7 @@ expand_omp_parallel (struct omp_region *region)
   block_stmt_iterator si;
   tree entry_stmt;
   edge e;
+  bool do_cleanup_cfg = false;
 
   entry_stmt = last_stmt (region->entry);
   child_fn = OMP_PARALLEL_FN (entry_stmt);
@@ -2444,6 +2445,7 @@ expand_omp_parallel (struct omp_region *region)
          exit_succ_e = single_succ_edge (exit_bb);
          make_edge (new_bb, exit_succ_e->dest, EDGE_FALLTHRU);
        }
+      do_cleanup_cfg = true;
     }
   else
     {
@@ -2537,6 +2539,14 @@ expand_omp_parallel (struct omp_region *region)
 
   /* Emit a library call to launch the children threads.  */
   expand_parallel_call (region, new_bb, entry_stmt, ws_args);
+
+  if (do_cleanup_cfg)
+    {
+      /* Clean up the unreachable sub-graph we created above.  */
+      free_dominance_info (CDI_DOMINATORS);
+      free_dominance_info (CDI_POST_DOMINATORS);
+      cleanup_tree_cfg ();
+    }
 }
 
 
index 29ee918ee3745c76fa05b6700c14fe52d392f8dd..2d2c891a366f411bf8b4e33626053338ad5abbd0 100644 (file)
@@ -1,3 +1,9 @@
+2007-04-14  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/25874
+       * gcc.dg/gomp/pr25874.c: Add dg-options.
+       * g++.dg/gomp/pr25874.C: Add dg-options.
+
 2007-04-14  Bernhard Fischer  <aldot@gcc.gnu.org>
        
        PR fortran/21061
index 02adef97f5688f614ea23b3f4294d05f06028696..83573f10a57396f6214acc1cb002480abbd82547 100644 (file)
@@ -1,3 +1,5 @@
+// { dg-options "-O -fopenmp" }
+
 int foo();
 
 struct wigner_d
index 568e1f04f884debedc96d8fb40c004e880db3964..2afd02ea326ca6d8316478469513e9e52f09950d 100644 (file)
@@ -1,3 +1,5 @@
+/* { dg-options "-O -fopenmp" } */
+
 void foo();
 
 inline void bar()